|
|
|
|
@@ -89,31 +89,10 @@ index e8efbbeece7e866c6c4d7489677d2d9e15fea4d0..8bc0cb9ad5bb4e76d962ff54305e2c08
|
|
|
|
|
PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet);
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679db0a68c1 100644
|
|
|
|
|
index a444c8c57a2ab16eba45b0379841a69ff60a5586..bc80783d36d46fb138bfa6f2e5e84679db0a68c1 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
@@ -294,7 +294,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
public final double[] recentTps = new double[ 4 ]; // Purpur
|
|
|
|
|
// Spigot end
|
|
|
|
|
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
|
|
|
|
- public final org.sucraft.suki.configuration.SukiConfigurations sukiConfigurations; // Suki - Suki configuration
|
|
|
|
|
public static long currentTickLong = 0L; // Paper
|
|
|
|
|
public boolean lagging = false; // Purpur
|
|
|
|
|
protected boolean upnp = false; // Purpur
|
|
|
|
|
@@ -314,10 +313,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
|
|
|
|
|
MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable);
|
|
|
|
|
});
|
|
|
|
|
- // Suki start - multithreading environment variables
|
|
|
|
|
- if (Integer.getInteger("suki.mainthreadpriority", -1) != -1 || Runtime.getRuntime().availableProcessors() > 4) {
|
|
|
|
|
- thread.setPriority(Integer.getInteger("suki.mainthreadpriority", 8));
|
|
|
|
|
- // Suki end - multithreading environment variables
|
|
|
|
|
+ if (Runtime.getRuntime().availableProcessors() > 4) {
|
|
|
|
|
+ thread.setPriority(8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
S s0 = serverFactory.apply(thread); // CraftBukkit - decompile error
|
|
|
|
|
@@ -331,13 +328,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -328,13 +328,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
public MinecraftServer(OptionSet options, DataPackConfig datapackconfiguration, DynamicOps<Tag> registryreadops, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
|
|
|
|
|
super("Server");
|
|
|
|
|
SERVER = this; // Paper - better singleton
|
|
|
|
|
@@ -133,15 +112,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
this.status = new ServerStatus();
|
|
|
|
|
this.random = RandomSource.create();
|
|
|
|
|
this.port = -1;
|
|
|
|
|
@@ -403,7 +400,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper end
|
|
|
|
|
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
|
|
|
|
|
this.paperConfigurations = services.paperConfigurations(); // Paper
|
|
|
|
|
- this.sukiConfigurations = services.sukiConfigurations(); // Suki - Suki configuration
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
|
|
@@ -940,9 +936,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -936,9 +936,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
@@ -153,7 +124,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
|
|
|
|
|
MinecraftServer.LOGGER.info("Stopping server");
|
|
|
|
|
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Shutdown and don't bother finishing
|
|
|
|
|
@@ -1185,18 +1181,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1181,18 +1181,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
// Spigot end
|
|
|
|
|
|
|
|
|
|
@@ -177,7 +148,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
this.mayHaveDelayedTasks = true;
|
|
|
|
|
// Purpur start - tps catchup
|
|
|
|
|
if (org.purpurmc.purpur.PurpurConfig.tpsCatchup) {
|
|
|
|
|
@@ -1206,8 +1202,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1202,8 +1202,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
// Purpur end - tps catchup
|
|
|
|
|
this.waitUntilNextTick();
|
|
|
|
|
@@ -188,7 +159,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
this.isReady = true;
|
|
|
|
|
JvmProfiler.INSTANCE.onServerTick(this.averageTickTime);
|
|
|
|
|
}
|
|
|
|
|
@@ -1368,7 +1364,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1364,7 +1364,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
|
|
|
|
|
@@ -197,7 +168,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
super.doRunTask(ticktask);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1412,15 +1408,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1408,15 +1408,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
public void onServerExit() {}
|
|
|
|
|
|
|
|
|
|
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
|
|
|
|
@@ -216,7 +187,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
// Paper end
|
|
|
|
|
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper
|
|
|
|
|
|
|
|
|
|
@@ -1453,7 +1449,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1449,7 +1449,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
if (playerSaveInterval < 0) {
|
|
|
|
|
playerSaveInterval = autosavePeriod;
|
|
|
|
|
}
|
|
|
|
|
@@ -225,7 +196,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
|
|
|
|
try {
|
|
|
|
|
this.isSaving = true;
|
|
|
|
|
@@ -1468,20 +1464,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1464,20 +1464,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
} finally {
|
|
|
|
|
this.isSaving = false;
|
|
|
|
|
}
|
|
|
|
|
@@ -250,7 +221,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
|
|
|
|
|
|
|
|
|
|
this.averageTickTime = this.averageTickTime * 0.8F + (float) l / 1000000.0F * 0.19999999F;
|
|
|
|
|
@@ -1494,31 +1490,31 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1490,31 +1490,31 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
|
|
this.frameTimer.logFrameDuration(i1 - i);
|
|
|
|
|
@@ -293,7 +264,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
// Send time updates to everyone, it will get the right time from the world the player is in.
|
|
|
|
|
// Paper start - optimize time updates
|
|
|
|
|
for (final ServerLevel world : this.getAllLevels()) {
|
|
|
|
|
@@ -1538,10 +1534,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1534,10 +1534,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
@@ -305,7 +276,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
Iterator iterator = this.getAllLevels().iterator(); // Paper - move down
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
|
|
|
|
@@ -1550,28 +1545,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1546,28 +1545,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
|
|
|
|
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
|
|
|
|
|
|
|
|
|
|
@@ -341,7 +312,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
} catch (Throwable throwable) {
|
|
|
|
|
// Spigot Start
|
|
|
|
|
CrashReport crashreport;
|
|
|
|
|
@@ -1587,33 +1582,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1583,33 +1582,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
throw new ReportedException(crashreport);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -387,7 +358,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isNetherEnabled() {
|
|
|
|
|
@@ -2261,7 +2256,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2257,7 +2256,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProfilerFiller getProfiler() {
|
|
|
|
|
@@ -396,7 +367,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
return this.profiler;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2501,7 +2496,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2497,7 +2496,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
|
|
private void startMetricsRecordingTick() {
|
|
|
|
|
@@ -405,7 +376,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
|
|
|
|
this.executeBlocking(() -> {
|
|
|
|
|
this.saveDebugReport(path.resolve("server"));
|
|
|
|
|
@@ -2511,40 +2506,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2507,40 +2506,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.willStartRecordingMetrics = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -458,7 +429,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Path getWorldPath(LevelResource worldSavePath) {
|
|
|
|
|
@@ -2589,15 +2584,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2585,15 +2584,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isTimeProfilerRunning() {
|
|
|
|
|
@@ -477,7 +448,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
return EmptyProfileResults.EMPTY;
|
|
|
|
|
} else {
|
|
|
|
|
ProfileResults methodprofilerresults = this.debugCommandProfiler.stop(Util.getNanos(), this.tickCount);
|
|
|
|
|
@@ -2770,7 +2765,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2766,7 +2765,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -486,7 +457,7 @@ index ede16b015b9dde07a7346e0bffde53082145798b..bc80783d36d46fb138bfa6f2e5e84679
|
|
|
|
|
try {
|
|
|
|
|
for (;;) {
|
|
|
|
|
boolean moreTasks = this.tickMidTickTasks();
|
|
|
|
|
@@ -2790,14 +2785,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2786,14 +2785,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double overuseCount = (double)overuse/(double)MAX_CHUNK_EXEC_TIME;
|
|
|
|
|
@@ -517,10 +488,10 @@ index 2986f110348b376bcdc64fa39b68885551663d4d..d1fa6b1edf733e15dfe9ecbf7ed63923
|
|
|
|
|
i = this.context.runTopCommand(function, source);
|
|
|
|
|
} finally {
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
|
index 3e7dd41555263e8361db08d1380c767fe0ba8886..d6c3db7234fa9b52e945cb004d8ae843aabf1302 100644
|
|
|
|
|
index 383045ae681d5366761c807a0032156203cdf9c9..443aa5012152cb7969147dbbeba259e121def254 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
|
|
|
@@ -542,7 +542,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
@@ -538,7 +538,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void handleConsoleInputs() {
|
|
|
|
|
@@ -529,7 +500,7 @@ index 3e7dd41555263e8361db08d1380c767fe0ba8886..d6c3db7234fa9b52e945cb004d8ae843
|
|
|
|
|
// Paper start - use proper queue
|
|
|
|
|
ConsoleInput servercommand;
|
|
|
|
|
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
|
|
|
|
@@ -559,7 +559,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
@@ -555,7 +555,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -898,7 +869,7 @@ index cd5533c3c53215c9cc4be0b9097d76efbf5bd0c1..7266e6703d5cd0fea90ec88c74a7d456
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
index ba95c8ba2fdcb73065c2fc219f94528239751f33..55fe8b0f21f00b02e78257a64fd8d63980d50995 100644
|
|
|
|
|
index 2a9219e0139670674319a7cf17ad664582b42715..55fe8b0f21f00b02e78257a64fd8d63980d50995 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
@@ -227,13 +227,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -915,15 +886,6 @@ index ba95c8ba2fdcb73065c2fc219f94528239751f33..55fe8b0f21f00b02e78257a64fd8d639
|
|
|
|
|
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
|
|
|
|
|
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper
|
|
|
|
|
}
|
|
|
|
|
@@ -533,7 +526,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
|
|
|
|
// Holder holder = worlddimension.typeHolder(); // CraftBukkit - decompile error
|
|
|
|
|
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
|
|
|
|
|
- super(iworlddataserver, resourcekey, worlddimension.typeHolder(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.sukiConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Suki - Suki configuration
|
|
|
|
|
+ super(iworlddataserver, resourcekey, worlddimension.typeHolder(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor
|
|
|
|
|
this.pvpMode = minecraftserver.isPvpAllowed();
|
|
|
|
|
this.convertable = convertable_conversionsession;
|
|
|
|
|
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
|
|
|
|
|
@@ -658,12 +651,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -1340,7 +1302,7 @@ index 7094701d213c73ba47ace806962244c10fdf4dda..fcdb9bde8e1605e30dde3e580491522d
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
|
|
|
index dc3f2b26e19619adf80827d26b95209ded973c2a..0c9f7f9ed3e24ddc6b963063723feb56422843c5 100644
|
|
|
|
|
index 9f0126aedb94f74d01dc47112496160cc4e1f02c..0c9f7f9ed3e24ddc6b963063723feb56422843c5 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
|
|
|
@@ -117,9 +117,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -1355,35 +1317,7 @@ index dc3f2b26e19619adf80827d26b95209ded973c2a..0c9f7f9ed3e24ddc6b963063723feb56
|
|
|
|
|
private boolean tickingBlockEntities;
|
|
|
|
|
public final Thread thread;
|
|
|
|
|
private final boolean isDebug;
|
|
|
|
|
@@ -172,14 +172,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
return this.paperConfig;
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
- // Suki start - Suki configuration
|
|
|
|
|
- private final org.sucraft.suki.configuration.SukiWorldConfiguration sukiConfig;
|
|
|
|
|
|
|
|
|
|
- public org.sucraft.suki.configuration.SukiWorldConfiguration sukiConfig() {
|
|
|
|
|
- return this.sukiConfig;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Suki end - Suki configuration
|
|
|
|
|
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
|
|
|
|
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
|
|
|
|
|
|
|
|
|
@@ -334,11 +327,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@Override public final int getHeight() { return this.height; }
|
|
|
|
|
// Pufferfish end
|
|
|
|
|
|
|
|
|
|
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.sucraft.suki.configuration.SukiWorldConfiguration> sukiWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Suki - Suki configuration
|
|
|
|
|
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
|
|
|
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
|
|
|
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
|
|
|
|
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
|
|
|
|
|
- this.sukiConfig = sukiWorldConfigCreator.apply(this.spigotConfig); // Suki - Suki configuration
|
|
|
|
|
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
|
|
|
|
this.generator = gen;
|
|
|
|
|
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
|
|
|
|
@@ -720,9 +712,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -712,9 +712,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
BlockState iblockdata2 = this.getBlockState(pos);
|
|
|
|
|
|
|
|
|
|
if ((flags & 128) == 0 && iblockdata2 != iblockdata1 && (iblockdata2.getLightBlock(this, pos) != iblockdata1.getLightBlock(this, pos) || iblockdata2.getLightEmission() != iblockdata1.getLightEmission() || iblockdata2.useShapeForLightOcclusion() || iblockdata1.useShapeForLightOcclusion())) {
|
|
|
|
|
@@ -1395,7 +1329,7 @@ index dc3f2b26e19619adf80827d26b95209ded973c2a..0c9f7f9ed3e24ddc6b963063723feb56
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@@ -999,18 +991,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -991,18 +991,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void tickBlockEntities() {
|
|
|
|
|
@@ -1419,7 +1353,7 @@ index dc3f2b26e19619adf80827d26b95209ded973c2a..0c9f7f9ed3e24ddc6b963063723feb56
|
|
|
|
|
// Spigot start
|
|
|
|
|
// Iterator iterator = this.blockEntityTickers.iterator();
|
|
|
|
|
int tilesThisCycle = 0;
|
|
|
|
|
@@ -1043,10 +1035,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -1035,10 +1035,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
}
|
|
|
|
|
this.blockEntityTickers.removeAll(toRemove);
|
|
|
|
|
|
|
|
|
|
@@ -1432,7 +1366,7 @@ index dc3f2b26e19619adf80827d26b95209ded973c2a..0c9f7f9ed3e24ddc6b963063723feb56
|
|
|
|
|
spigotConfig.currentPrimedTnt = 0; // Spigot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1207,7 +1199,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -1199,7 +1199,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
|
|
|
|
@@ -1441,7 +1375,7 @@ index dc3f2b26e19619adf80827d26b95209ded973c2a..0c9f7f9ed3e24ddc6b963063723feb56
|
|
|
|
|
List<Entity> list = Lists.newArrayList();
|
|
|
|
|
((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call
|
|
|
|
|
return list;
|
|
|
|
|
@@ -1215,7 +1207,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -1207,7 +1207,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate) {
|
|
|
|
|
@@ -1450,7 +1384,7 @@ index dc3f2b26e19619adf80827d26b95209ded973c2a..0c9f7f9ed3e24ddc6b963063723feb56
|
|
|
|
|
List<T> list = Lists.newArrayList();
|
|
|
|
|
|
|
|
|
|
// Paper start - optimise this call
|
|
|
|
|
@@ -1546,7 +1538,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
@@ -1538,7 +1538,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProfilerFiller getProfiler() {
|