public class ServerStatHandler extends StatHandler
Modifier and Type | Field and Description |
---|---|
private File |
file |
private int |
lastStatsUpdate |
private static Logger |
LOGGER |
private Set<Stat<?>> |
pendingStats |
private MinecraftServer |
server |
statMap
Constructor and Description |
---|
ServerStatHandler(MinecraftServer server,
File file) |
Modifier and Type | Method and Description |
---|---|
protected String |
asString() |
private <T> Optional<Stat<T>> |
createStat(StatType<T> type,
String id) |
private static <T> Identifier |
getStatId(Stat<T> stat) |
private static CompoundTag |
jsonToCompound(JsonObject jsonObject) |
void |
parse(com.mojang.datafixers.DataFixer dataFixer,
String json) |
void |
save() |
void |
sendStats(ServerPlayerEntity player) |
void |
setStat(PlayerEntity player,
Stat<?> stat,
int value) |
private Set<Stat<?>> |
takePendingStats() |
void |
updateStatSet() |
getStat, getStat, increaseStat
private static final Logger LOGGER
private final MinecraftServer server
private final File file
private int lastStatsUpdate
public ServerStatHandler(MinecraftServer server, File file)
public void save()
public void setStat(PlayerEntity player, Stat<?> stat, int value)
setStat
in class StatHandler
public void parse(com.mojang.datafixers.DataFixer dataFixer, String json)
private static CompoundTag jsonToCompound(JsonObject jsonObject)
protected String asString()
private static <T> Identifier getStatId(Stat<T> stat)
public void updateStatSet()
public void sendStats(ServerPlayerEntity player)