diff --git a/Paper b/Paper index e4602b6d4..d63075dff 160000 --- a/Paper +++ b/Paper @@ -1 +1 @@ -Subproject commit e4602b6d4808090149c6d5d7567134c308f05e11 +Subproject commit d63075dff84b615bf5b16b93f0c605ea27ed4dc9 diff --git a/current-paper b/current-paper index 3497c0aba..217d78267 100644 --- a/current-paper +++ b/current-paper @@ -1 +1 @@ -1.15.2--8649dac47cee86949ba935ae3b05090ecdfd4e09 +1.15.2--62351591d67adfe917dae108c4b7c896293270b4 diff --git a/patches/server/0002-Tuinity-Server-Patches.patch b/patches/server/0002-Tuinity-Server-Patches.patch index fb7c4cc55..f99f19c8e 100644 --- a/patches/server/0002-Tuinity-Server-Patches.patch +++ b/patches/server/0002-Tuinity-Server-Patches.patch @@ -1,4 +1,4 @@ -From ceadc0a597e9b877a7aff87457e7baf8b2166195 Mon Sep 17 00:00:00 2001 +From 0dbe7794dec5145f2eb0cdea358bdd30de37a8aa Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Fri, 14 Dec 2018 21:53:58 -0800 Subject: [PATCH] Tuinity Server Patches @@ -34,11 +34,10 @@ Subject: [PATCH] Tuinity Server Patches .../tuinity/util/set/LinkedSortedSet.java | 142 +++ .../net/minecraft/server/ArraySetSorted.java | 41 +- .../net/minecraft/server/AxisAlignedBB.java | 2 + - .../net/minecraft/server/BlockPosition.java | 1 + src/main/java/net/minecraft/server/Chunk.java | 135 +++ .../java/net/minecraft/server/ChunkMap.java | 15 +- .../minecraft/server/ChunkMapDistance.java | 387 ++++++- - .../minecraft/server/ChunkProviderServer.java | 187 +++- + .../minecraft/server/ChunkProviderServer.java | 182 +++- .../minecraft/server/ChunkRegionLoader.java | 12 +- .../net/minecraft/server/ChunkStatus.java | 5 +- .../net/minecraft/server/DedicatedServer.java | 3 +- @@ -65,7 +64,6 @@ Subject: [PATCH] Tuinity Server Patches .../net/minecraft/server/NBTTagCompound.java | 2 +- .../minecraft/server/NavigationAbstract.java | 24 +- .../net/minecraft/server/NetworkManager.java | 36 +- - .../minecraft/server/NextTickListEntry.java | 41 +- .../server/PacketPlayOutMapChunk.java | 15 +- .../net/minecraft/server/PairedQueue.java | 44 +- .../net/minecraft/server/PathfinderGoal.java | 15 +- @@ -73,7 +71,7 @@ Subject: [PATCH] Tuinity Server Patches .../server/PathfinderGoalWrapped.java | 6 +- .../minecraft/server/PathfinderNormal.java | 4 +- .../server/PathfinderTargetCondition.java | 1 + - .../net/minecraft/server/PlayerChunk.java | 99 +- + .../net/minecraft/server/PlayerChunk.java | 97 +- .../net/minecraft/server/PlayerChunkMap.java | 995 +++++++++++++++--- .../server/PlayerInteractManager.java | 45 +- .../net/minecraft/server/PlayerInventory.java | 6 +- @@ -83,9 +81,7 @@ Subject: [PATCH] Tuinity Server Patches .../minecraft/server/RegionFileBitSet.java | 26 +- .../net/minecraft/server/RegionFileCache.java | 45 +- .../server/RegionFileCompression.java | 7 +- - .../server/StructureBoundingBox.java | 14 +- .../net/minecraft/server/ThreadedMailbox.java | 2 +- - .../net/minecraft/server/TickListServer.java | 51 + .../java/net/minecraft/server/Ticket.java | 6 +- .../java/net/minecraft/server/TicketType.java | 1 + .../net/minecraft/server/VoxelShapeArray.java | 2 +- @@ -93,7 +89,7 @@ Subject: [PATCH] Tuinity Server Patches .../server/VoxelShapeMergerList.java | 2 +- .../net/minecraft/server/VoxelShapes.java | 2 +- src/main/java/net/minecraft/server/World.java | 23 +- - .../net/minecraft/server/WorldServer.java | 471 ++++++++- + .../net/minecraft/server/WorldServer.java | 461 +++++++- .../net/minecraft/server/WorldUpgrader.java | 2 +- .../org/bukkit/craftbukkit/CraftServer.java | 7 +- .../org/bukkit/craftbukkit/CraftWorld.java | 67 +- @@ -102,7 +98,7 @@ Subject: [PATCH] Tuinity Server Patches .../craftbukkit/entity/CraftPlayer.java | 37 +- .../java/org/spigotmc/ActivationRange.java | 41 +- src/main/java/org/spigotmc/AsyncCatcher.java | 2 +- - 98 files changed, 7068 insertions(+), 500 deletions(-) + 94 files changed, 6965 insertions(+), 479 deletions(-) create mode 100644 src/main/java/com/tuinity/tuinity/chunk/ChunkRegionManager.java create mode 100644 src/main/java/com/tuinity/tuinity/chunk/QueuedChangesMapLong2Int.java create mode 100644 src/main/java/com/tuinity/tuinity/chunk/QueuedChangesMapLong2Object.java @@ -173,7 +169,7 @@ index a7ee9396a0..90ca354c46 100644 diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 132397b3f3..4e12f416f9 100644 +index dfe92780ad..c088cf51ff 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -215,7 +215,7 @@ public class PaperCommand extends Command { @@ -4163,20 +4159,8 @@ index c950139c0f..1a3234bb47 100644 public boolean e(double d0, double d1, double d2) { return d0 >= this.minX && d0 < this.maxX && d1 >= this.minY && d1 < this.maxY && d2 >= this.minZ && d2 < this.maxZ; } -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index e650a2e48d..83c5c83292 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -125,6 +125,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali - return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k); - } - -+ public final BlockPosition add(BaseBlockPosition baseblockposition) { return this.a(baseblockposition); } // Tuinity - OBFHELPER - public BlockPosition a(BaseBlockPosition baseblockposition) { - return this.b(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); - } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 92065fe029..4b0e3e9053 100644 +index 07073af991..8b8e1d900e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -162,6 +162,94 @@ public class Chunk implements IChunkAccess { @@ -4274,7 +4258,7 @@ index 92065fe029..4b0e3e9053 100644 public Chunk(World world, ProtoChunk protochunk) { this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null); Iterator iterator = protochunk.y().iterator(); -@@ -407,6 +495,7 @@ public class Chunk implements IChunkAccess { +@@ -411,6 +499,7 @@ public class Chunk implements IChunkAccess { @Override public void a(Entity entity) { @@ -4282,7 +4266,7 @@ index 92065fe029..4b0e3e9053 100644 this.q = true; int i = MathHelper.floor(entity.locX() / 16.0D); int j = MathHelper.floor(entity.locZ() / 16.0D); -@@ -476,6 +565,7 @@ public class Chunk implements IChunkAccess { +@@ -480,6 +569,7 @@ public class Chunk implements IChunkAccess { } public void a(Entity entity, int i) { @@ -4290,7 +4274,7 @@ index 92065fe029..4b0e3e9053 100644 if (i < 0) { i = 0; } -@@ -508,6 +598,12 @@ public class Chunk implements IChunkAccess { +@@ -512,6 +602,12 @@ public class Chunk implements IChunkAccess { return ((HeightMap) this.heightMap.get(heightmap_type)).a(i & 15, j & 15) - 1; } @@ -4303,7 +4287,7 @@ index 92065fe029..4b0e3e9053 100644 @Nullable private TileEntity j(BlockPosition blockposition) { IBlockData iblockdata = this.getType(blockposition); -@@ -649,6 +745,25 @@ public class Chunk implements IChunkAccess { +@@ -653,6 +749,25 @@ public class Chunk implements IChunkAccess { // CraftBukkit start public void loadCallback() { @@ -4329,7 +4313,7 @@ index 92065fe029..4b0e3e9053 100644 org.bukkit.Server server = this.world.getServer(); ((WorldServer)this.world).getChunkProvider().addLoadedChunk(this); // Paper if (server != null) { -@@ -692,6 +807,23 @@ public class Chunk implements IChunkAccess { +@@ -696,6 +811,23 @@ public class Chunk implements IChunkAccess { // note: saving can be prevented, but not forced if no saving is actually required this.mustNotSave = !unloadEvent.isSaveChunk(); ((WorldServer)this.world).getChunkProvider().removeLoadedChunk(this); // Paper @@ -4353,7 +4337,7 @@ index 92065fe029..4b0e3e9053 100644 } // CraftBukkit end -@@ -700,6 +832,7 @@ public class Chunk implements IChunkAccess { +@@ -704,6 +836,7 @@ public class Chunk implements IChunkAccess { } public void a(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List list, @Nullable Predicate predicate) { @@ -4361,7 +4345,7 @@ index 92065fe029..4b0e3e9053 100644 int i = MathHelper.floor((axisalignedbb.minY - 2.0D) / 16.0D); int j = MathHelper.floor((axisalignedbb.maxY + 2.0D) / 16.0D); -@@ -739,6 +872,7 @@ public class Chunk implements IChunkAccess { +@@ -743,6 +876,7 @@ public class Chunk implements IChunkAccess { } public void a(@Nullable EntityTypes entitytypes, AxisAlignedBB axisalignedbb, List list, Predicate predicate) { @@ -4369,7 +4353,7 @@ index 92065fe029..4b0e3e9053 100644 int i = MathHelper.floor((axisalignedbb.minY - 2.0D) / 16.0D); int j = MathHelper.floor((axisalignedbb.maxY + 2.0D) / 16.0D); -@@ -761,6 +895,7 @@ public class Chunk implements IChunkAccess { +@@ -765,6 +899,7 @@ public class Chunk implements IChunkAccess { } public void a(Class oclass, AxisAlignedBB axisalignedbb, List list, @Nullable Predicate predicate) { @@ -4949,23 +4933,18 @@ index 73d1570765..cb2e67d159 100644 protected b(int i) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index cf9021d605..2294db2e6d 100644 +index 82168b6ae8..ac18399551 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -119,6 +119,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -126,7 +126,6 @@ public class ChunkProviderServer extends IChunkProvider { } - // Paper - -+ // Tuinity start - rewrite ticklistserver -+ public final boolean isTickingReadyMainThread(BlockPosition pos) { -+ PlayerChunk chunk = this.playerChunkMap.chunkMap.getUpdating(com.tuinity.tuinity.util.Util.getCoordinateKey(pos)); -+ return chunk != null && chunk.isTickingReady(); -+ } -+ // Tuinity end - rewrite ticklistserver + // Paper end - rewrite ticklistserver +- public ChunkProviderServer(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, WorldLoadListener worldloadlistener, Supplier supplier) { this.world = worldserver; -@@ -308,7 +314,16 @@ public class ChunkProviderServer extends IChunkProvider { + this.serverThreadQueue = new ChunkProviderServer.a(worldserver); +@@ -315,7 +314,16 @@ public class ChunkProviderServer extends IChunkProvider { } private void bringToStatusAsync(int x, int z, ChunkCoordIntPair chunkPos, ChunkStatus status, java.util.function.Consumer onComplete) { @@ -4983,7 +4962,7 @@ index cf9021d605..2294db2e6d 100644 Long identifier = Long.valueOf(this.asyncLoadSeqCounter++); int ticketLevel = MCUtil.getTicketLevelFor(status); this.addTicketAtLevel(TicketType.ASYNC_LOAD, chunkPos, ticketLevel, identifier); -@@ -350,9 +365,18 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -357,9 +365,18 @@ public class ChunkProviderServer extends IChunkProvider { public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) { final int x = i; final int z = j; // Paper - conflict on variable change if (Thread.currentThread() != this.serverThread) { @@ -5005,7 +4984,7 @@ index cf9021d605..2294db2e6d 100644 } else { // Paper start - optimise for loaded chunks Chunk ifLoaded = this.getChunkAtIfLoadedMainThread(i, j); -@@ -384,6 +408,19 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -391,6 +408,19 @@ public class ChunkProviderServer extends IChunkProvider { this.world.asyncChunkTaskManager.raisePriority(x, z, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY); com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.world, x, z); // Paper end @@ -5025,10 +5004,10 @@ index cf9021d605..2294db2e6d 100644 com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.world, x, z); // Paper - sync load info this.world.timings.chunkAwait.startTiming(); // Paper this.serverThreadQueue.awaitTasks(completablefuture::isDone); -@@ -513,27 +550,39 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -520,27 +550,39 @@ public class ChunkProviderServer extends IChunkProvider { - @Override - public boolean a(Entity entity) { + public final boolean isInEntityTickingChunk(Entity entity) { return this.a(entity); } // Paper - OBFHELPER + @Override public boolean a(Entity entity) { - long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4); - - return this.a(i, PlayerChunk::b); @@ -5039,8 +5018,8 @@ index cf9021d605..2294db2e6d 100644 + // Tuinity end - optimize is ticking ready type functions } - @Override - public boolean a(ChunkCoordIntPair chunkcoordintpair) { + public final boolean isEntityTickingChunk(ChunkCoordIntPair chunkcoordintpair) { return this.a(chunkcoordintpair); } // Paper - OBFHELPER + @Override public boolean a(ChunkCoordIntPair chunkcoordintpair) { - return this.a(chunkcoordintpair.pair(), PlayerChunk::b); + // Tuinity start - optimize is ticking ready type functions + // is entity ticking ready @@ -5077,7 +5056,7 @@ index cf9021d605..2294db2e6d 100644 } private boolean a(long i, Function>> function) { -@@ -597,6 +646,11 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -604,6 +646,11 @@ public class ChunkProviderServer extends IChunkProvider { this.chunkMapDistance.purgeTickets(); this.tickDistanceManager(); this.world.timings.doChunkMap.stopTiming(); // Spigot @@ -5089,7 +5068,7 @@ index cf9021d605..2294db2e6d 100644 this.world.getMethodProfiler().exitEnter("chunks"); this.world.timings.chunks.startTiming(); // Paper - timings this.tickChunks(); -@@ -609,6 +663,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -616,6 +663,12 @@ public class ChunkProviderServer extends IChunkProvider { this.clearCache(); } @@ -5102,7 +5081,7 @@ index cf9021d605..2294db2e6d 100644 private void tickChunks() { long i = this.world.getTime(); long j = i - this.lastTickTime; -@@ -619,6 +679,36 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -626,6 +679,36 @@ public class ChunkProviderServer extends IChunkProvider { boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && !world.getPlayers().isEmpty(); // CraftBukkit if (!flag) { @@ -5139,7 +5118,7 @@ index cf9021d605..2294db2e6d 100644 this.world.getMethodProfiler().enter("pollingChunks"); int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); BlockPosition blockposition = this.world.getSpawn(); -@@ -636,11 +726,10 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -643,11 +726,10 @@ public class ChunkProviderServer extends IChunkProvider { EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values(); // Paper start - per player mob spawning int[] worldMobCount; @@ -5154,7 +5133,7 @@ index cf9021d605..2294db2e6d 100644 // re-set mob counts for (EntityPlayer player : this.world.players) { Arrays.fill(player.mobCounts, 0); -@@ -653,20 +742,13 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -660,20 +742,13 @@ public class ChunkProviderServer extends IChunkProvider { this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings this.world.getMethodProfiler().exit(); @@ -5182,7 +5161,7 @@ index cf9021d605..2294db2e6d 100644 this.world.getMethodProfiler().enter("broadcast"); this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings -@@ -676,10 +758,10 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -683,10 +758,10 @@ public class ChunkProviderServer extends IChunkProvider { ChunkCoordIntPair chunkcoordintpair = playerchunk.i(); this.world.timings.chunkInhibitedRangeCheck.startTiming(); @@ -5195,7 +5174,7 @@ index cf9021d605..2294db2e6d 100644 this.world.getMethodProfiler().enter("spawner"); this.world.timings.mobSpawn.startTiming(); // Spigot EnumCreatureType[] aenumcreaturetype1 = aenumcreaturetype; -@@ -724,9 +806,23 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -731,9 +806,23 @@ public class ChunkProviderServer extends IChunkProvider { if (this.world.paperConfig.perPlayerMobSpawns) { int minDiff = Integer.MAX_VALUE; @@ -5220,7 +5199,7 @@ index cf9021d605..2294db2e6d 100644 difference = (minDiff == Integer.MAX_VALUE) ? 0 : minDiff; } -@@ -749,7 +845,22 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -756,7 +845,22 @@ public class ChunkProviderServer extends IChunkProvider { } this.world.timings.chunkInhibitedRangeCheck.stopTiming(); // Paper } @@ -6180,10 +6159,10 @@ index 75d9065b32..4669f31b04 100644 } } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index bcd5cc9f28..dd07c67bce 100644 +index b9d5844520..d1412760dd 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -502,9 +502,9 @@ public final class MCUtil { +@@ -500,9 +500,9 @@ public final class MCUtil { WorldServer world = ((org.bukkit.craftbukkit.CraftWorld)bukkitWorld).getHandle(); PlayerChunkMap chunkMap = world.getChunkProvider().playerChunkMap; @@ -6195,7 +6174,7 @@ index bcd5cc9f28..dd07c67bce 100644 List players = world.players; int fullLoadedChunks = 0; -@@ -527,7 +527,7 @@ public final class MCUtil { +@@ -525,7 +525,7 @@ public final class MCUtil { worldData.addProperty("view-distance", world.spigotConfig.viewDistance); worldData.addProperty("keep-spawn-loaded", world.keepSpawnInMemory); worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange); @@ -6204,7 +6183,7 @@ index bcd5cc9f28..dd07c67bce 100644 worldData.addProperty("loaded-chunk-count", chunkMap.loadedChunks.size()); worldData.addProperty("verified-fully-loaded-chunks", fullLoadedChunks); -@@ -605,4 +605,28 @@ public final class MCUtil { +@@ -603,4 +603,28 @@ public final class MCUtil { // TODO make sure the constant `33` is correct on future updates. See getChunkAt(int, int, ChunkStatus, boolean) return 33 + ChunkStatus.getTicketLevelOffset(status); } @@ -6394,77 +6373,6 @@ index 96a785af27..77aa911c98 100644 } -diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java -index 33cfeabdee..11a4bb882e 100644 ---- a/src/main/java/net/minecraft/server/NextTickListEntry.java -+++ b/src/main/java/net/minecraft/server/NextTickListEntry.java -@@ -5,11 +5,13 @@ import java.util.Comparator; - public class NextTickListEntry { - - private static final java.util.concurrent.atomic.AtomicLong COUNTER = new java.util.concurrent.atomic.AtomicLong(); // Paper - async chunk loading -- private final T e; -- public final BlockPosition a; -- public final long b; -- public final TickListPriority c; -- private final long f; -+ private final T e; public final T getData() { return this.e; } // Tuinity - OBFHELPER -+ public final BlockPosition a; public final BlockPosition getPosition() { return this.a; } // Tuinity - OBFHELPER -+ public final long b; public final long getTargetTick() { return this.b; } // Tuinity - OBFHELPER -+ public final TickListPriority c; public final TickListPriority getPriority() { return this.c; } // Tuinity - OBFHELPER -+ private final long f; public final long getId() { return this.f; } // Tuinity - OBFHELPER -+ private final int hash; // Tuinity -+ public int tickState; // Tuinity - - public NextTickListEntry(BlockPosition blockposition, T t0) { - this(blockposition, t0, 0L, TickListPriority.NORMAL); -@@ -21,6 +23,7 @@ public class NextTickListEntry { - this.e = t0; - this.b = i; - this.c = ticklistpriority; -+ this.hash = this.computeHash(); // Tuinity - } - - public boolean equals(Object object) { -@@ -33,19 +36,31 @@ public class NextTickListEntry { - } - } - -+ // Tuinity start - optimize hashcode -+ @Override - public int hashCode() { -+ return this.hash; -+ } -+ public final int computeHash() { -+ // Tuinity end - optimize hashcode - return this.a.hashCode(); - } - -- public static Comparator a() { // Paper - decompile fix -- return Comparator.comparingLong((nextticklistentry) -> { -- return ((NextTickListEntry) nextticklistentry).b; // Paper - decompile fix -- }).thenComparing((nextticklistentry) -> { -- return ((NextTickListEntry) nextticklistentry).c; // Paper - decompile fix -- }).thenComparingLong((nextticklistentry) -> { -- return ((NextTickListEntry) nextticklistentry).f; // Paper - decompile fix -- }); -+ // Tuinity start - let's not use more functional code for no reason. -+ public static Comparator comparator() { return NextTickListEntry.a(); } // Tuinity - OBFHELPER -+ public static Comparator a() { -+ return (Comparator)(Comparator)(NextTickListEntry nextticklistentry, NextTickListEntry nextticklistentry1) -> { -+ int i = Long.compare(nextticklistentry.getTargetTick(), nextticklistentry1.getTargetTick()); -+ -+ if (i != 0) { -+ return i; -+ } else { -+ i = nextticklistentry.getPriority().compareTo(nextticklistentry1.getPriority()); -+ return i != 0 ? i : Long.compare(nextticklistentry.getId(), nextticklistentry1.getId()); -+ } -+ }; - } -+ // Tuinity end - let's not use more functional code for no reason. - - public String toString() { - return this.e + ": " + this.a + ", " + this.b + ", " + this.c + ", " + this.f; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java index ef7ade797b..e1ef70210a 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -6843,7 +6751,7 @@ index e35ec2db07..e7dfe22acd 100644 if (entityliving == entityliving1) { return false; diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index b38bc67758..11d6347784 100644 +index 9f8818c2d4..0e24f4e7a1 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -43,6 +43,18 @@ public class PlayerChunk { @@ -6962,16 +6870,7 @@ index b38bc67758..11d6347784 100644 } }); // Paper end -@@ -473,7 +537,7 @@ public class PlayerChunk { - Chunk tickingChunk = either.left().get(); - PlayerChunk.this.isTickingReady = true; - -- -+ PlayerChunk.this.chunkMap.world.onChunkSetTicking(PlayerChunk.this.location.x, PlayerChunk.this.location.z); // Tuinity - rewrite ticklistserver - - - } -@@ -503,8 +567,19 @@ public class PlayerChunk { +@@ -505,8 +569,19 @@ public class PlayerChunk { PlayerChunk.this.isEntityTickingReady = true; @@ -6991,7 +6890,7 @@ index b38bc67758..11d6347784 100644 } }); // Paper end -@@ -513,6 +588,18 @@ public class PlayerChunk { +@@ -515,6 +590,18 @@ public class PlayerChunk { if (flag6 && !flag7) { this.entityTickingFuture.complete(PlayerChunk.UNLOADED_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage @@ -9193,45 +9092,6 @@ index 3382d678e6..29137f4959 100644 public InputStream a(InputStream inputstream) throws IOException { return (InputStream) this.f.wrap(inputstream); } -diff --git a/src/main/java/net/minecraft/server/StructureBoundingBox.java b/src/main/java/net/minecraft/server/StructureBoundingBox.java -index dbb565e74d..118762778c 100644 ---- a/src/main/java/net/minecraft/server/StructureBoundingBox.java -+++ b/src/main/java/net/minecraft/server/StructureBoundingBox.java -@@ -4,12 +4,12 @@ import com.google.common.base.MoreObjects; - - public class StructureBoundingBox { - -- public int a; -- public int b; -- public int c; -- public int d; -- public int e; -- public int f; -+ public int a; public final int getMinX() { return this.a; } // Tuinity - OBFHELPER -+ public int b; public final int getMinY() { return this.b; } // Tuinity - OBFHELPER -+ public int c; public final int getMinZ() { return this.c; } // Tuinity - OBFHELPER -+ public int d; public final int getMaxX() { return this.d; } // Tuinity - OBFHELPER -+ public int e; public final int getMaxY() { return this.e; } // Tuinity - OBFHELPER -+ public int f; public final int getMaxZ() { return this.f; } // Tuinity - OBFHELPER - - public StructureBoundingBox() {} - -@@ -84,6 +84,7 @@ public class StructureBoundingBox { - this.e = 512; - } - -+ public final boolean intersects(StructureBoundingBox boundingBox) { return this.b(boundingBox); } // Tuinity - OBFHELPER - public boolean b(StructureBoundingBox structureboundingbox) { - return this.d >= structureboundingbox.a && this.a <= structureboundingbox.d && this.f >= structureboundingbox.c && this.c <= structureboundingbox.f && this.e >= structureboundingbox.b && this.b <= structureboundingbox.e; - } -@@ -114,6 +115,7 @@ public class StructureBoundingBox { - return new StructureBoundingBox(this.a + i, this.b + j, this.c + k, this.d + i, this.e + j, this.f + k); - } - -+ public final boolean hasPoint(BaseBlockPosition baseblockposition) { return this.b(baseblockposition); } // Tuinity - OBFHELPER - public boolean b(BaseBlockPosition baseblockposition) { - return baseblockposition.getX() >= this.a && baseblockposition.getX() <= this.d && baseblockposition.getZ() >= this.c && baseblockposition.getZ() <= this.f && baseblockposition.getY() >= this.b && baseblockposition.getY() <= this.e; - } diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java index 8082569022..8b1a3f3f98 100644 --- a/src/main/java/net/minecraft/server/ThreadedMailbox.java @@ -9245,129 +9105,6 @@ index 8082569022..8b1a3f3f98 100644 } public ThreadedMailbox(PairedQueue pairedqueue, Executor executor, String s) { -diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java -index f533860bbe..a54d36d90b 100644 ---- a/src/main/java/net/minecraft/server/TickListServer.java -+++ b/src/main/java/net/minecraft/server/TickListServer.java -@@ -42,6 +42,11 @@ public class TickListServer implements TickList { - // Paper end - - public void b() { -+ // Tuinity start - allow overriding -+ this.tick(); -+ } -+ public void tick() { -+ // Tuinity end - int i = this.nextTickList.size(); - - if (false) { // CraftBukkit -@@ -109,15 +114,30 @@ public class TickListServer implements TickList { - - @Override - public boolean b(BlockPosition blockposition, T t0) { -+ // Tuinity start - allow overriding -+ return this.isPendingTickThisTick(blockposition, t0); -+ } -+ public boolean isPendingTickThisTick(BlockPosition blockposition, T t0) { -+ // Tuinity end - return this.g.contains(new NextTickListEntry<>(blockposition, t0)); - } - - @Override - public void a(Stream> stream) { -+ // Tuinity start - allow overriding -+ this.scheduleAll(stream); -+ } -+ public void scheduleAll(Stream> stream) { -+ // Tuinity end - stream.forEach(this::a); - } - - public List> a(ChunkCoordIntPair chunkcoordintpair, boolean flag, boolean flag1) { -+ // Tuinity start - allow overriding -+ return this.getEntriesInChunk(chunkcoordintpair, flag, flag1); -+ } -+ public List> getEntriesInChunk(ChunkCoordIntPair chunkcoordintpair, boolean flag, boolean flag1) { -+ // Tuinity end - int i = (chunkcoordintpair.x << 4) - 2; - int j = i + 16 + 2; - int k = (chunkcoordintpair.z << 4) - 2; -@@ -127,6 +147,11 @@ public class TickListServer implements TickList { - } - - public List> a(StructureBoundingBox structureboundingbox, boolean flag, boolean flag1) { -+ // Tuinity start - allow overriding -+ return this.getEntriesInBoundingBox(structureboundingbox, flag, flag1); -+ } -+ public List> getEntriesInBoundingBox(StructureBoundingBox structureboundingbox, boolean flag, boolean flag1) { -+ // Tuinity end - List> list = this.a((List) null, this.nextTickList, structureboundingbox, flag); - - if (flag && list != null) { -@@ -166,6 +191,11 @@ public class TickListServer implements TickList { - } - - public void a(StructureBoundingBox structureboundingbox, BlockPosition blockposition) { -+ // Tuinity start - allow overriding -+ this.copy(structureboundingbox, blockposition); -+ } -+ public void copy(StructureBoundingBox structureboundingbox, BlockPosition blockposition) { -+ // Tuinity end - List> list = this.a(structureboundingbox, false, false); - Iterator iterator = list.iterator(); - -@@ -183,11 +213,17 @@ public class TickListServer implements TickList { - } - - public NBTTagList a(ChunkCoordIntPair chunkcoordintpair) { -+ // Tuinity start - allow overriding -+ return this.serialize(chunkcoordintpair); -+ } -+ public NBTTagList serialize(ChunkCoordIntPair chunkcoordintpair) { -+ // Tuinity end - List> list = this.a(chunkcoordintpair, false, true); - - return a(this.b, list, this.f.getTime()); - } - -+ public static NBTTagList serialize(Function function, Iterable> iterable, long i) { return TickListServer.a(function, iterable, i); } // Tuinity - OBFHELPER - public static NBTTagList a(Function function, Iterable> iterable, long i) { - NBTTagList nbttaglist = new NBTTagList(); - Iterator iterator = iterable.iterator(); -@@ -210,11 +246,21 @@ public class TickListServer implements TickList { - - @Override - public boolean a(BlockPosition blockposition, T t0) { -+ // Tuinity start - allow overriding -+ return this.isScheduledForTick(blockposition, t0); -+ } -+ public boolean isScheduledForTick(BlockPosition blockposition, T t0) { -+ // Tuinity end - return this.nextTickListHash.contains(new NextTickListEntry<>(blockposition, t0)); - } - - @Override - public void a(BlockPosition blockposition, T t0, int i, TickListPriority ticklistpriority) { -+ // Tuinity start - allow overriding -+ this.schedule(blockposition, t0, i, ticklistpriority); -+ } -+ public void schedule(BlockPosition blockposition, T t0, int i, TickListPriority ticklistpriority) { -+ // Tuinity end - if (!this.a.test(t0)) { - this.a(new NextTickListEntry<>(blockposition, t0, (long) i + this.f.getTime(), ticklistpriority)); - } -@@ -230,6 +276,11 @@ public class TickListServer implements TickList { - } - - public int a() { -+ // Tuinity start - allow overriding -+ return this.getTotalScheduledEntries(); -+ } -+ public int getTotalScheduledEntries() { -+ // Tuinity end - return this.nextTickListHash.size(); - } - } diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java index 7a8397815a..0d5b1a0b7b 100644 --- a/src/main/java/net/minecraft/server/Ticket.java @@ -9549,7 +9286,7 @@ index 5117dafbcf..5f69a018d9 100644 if (chunk != null) { chunk.a(oclass, axisalignedbb, list, predicate); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index c74b85917a..83ccabe710 100644 +index 3e5ed2bd4e..08d3806a31 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -55,7 +55,7 @@ public class WorldServer extends World { @@ -9570,11 +9307,10 @@ index c74b85917a..83ccabe710 100644 // Paper start - optimise getPlayerByUUID @Nullable @Override -@@ -170,6 +172,373 @@ public class WorldServer extends World { +@@ -177,6 +179,367 @@ public class WorldServer extends World { } - // Paper end + // Paper end - rewrite ticklistserver -+ + // Tuinity start + public final com.tuinity.tuinity.util.EntityList loadedEntities = new com.tuinity.tuinity.util.EntityList(); + void onChunkLoad(final Chunk chunk) { @@ -9592,11 +9328,6 @@ index c74b85917a..83ccabe710 100644 + this.loadedEntities.remove(entities[i]); + } + } -+ -+ void onChunkSetTicking(int chunkX, int chunkZ) { -+ ((com.tuinity.tuinity.server.TuinityTickList)this.nextTickListBlock).onChunkSetTicking(chunkX, chunkZ); -+ ((com.tuinity.tuinity.server.TuinityTickList)this.nextTickListFluid).onChunkSetTicking(chunkX, chunkZ); -+ } + // Tuinity end + + // Tuinity start @@ -9944,20 +9675,7 @@ index c74b85917a..83ccabe710 100644 // Add env and gen to constructor public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { super(worlddata, dimensionmanager, (world, worldprovider) -> { -@@ -190,10 +559,10 @@ public class WorldServer extends World { - this.pvpMode = minecraftserver.getPVP(); - worlddata.world = this; - // CraftBukkit end -- this.nextTickListBlock = new TickListServer<>(this, (block) -> { -+ this.nextTickListBlock = new com.tuinity.tuinity.server.TuinityTickList<>(this, (block) -> { // Tuinity - optimise TickListServer - return block == null || block.getBlockData().isAir(); - }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b, "Blocks"); // Paper - Timings -- this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> { -+ this.nextTickListFluid = new com.tuinity.tuinity.server.TuinityTickList<>(this, (fluidtype) -> { // Tuinity - optimise TickListServer - return fluidtype == null || fluidtype == FluidTypes.EMPTY; - }, IRegistry.FLUID::getKey, IRegistry.FLUID::get, this::a, "Fluids"); // Paper - Timings - this.navigators = Sets.newHashSet(); -@@ -458,14 +827,13 @@ public class WorldServer extends World { +@@ -465,14 +828,13 @@ public class WorldServer extends World { gameprofilerfiller.exitEnter("regular"); this.tickingEntities = true; @@ -9974,7 +9692,7 @@ index c74b85917a..83ccabe710 100644 Entity entity2 = entity1.getVehicle(); /* CraftBukkit start - We prevent spawning in general, so this butchering is not needed -@@ -502,7 +870,7 @@ public class WorldServer extends World { +@@ -509,7 +871,7 @@ public class WorldServer extends World { gameprofilerfiller.enter("remove"); if (entity1.dead) { this.removeEntityFromChunk(entity1); @@ -9983,7 +9701,7 @@ index c74b85917a..83ccabe710 100644 this.unregisterEntity(entity1); } -@@ -818,6 +1186,10 @@ public class WorldServer extends World { +@@ -825,6 +1187,10 @@ public class WorldServer extends World { int k = MathHelper.floor(entity.locZ() / 16.0D); if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) { @@ -9994,7 +9712,7 @@ index c74b85917a..83ccabe710 100644 if (entity.inChunk && this.isChunkLoaded(entity.chunkX, entity.chunkZ)) { this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY); } -@@ -827,6 +1199,83 @@ public class WorldServer extends World { +@@ -834,6 +1200,83 @@ public class WorldServer extends World { } else { this.getChunkAt(i, k).a(entity); } @@ -10078,7 +9796,7 @@ index c74b85917a..83ccabe710 100644 } this.getMethodProfiler().exit(); -@@ -1178,6 +1627,7 @@ public class WorldServer extends World { +@@ -1185,6 +1628,7 @@ public class WorldServer extends World { this.registerEntity(entityplayer); this.getChunkProvider().playerChunkMap.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps @@ -10086,7 +9804,7 @@ index c74b85917a..83ccabe710 100644 } // CraftBukkit start -@@ -1360,6 +1810,7 @@ public class WorldServer extends World { +@@ -1367,6 +1811,7 @@ public class WorldServer extends World { this.players.remove(entityplayer); this.getChunkProvider().playerChunkMap.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps @@ -10094,7 +9812,7 @@ index c74b85917a..83ccabe710 100644 } this.getScoreboard().a(entity); -@@ -1372,6 +1823,7 @@ public class WorldServer extends World { +@@ -1379,6 +1824,7 @@ public class WorldServer extends World { if (entity instanceof EntityInsentient) { this.navigators.remove(((EntityInsentient) entity).getNavigation()); } @@ -10102,7 +9820,7 @@ index c74b85917a..83ccabe710 100644 new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid entity.valid = false; // CraftBukkit } -@@ -1428,6 +1880,11 @@ public class WorldServer extends World { +@@ -1435,6 +1881,11 @@ public class WorldServer extends World { } // Paper end entity.shouldBeRemoved = false; // Paper - shouldn't be removed after being re-added diff --git a/patches/server/0013-Zombie-horse-naturally-spawn.patch b/patches/server/0013-Zombie-horse-naturally-spawn.patch index 11daf403b..6fa79957a 100644 --- a/patches/server/0013-Zombie-horse-naturally-spawn.patch +++ b/patches/server/0013-Zombie-horse-naturally-spawn.patch @@ -1,4 +1,4 @@ -From 94274740a40d6930ee04f196419209289e18992c Mon Sep 17 00:00:00 2001 +From 4a16187dfc2604023cadda1a714fb8b65f5aa731 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sun, 7 Jul 2019 19:52:16 -0500 Subject: [PATCH] Zombie horse naturally spawn @@ -9,10 +9,10 @@ Subject: [PATCH] Zombie horse naturally spawn 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 214b555e7..633d67b66 100644 +index 08d3806a31..8eae813adc 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -922,12 +922,18 @@ public class WorldServer extends World { +@@ -923,12 +923,18 @@ public class WorldServer extends World { boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper if (flag1) { @@ -38,7 +38,7 @@ index 214b555e7..633d67b66 100644 this.strikeLightning(new EntityLightning(this, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, flag1), org.bukkit.event.weather.LightningStrikeEvent.Cause.WEATHER); // CraftBukkit diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index ce17384c1..300622e50 100644 +index ce17384c1d..300622e50d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -643,9 +643,11 @@ public class PurpurWorldConfig { diff --git a/patches/server/0042-Implement-AFK-API.patch b/patches/server/0042-Implement-AFK-API.patch index 981dfe6cf..aa78a7733 100644 --- a/patches/server/0042-Implement-AFK-API.patch +++ b/patches/server/0042-Implement-AFK-API.patch @@ -1,4 +1,4 @@ -From e7e9bd131a20909782422715828c3bc79b2c430d Mon Sep 17 00:00:00 2001 +From bfec24048fcbf8603ebc427e8f8a018c38248df4 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Thu, 8 Aug 2019 15:29:15 -0500 Subject: [PATCH] Implement AFK API @@ -192,10 +192,10 @@ index 67afa457e8..2659da1881 100644 if (from.getX() != Double.MAX_VALUE) { Location oldTo = to.clone(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d6472905a2..22a1c4ebfa 100644 +index 8eae813adc..baa0f885e5 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -745,7 +745,7 @@ public class WorldServer extends World { +@@ -746,7 +746,7 @@ public class WorldServer extends World { } if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> { @@ -204,7 +204,7 @@ index d6472905a2..22a1c4ebfa 100644 })) { // CraftBukkit start long l = this.worldData.getDayTime() + 24000L; -@@ -1050,7 +1050,7 @@ public class WorldServer extends World { +@@ -1051,7 +1051,7 @@ public class WorldServer extends World { while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); diff --git a/patches/server/0104-Fix-the-dead-lagging-the-server.patch b/patches/server/0103-Fix-the-dead-lagging-the-server.patch similarity index 94% rename from patches/server/0104-Fix-the-dead-lagging-the-server.patch rename to patches/server/0103-Fix-the-dead-lagging-the-server.patch index 850113fa7..375a1d8ef 100644 --- a/patches/server/0104-Fix-the-dead-lagging-the-server.patch +++ b/patches/server/0103-Fix-the-dead-lagging-the-server.patch @@ -1,4 +1,4 @@ -From d50854467c74f3cd32f59b4d793c1e1e12f1aa02 Mon Sep 17 00:00:00 2001 +From f72508df3de9638254adfefe01f099b4460f4cf1 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 6 Mar 2020 13:37:26 -0600 Subject: [PATCH] Fix the dead lagging the server @@ -9,7 +9,7 @@ Subject: [PATCH] Fix the dead lagging the server 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a38a29e3d6..6805ad2cde 100644 +index d5da3bcc37..23c7b21454 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1442,7 +1442,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/patches/server/0103-Optimise-Chunk-getFluid.patch b/patches/server/0103-Optimise-Chunk-getFluid.patch deleted file mode 100644 index 31269bc00..000000000 --- a/patches/server/0103-Optimise-Chunk-getFluid.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 7000314ffa357b56e62c594132274fe7cdb815e4 Mon Sep 17 00:00:00 2001 -From: Spottedleaf -Date: Tue, 14 Jan 2020 14:59:08 -0800 -Subject: [PATCH] Optimise Chunk#getFluid - -Removing the try catch and generally reducing ops should make it -faster on its own, however removing the try catch makes it -easier to inline due to code size ---- - src/main/java/net/minecraft/server/Chunk.java | 18 +++++++++++------- - .../net/minecraft/server/ChunkSection.java | 2 +- - 2 files changed, 12 insertions(+), 8 deletions(-) - -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index cd7ada6159..15d66edadb 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -385,17 +385,20 @@ public class Chunk implements IChunkAccess { - } - - public Fluid a(int i, int j, int k) { -- try { -- if (j >= 0 && j >> 4 < this.sections.length) { -- ChunkSection chunksection = this.sections[j >> 4]; -- -- if (!ChunkSection.a(chunksection)) { -- return chunksection.b(i & 15, j & 15, k & 15); -+ //try { // Paper - remove try catch -+ // Paper start - reduce the number of ops in this call -+ int index = j >> 4; -+ if (index >= 0 && index < this.sections.length) { -+ ChunkSection chunksection = this.sections[index]; -+ -+ if (chunksection != null) { -+ return chunksection.blockIds.a((j & 15) << 8 | (k & 15) << 4 | i & 15).getFluid(); - } -+ // Paper end - } - - return FluidTypes.EMPTY.h(); -- } catch (Throwable throwable) { -+ /*} catch (Throwable throwable) { // Paper - remove try catch - CrashReport crashreport = CrashReport.a(throwable, "Getting fluid state"); - CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being got"); - -@@ -404,6 +407,7 @@ public class Chunk implements IChunkAccess { - }); - throw new ReportedException(crashreport); - } -+ */ // Paper - remove try catch - } - - // CraftBukkit start -diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 8b28fb5ee1..426221f7c3 100644 ---- a/src/main/java/net/minecraft/server/ChunkSection.java -+++ b/src/main/java/net/minecraft/server/ChunkSection.java -@@ -46,7 +46,7 @@ public class ChunkSection { - } - - public Fluid b(int i, int j, int k) { -- return ((IBlockData) this.blockIds.a(i, j, k)).getFluid(); -+ return ((IBlockData) this.blockIds.a(i, j, k)).getFluid(); // Paper - diff on change - we expect this to be effectively just getType(x, y, z).getFluid(). If this changes we need to check other patches that use IBlockData#getFluid. - } - - public void a() { --- -2.24.0 - diff --git a/patches/server/0105-Add-flying-mobs-to-entity-activation-range-settings.patch b/patches/server/0104-Add-flying-mobs-to-entity-activation-range-settings.patch similarity index 98% rename from patches/server/0105-Add-flying-mobs-to-entity-activation-range-settings.patch rename to patches/server/0104-Add-flying-mobs-to-entity-activation-range-settings.patch index 1f891645d..c7e254d5c 100644 --- a/patches/server/0105-Add-flying-mobs-to-entity-activation-range-settings.patch +++ b/patches/server/0104-Add-flying-mobs-to-entity-activation-range-settings.patch @@ -1,4 +1,4 @@ -From 3f69dbb853814d1248b54ce43569f09109803946 Mon Sep 17 00:00:00 2001 +From 5b6b2312179ab089067664c3041b407f42aabaa5 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sun, 8 Mar 2020 20:54:44 -0500 Subject: [PATCH] Add flying mobs to entity activation range settings diff --git a/patches/server/0106-Add-mspt-command.patch b/patches/server/0105-Add-mspt-command.patch similarity index 98% rename from patches/server/0106-Add-mspt-command.patch rename to patches/server/0105-Add-mspt-command.patch index 915c72d16..e1e2c7af2 100644 --- a/patches/server/0106-Add-mspt-command.patch +++ b/patches/server/0105-Add-mspt-command.patch @@ -1,4 +1,4 @@ -From e4698cba757f2f19738e3c4546c28b3869afba41 Mon Sep 17 00:00:00 2001 +From 8e0c4028961c7591183a780aded32300bc3b36f5 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 13 Mar 2020 22:23:44 -0500 Subject: [PATCH] Add /mspt command diff --git a/patches/server/0107-Add-ping-command.patch b/patches/server/0106-Add-ping-command.patch similarity index 98% rename from patches/server/0107-Add-ping-command.patch rename to patches/server/0106-Add-ping-command.patch index d0c1fd8c8..ba51f07b4 100644 --- a/patches/server/0107-Add-ping-command.patch +++ b/patches/server/0106-Add-ping-command.patch @@ -1,4 +1,4 @@ -From 161b165c9a9858a322caea78729b801c49d32422 Mon Sep 17 00:00:00 2001 +From f9a4960781b70e245b00e1e28ddb8d7a3582034c Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 13 Mar 2020 22:29:10 -0500 Subject: [PATCH] Add /ping command