geforkt von Mirrors/AxiomPaperPlugin
WorldProperties: Prevent NPE if setValue is called with null
Dieser Commit ist enthalten in:
Ursprung
b6afa50b04
Commit
f38226c9fb
@ -12,6 +12,8 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.craftbukkit.v1_20_R2.util.CraftNamespacedKey;
|
import org.bukkit.craftbukkit.v1_20_R2.util.CraftNamespacedKey;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class ServerWorldPropertyHolder<T> {
|
public class ServerWorldPropertyHolder<T> {
|
||||||
|
|
||||||
private T value;
|
private T value;
|
||||||
@ -56,7 +58,7 @@ public class ServerWorldPropertyHolder<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setValue(World world, T value) {
|
public void setValue(World world, T value) {
|
||||||
boolean sync = this.unsyncedValue || !value.equals(this.value);
|
boolean sync = this.unsyncedValue || !Objects.equals(value, this.value);
|
||||||
this.value = value;
|
this.value = value;
|
||||||
if (sync) {
|
if (sync) {
|
||||||
this.sync(world);
|
this.sync(world);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren