Mirror von
https://github.com/Moulberry/AxiomPaperPlugin.git
synchronisiert 2024-11-08 17:40:04 +01:00
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.entity.Player;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ServerWorldPropertyHolder<T> {
|
||||
|
||||
private T value;
|
||||
@ -56,7 +58,7 @@ public class ServerWorldPropertyHolder<T> {
|
||||
}
|
||||
|
||||
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;
|
||||
if (sync) {
|
||||
this.sync(world);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren