#1287: Fix scoreboards not updating in Player#setStatistic

This commit is contained in:
Collin 2023-10-31 21:48:21 +11:00 committed by md_5
parent 5a72c3c040
commit ffb1319bcc
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
3 changed files with 80 additions and 58 deletions

View File

@ -310,7 +310,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().incrementStatistic(statistic); getPlayer().incrementStatistic(statistic);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.incrementStatistic(manager, statistic); CraftStatistic.incrementStatistic(manager, statistic, null);
manager.save(); manager.save();
} }
} }
@ -321,7 +321,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().decrementStatistic(statistic); getPlayer().decrementStatistic(statistic);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.decrementStatistic(manager, statistic); CraftStatistic.decrementStatistic(manager, statistic, null);
manager.save(); manager.save();
} }
} }
@ -341,7 +341,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().incrementStatistic(statistic, amount); getPlayer().incrementStatistic(statistic, amount);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.incrementStatistic(manager, statistic, amount); CraftStatistic.incrementStatistic(manager, statistic, amount, null);
manager.save(); manager.save();
} }
} }
@ -352,7 +352,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().decrementStatistic(statistic, amount); getPlayer().decrementStatistic(statistic, amount);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.decrementStatistic(manager, statistic, amount); CraftStatistic.decrementStatistic(manager, statistic, amount, null);
manager.save(); manager.save();
} }
} }
@ -363,7 +363,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().setStatistic(statistic, newValue); getPlayer().setStatistic(statistic, newValue);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.setStatistic(manager, statistic, newValue); CraftStatistic.setStatistic(manager, statistic, newValue, null);
manager.save(); manager.save();
} }
} }
@ -374,7 +374,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().incrementStatistic(statistic, material); getPlayer().incrementStatistic(statistic, material);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.incrementStatistic(manager, statistic, material); CraftStatistic.incrementStatistic(manager, statistic, material, null);
manager.save(); manager.save();
} }
} }
@ -385,7 +385,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().decrementStatistic(statistic, material); getPlayer().decrementStatistic(statistic, material);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.decrementStatistic(manager, statistic, material); CraftStatistic.decrementStatistic(manager, statistic, material, null);
manager.save(); manager.save();
} }
} }
@ -405,7 +405,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().incrementStatistic(statistic, material, amount); getPlayer().incrementStatistic(statistic, material, amount);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.incrementStatistic(manager, statistic, material, amount); CraftStatistic.incrementStatistic(manager, statistic, material, amount, null);
manager.save(); manager.save();
} }
} }
@ -416,7 +416,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().decrementStatistic(statistic, material, amount); getPlayer().decrementStatistic(statistic, material, amount);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.decrementStatistic(manager, statistic, material, amount); CraftStatistic.decrementStatistic(manager, statistic, material, amount, null);
manager.save(); manager.save();
} }
} }
@ -427,7 +427,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().setStatistic(statistic, material, newValue); getPlayer().setStatistic(statistic, material, newValue);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.setStatistic(manager, statistic, material, newValue); CraftStatistic.setStatistic(manager, statistic, material, newValue, null);
manager.save(); manager.save();
} }
} }
@ -438,7 +438,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().incrementStatistic(statistic, entityType); getPlayer().incrementStatistic(statistic, entityType);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.incrementStatistic(manager, statistic, entityType); CraftStatistic.incrementStatistic(manager, statistic, entityType, null);
manager.save(); manager.save();
} }
} }
@ -449,7 +449,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().decrementStatistic(statistic, entityType); getPlayer().decrementStatistic(statistic, entityType);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.decrementStatistic(manager, statistic, entityType); CraftStatistic.decrementStatistic(manager, statistic, entityType, null);
manager.save(); manager.save();
} }
} }
@ -469,7 +469,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().incrementStatistic(statistic, entityType, amount); getPlayer().incrementStatistic(statistic, entityType, amount);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.incrementStatistic(manager, statistic, entityType, amount); CraftStatistic.incrementStatistic(manager, statistic, entityType, amount, null);
manager.save(); manager.save();
} }
} }
@ -480,7 +480,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().decrementStatistic(statistic, entityType, amount); getPlayer().decrementStatistic(statistic, entityType, amount);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.decrementStatistic(manager, statistic, entityType, amount); CraftStatistic.decrementStatistic(manager, statistic, entityType, amount, null);
manager.save(); manager.save();
} }
} }
@ -491,7 +491,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
getPlayer().setStatistic(statistic, entityType, newValue); getPlayer().setStatistic(statistic, entityType, newValue);
} else { } else {
ServerStatisticManager manager = getStatisticManager(); ServerStatisticManager manager = getStatisticManager();
CraftStatistic.setStatistic(manager, statistic, entityType, newValue); CraftStatistic.setStatistic(manager, statistic, entityType, newValue, null);
manager.save(); manager.save();
} }
} }

View File

@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableBiMap;
import net.minecraft.core.IRegistry; import net.minecraft.core.IRegistry;
import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.MinecraftKey; import net.minecraft.resources.MinecraftKey;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.stats.ServerStatisticManager; import net.minecraft.stats.ServerStatisticManager;
import net.minecraft.stats.StatisticList; import net.minecraft.stats.StatisticList;
import net.minecraft.world.entity.EntityTypes; import net.minecraft.world.entity.EntityTypes;
@ -199,12 +200,12 @@ public enum CraftStatistic {
return null; return null;
} }
public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic) { public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityPlayer player) {
incrementStatistic(manager, statistic, 1); incrementStatistic(manager, statistic, 1, player);
} }
public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic) { public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityPlayer player) {
decrementStatistic(manager, statistic, 1); decrementStatistic(manager, statistic, 1, player);
} }
public static int getStatistic(ServerStatisticManager manager, Statistic statistic) { public static int getStatistic(ServerStatisticManager manager, Statistic statistic) {
@ -213,30 +214,37 @@ public enum CraftStatistic {
return manager.getValue(CraftStatistic.getNMSStatistic(statistic)); return manager.getValue(CraftStatistic.getNMSStatistic(statistic));
} }
public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, int amount) { public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, int amount, EntityPlayer player) {
Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); Preconditions.checkArgument(amount > 0, "Amount must be greater than 0");
setStatistic(manager, statistic, getStatistic(manager, statistic) + amount); setStatistic(manager, statistic, getStatistic(manager, statistic) + amount, player);
} }
public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, int amount) { public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, int amount, EntityPlayer player) {
Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); Preconditions.checkArgument(amount > 0, "Amount must be greater than 0");
setStatistic(manager, statistic, getStatistic(manager, statistic) - amount); setStatistic(manager, statistic, getStatistic(manager, statistic) - amount, player);
} }
public static void setStatistic(ServerStatisticManager manager, Statistic statistic, int newValue) { public static void setStatistic(ServerStatisticManager manager, Statistic statistic, int newValue, EntityPlayer player) {
Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); Preconditions.checkArgument(statistic != null, "Statistic cannot be null");
Preconditions.checkArgument(statistic.getType() == Type.UNTYPED, "Must supply additional parameter for this statistic"); Preconditions.checkArgument(statistic.getType() == Type.UNTYPED, "Must supply additional parameter for this statistic");
Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0"); Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0");
net.minecraft.stats.Statistic nmsStatistic = CraftStatistic.getNMSStatistic(statistic); net.minecraft.stats.Statistic nmsStatistic = CraftStatistic.getNMSStatistic(statistic);
manager.setValue(null, nmsStatistic, newValue);; manager.setValue(null, nmsStatistic, newValue);
// Update scoreboards
if (player != null) {
player.level().getCraftServer().getScoreboardManager().getScoreboardScores(nmsStatistic, player.getScoreboardName(), score -> {
score.setScore(newValue);
});
}
} }
public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material) { public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material, EntityPlayer player) {
incrementStatistic(manager, statistic, material, 1); incrementStatistic(manager, statistic, material, 1, player);
} }
public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material) { public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material, EntityPlayer player) {
decrementStatistic(manager, statistic, material, 1); decrementStatistic(manager, statistic, material, 1, player);
} }
public static int getStatistic(ServerStatisticManager manager, Statistic statistic, Material material) { public static int getStatistic(ServerStatisticManager manager, Statistic statistic, Material material) {
@ -248,17 +256,17 @@ public enum CraftStatistic {
return manager.getValue(nmsStatistic); return manager.getValue(nmsStatistic);
} }
public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material, int amount) { public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material, int amount, EntityPlayer player) {
Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); Preconditions.checkArgument(amount > 0, "Amount must be greater than 0");
setStatistic(manager, statistic, material, getStatistic(manager, statistic, material) + amount); setStatistic(manager, statistic, material, getStatistic(manager, statistic, material) + amount, player);
} }
public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material, int amount) { public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, Material material, int amount, EntityPlayer player) {
Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); Preconditions.checkArgument(amount > 0, "Amount must be greater than 0");
setStatistic(manager, statistic, material, getStatistic(manager, statistic, material) - amount); setStatistic(manager, statistic, material, getStatistic(manager, statistic, material) - amount, player);
} }
public static void setStatistic(ServerStatisticManager manager, Statistic statistic, Material material, int newValue) { public static void setStatistic(ServerStatisticManager manager, Statistic statistic, Material material, int newValue, EntityPlayer player) {
Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); Preconditions.checkArgument(statistic != null, "Statistic cannot be null");
Preconditions.checkArgument(material != null, "Material cannot be null"); Preconditions.checkArgument(material != null, "Material cannot be null");
Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0"); Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0");
@ -266,14 +274,21 @@ public enum CraftStatistic {
net.minecraft.stats.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); net.minecraft.stats.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material);
Preconditions.checkArgument(nmsStatistic != null, "The supplied Material %s does not have a corresponding statistic", material); Preconditions.checkArgument(nmsStatistic != null, "The supplied Material %s does not have a corresponding statistic", material);
manager.setValue(null, nmsStatistic, newValue); manager.setValue(null, nmsStatistic, newValue);
// Update scoreboards
if (player != null) {
player.level().getCraftServer().getScoreboardManager().getScoreboardScores(nmsStatistic, player.getScoreboardName(), score -> {
score.setScore(newValue);
});
}
} }
public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType) { public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, EntityPlayer player) {
incrementStatistic(manager, statistic, entityType, 1); incrementStatistic(manager, statistic, entityType, 1, player);
} }
public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType) { public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, EntityPlayer player) {
decrementStatistic(manager, statistic, entityType, 1); decrementStatistic(manager, statistic, entityType, 1, player);
} }
public static int getStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType) { public static int getStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType) {
@ -285,17 +300,17 @@ public enum CraftStatistic {
return manager.getValue(nmsStatistic); return manager.getValue(nmsStatistic);
} }
public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, int amount) { public static void incrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, int amount, EntityPlayer player) {
Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); Preconditions.checkArgument(amount > 0, "Amount must be greater than 0");
setStatistic(manager, statistic, entityType, getStatistic(manager, statistic, entityType) + amount); setStatistic(manager, statistic, entityType, getStatistic(manager, statistic, entityType) + amount, player);
} }
public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, int amount) { public static void decrementStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, int amount, EntityPlayer player) {
Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); Preconditions.checkArgument(amount > 0, "Amount must be greater than 0");
setStatistic(manager, statistic, entityType, getStatistic(manager, statistic, entityType) - amount); setStatistic(manager, statistic, entityType, getStatistic(manager, statistic, entityType) - amount, player);
} }
public static void setStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, int newValue) { public static void setStatistic(ServerStatisticManager manager, Statistic statistic, EntityType entityType, int newValue, EntityPlayer player) {
Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); Preconditions.checkArgument(statistic != null, "Statistic cannot be null");
Preconditions.checkArgument(entityType != null, "EntityType cannot be null"); Preconditions.checkArgument(entityType != null, "EntityType cannot be null");
Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0"); Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0");
@ -303,5 +318,12 @@ public enum CraftStatistic {
net.minecraft.stats.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); net.minecraft.stats.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType);
Preconditions.checkArgument(nmsStatistic != null, "The supplied EntityType %s does not have a corresponding statistic", entityType); Preconditions.checkArgument(nmsStatistic != null, "The supplied EntityType %s does not have a corresponding statistic", entityType);
manager.setValue(null, nmsStatistic, newValue); manager.setValue(null, nmsStatistic, newValue);
// Update scoreboards
if (player != null) {
player.level().getCraftServer().getScoreboardManager().getScoreboardScores(nmsStatistic, player.getScoreboardName(), score -> {
score.setScore(newValue);
});
}
} }
} }

View File

@ -1054,12 +1054,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void incrementStatistic(Statistic statistic) { public void incrementStatistic(Statistic statistic) {
CraftStatistic.incrementStatistic(getHandle().getStats(), statistic); CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, getHandle());
} }
@Override @Override
public void decrementStatistic(Statistic statistic) { public void decrementStatistic(Statistic statistic) {
CraftStatistic.decrementStatistic(getHandle().getStats(), statistic); CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, getHandle());
} }
@Override @Override
@ -1069,27 +1069,27 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void incrementStatistic(Statistic statistic, int amount) { public void incrementStatistic(Statistic statistic, int amount) {
CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, amount); CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, amount, getHandle());
} }
@Override @Override
public void decrementStatistic(Statistic statistic, int amount) { public void decrementStatistic(Statistic statistic, int amount) {
CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, amount); CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, amount, getHandle());
} }
@Override @Override
public void setStatistic(Statistic statistic, int newValue) { public void setStatistic(Statistic statistic, int newValue) {
CraftStatistic.setStatistic(getHandle().getStats(), statistic, newValue); CraftStatistic.setStatistic(getHandle().getStats(), statistic, newValue, getHandle());
} }
@Override @Override
public void incrementStatistic(Statistic statistic, Material material) { public void incrementStatistic(Statistic statistic, Material material) {
CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, material); CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, material, getHandle());
} }
@Override @Override
public void decrementStatistic(Statistic statistic, Material material) { public void decrementStatistic(Statistic statistic, Material material) {
CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, material); CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, material, getHandle());
} }
@Override @Override
@ -1099,27 +1099,27 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void incrementStatistic(Statistic statistic, Material material, int amount) { public void incrementStatistic(Statistic statistic, Material material, int amount) {
CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, material, amount); CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, material, amount, getHandle());
} }
@Override @Override
public void decrementStatistic(Statistic statistic, Material material, int amount) { public void decrementStatistic(Statistic statistic, Material material, int amount) {
CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, material, amount); CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, material, amount, getHandle());
} }
@Override @Override
public void setStatistic(Statistic statistic, Material material, int newValue) { public void setStatistic(Statistic statistic, Material material, int newValue) {
CraftStatistic.setStatistic(getHandle().getStats(), statistic, material, newValue); CraftStatistic.setStatistic(getHandle().getStats(), statistic, material, newValue, getHandle());
} }
@Override @Override
public void incrementStatistic(Statistic statistic, EntityType entityType) { public void incrementStatistic(Statistic statistic, EntityType entityType) {
CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, entityType); CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, entityType, getHandle());
} }
@Override @Override
public void decrementStatistic(Statistic statistic, EntityType entityType) { public void decrementStatistic(Statistic statistic, EntityType entityType) {
CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, entityType); CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, entityType, getHandle());
} }
@Override @Override
@ -1129,17 +1129,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void incrementStatistic(Statistic statistic, EntityType entityType, int amount) { public void incrementStatistic(Statistic statistic, EntityType entityType, int amount) {
CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, entityType, amount); CraftStatistic.incrementStatistic(getHandle().getStats(), statistic, entityType, amount, getHandle());
} }
@Override @Override
public void decrementStatistic(Statistic statistic, EntityType entityType, int amount) { public void decrementStatistic(Statistic statistic, EntityType entityType, int amount) {
CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, entityType, amount); CraftStatistic.decrementStatistic(getHandle().getStats(), statistic, entityType, amount, getHandle());
} }
@Override @Override
public void setStatistic(Statistic statistic, EntityType entityType, int newValue) { public void setStatistic(Statistic statistic, EntityType entityType, int newValue) {
CraftStatistic.setStatistic(getHandle().getStats(), statistic, entityType, newValue); CraftStatistic.setStatistic(getHandle().getStats(), statistic, entityType, newValue, getHandle());
} }
@Override @Override