Begin implementation of CheckStyle style checking

This commit is contained in:
md_5
2019-04-23 14:00:30 +10:00
parent a2d787f6eb
commit 48c4c5ca81
28 changed files with 144 additions and 97 deletions

View File

@@ -1,12 +1,11 @@
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -47,6 +47,14 @@
@@ -47,6 +47,13 @@
import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import jline.console.ConsoleReader;
+import joptsimple.OptionSet;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.Main;
@@ -15,7 +14,7 @@
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable, Runnable {
@@ -65,7 +73,7 @@
@@ -65,7 +72,7 @@
public final DataFixer dataConverterManager;
private String serverIp;
private int serverPort = -1;
@@ -24,7 +23,7 @@
private PlayerList playerList;
private volatile boolean isRunning = true;
private boolean isStopped;
@@ -104,7 +112,7 @@
@@ -104,7 +111,7 @@
private final GameProfileRepository gameProfileRepository;
private final UserCache userCache;
private long Z;
@@ -33,7 +32,7 @@
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
MinecraftServer.LOGGER.error(throwable);
});
@@ -133,7 +141,20 @@
@@ -133,7 +140,20 @@
@Nullable
private String av;
@@ -55,7 +54,7 @@
super("Server");
this.ae = new ResourceManager(EnumResourcePackType.SERVER_DATA, this.serverThread);
this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new);
@@ -146,15 +167,15 @@
@@ -146,15 +166,15 @@
this.ao = new CustomFunctionData(this);
this.ap = new CircularTimer();
this.proxy = proxy;
@@ -75,7 +74,7 @@
this.dataConverterManager = datafixer;
this.ae.a((IReloadListener) this.aj);
this.ae.a((IReloadListener) this.ai);
@@ -163,7 +184,32 @@
@@ -163,7 +183,32 @@
this.ae.a((IReloadListener) this.an);
this.executorService = SystemUtils.e();
this.K = s;
@@ -108,7 +107,7 @@
private void initializeScoreboards(WorldPersistentData worldpersistentdata) {
PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard");
@@ -199,11 +245,11 @@
@@ -199,11 +244,11 @@
}
if (this.forceUpgrade) {
@@ -123,7 +122,7 @@
IChatBaseComponent ichatbasecomponent = null;
while (!worldupgrader.b()) {
@@ -242,8 +288,9 @@
@@ -242,8 +287,9 @@
}
protected void a(String s, String s1, long i, WorldType worldtype, JsonElement jsonelement) {
@@ -134,7 +133,7 @@
WorldNBTStorage worldnbtstorage = this.getConvertable().a(s, this);
this.a(this.getWorld(), worldnbtstorage);
@@ -268,24 +315,134 @@
@@ -268,24 +314,134 @@
}
this.a(worldnbtstorage.getDirectory(), worlddata);
@@ -282,7 +281,7 @@
if (!worlddata.v()) {
try {
@@ -309,23 +466,8 @@
@@ -309,23 +465,8 @@
worlddata.d(true);
}
@@ -307,7 +306,7 @@
private void a(WorldData worlddata) {
worlddata.f(false);
@@ -344,6 +486,25 @@
@@ -344,6 +485,25 @@
protected void a(File file, WorldData worlddata) {
this.resourcePackRepository.a((ResourcePackSource) (new ResourcePackSourceVanilla()));
this.resourcePackFolder = new ResourcePackSourceFolder(new File(file, "datapacks"));
@@ -333,7 +332,7 @@
this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder);
this.resourcePackRepository.a();
List<ResourcePackLoader> list = Lists.newArrayList();
@@ -364,11 +525,13 @@
@@ -364,11 +524,13 @@
this.b(worlddata);
}
@@ -350,7 +349,7 @@
BlockPosition blockposition = worldserver.getSpawn();
worldloadlistener.a(new ChunkCoordIntPair(blockposition));
@@ -385,11 +548,13 @@
@@ -385,11 +547,13 @@
this.nextTick += 100L;
this.sleepForTick();
@@ -368,7 +367,7 @@
if (forcedchunk != null) {
WorldServer worldserver1 = this.getWorldServer(dimensionmanager);
@@ -408,6 +573,8 @@
@@ -408,6 +572,8 @@
this.sleepForTick();
worldloadlistener.b();
chunkproviderserver.getLightEngine().a(5);
@@ -377,7 +376,7 @@
}
protected void a(String s, WorldNBTStorage worldnbtstorage) {
@@ -466,8 +633,29 @@
@@ -466,8 +632,29 @@
this.stop();
}
@@ -407,7 +406,7 @@
if (this.getServerConnection() != null) {
this.getServerConnection().b();
}
@@ -476,6 +664,7 @@
@@ -476,6 +663,7 @@
MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers();
this.playerList.shutdown();
@@ -415,7 +414,7 @@
}
MinecraftServer.LOGGER.info("Saving worlds");
@@ -548,11 +737,13 @@
@@ -548,11 +736,13 @@
if (i > 2000L && this.nextTick - this.lastOverloadTime >= 15000L) {
long j = i / 50L;
@@ -429,7 +428,7 @@
this.nextTick += 50L;
if (this.T) {
this.T = false;
@@ -599,6 +790,12 @@
@@ -599,6 +789,12 @@
} catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally {
@@ -442,7 +441,7 @@
this.exit();
}
@@ -709,7 +906,7 @@
@@ -709,7 +905,7 @@
this.serverPing.b().a(agameprofile);
}
@@ -451,7 +450,7 @@
MinecraftServer.LOGGER.debug("Autosave started");
this.methodProfiler.enter("save");
this.playerList.savePlayers();
@@ -739,27 +936,43 @@
@@ -739,27 +935,43 @@
}
protected void b(BooleanSupplier booleansupplier) {
@@ -501,7 +500,7 @@
this.methodProfiler.enter("tick");
@@ -798,7 +1011,8 @@
@@ -798,7 +1010,8 @@
this.tickables.add(runnable);
}
@@ -511,7 +510,7 @@
OptionParser optionparser = new OptionParser();
OptionSpec<Void> optionspec = optionparser.accepts("nogui");
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
@@ -821,15 +1035,17 @@
@@ -821,15 +1034,17 @@
optionparser.printHelpOn(System.err);
return;
}
@@ -531,7 +530,7 @@
MinecraftServer.LOGGER.info("Initialized '" + java_nio_file_path.toAbsolutePath().toString() + "' and '" + java_nio_file_path1.toAbsolutePath().toString() + "'");
return;
}
@@ -841,14 +1057,15 @@
@@ -841,14 +1056,15 @@
DispenserRegistry.init();
DispenserRegistry.c();
@@ -550,7 +549,7 @@
dedicatedserver.i((String) optionset.valueOf(optionspec7));
dedicatedserver.setPort((Integer) optionset.valueOf(optionspec10));
dedicatedserver.e(optionset.has(optionspec2));
@@ -871,6 +1088,25 @@
@@ -871,6 +1087,25 @@
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER));
Runtime.getRuntime().addShutdownHook(thread);
@@ -576,7 +575,7 @@
} catch (Exception exception) {
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
}
@@ -890,7 +1126,9 @@
@@ -890,7 +1125,9 @@
}
public void startServerThread() {
@@ -586,7 +585,7 @@
}
public File d(String s) {
@@ -945,7 +1183,7 @@
@@ -945,7 +1182,7 @@
}
public String getServerModName() {
@@ -595,7 +594,7 @@
}
public CrashReport b(CrashReport crashreport) {
@@ -984,7 +1222,7 @@
@@ -984,7 +1221,7 @@
}
public boolean E() {
@@ -604,7 +603,7 @@
}
@Override
@@ -1480,4 +1718,16 @@
@@ -1480,4 +1717,16 @@
}
public abstract boolean b(GameProfile gameprofile);