mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:46:05 +03:00
44 lines
1.9 KiB
Diff
44 lines
1.9 KiB
Diff
From 4ee8748b101d9f1d894bc78a4f802a24907030d7 Mon Sep 17 00:00:00 2001
|
|
From: Thinkofdeath <thethinkofdeath@gmail.com>
|
|
Date: Tue, 7 Jan 2014 15:56:26 +0000
|
|
Subject: [PATCH] Allow statistics to be disabled/forced
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/stats/ServerStatisticManager.java b/src/main/java/net/minecraft/stats/ServerStatisticManager.java
|
|
index 057554a4b..937038a99 100644
|
|
--- a/src/main/java/net/minecraft/stats/ServerStatisticManager.java
|
|
+++ b/src/main/java/net/minecraft/stats/ServerStatisticManager.java
|
|
@@ -47,6 +47,13 @@ public class ServerStatisticManager extends StatisticManager {
|
|
public ServerStatisticManager(MinecraftServer minecraftserver, File file) {
|
|
this.server = minecraftserver;
|
|
this.file = file;
|
|
+ // Spigot start
|
|
+ for ( Map.Entry<MinecraftKey, Integer> entry : org.spigotmc.SpigotConfig.forcedStats.entrySet() )
|
|
+ {
|
|
+ Statistic<MinecraftKey> wrapper = StatisticList.CUSTOM.get( entry.getKey() );
|
|
+ this.stats.put( wrapper, entry.getValue().intValue() );
|
|
+ }
|
|
+ // Spigot end
|
|
if (file.isFile()) {
|
|
try {
|
|
this.parseLocal(minecraftserver.getFixerUpper(), FileUtils.readFileToString(file));
|
|
@@ -60,6 +67,7 @@ public class ServerStatisticManager extends StatisticManager {
|
|
}
|
|
|
|
public void save() {
|
|
+ if ( org.spigotmc.SpigotConfig.disableStatSaving ) return; // Spigot
|
|
try {
|
|
FileUtils.writeStringToFile(this.file, this.toJson());
|
|
} catch (IOException ioexception) {
|
|
@@ -70,6 +78,7 @@ public class ServerStatisticManager extends StatisticManager {
|
|
|
|
@Override
|
|
public void setValue(EntityHuman entityhuman, Statistic<?> statistic, int i) {
|
|
+ if ( org.spigotmc.SpigotConfig.disableStatSaving ) return; // Spigot
|
|
super.setValue(entityhuman, statistic, i);
|
|
this.dirty.add(statistic);
|
|
}
|
|
--
|
|
2.25.1
|
|
|