diff options
author | Aikar <[email protected]> | 2020-08-02 01:39:36 -0400 |
---|---|---|
committer | Aikar <[email protected]> | 2020-08-02 01:39:36 -0400 |
commit | 9788250b1090713057c6ca39827f52c463fee11c (patch) | |
tree | 9cb7add4dc5610a8eb779f6715ae79cc698e65d9 | |
parent | 58a745eba0beeec4f080256330261c505b8e1a66 (diff) | |
download | Paper-9788250b1090713057c6ca39827f52c463fee11c.tar.gz Paper-9788250b1090713057c6ca39827f52c463fee11c.zip |
Clean up a lot of obfuscation helpers and impls
This fixes a bug with obfuscation helpers for attack cooldown
But every other change should stay the same.
Cleaning up a lot of helpers that pointed to already unobfuscated items.
Also adds final to many of the obfhelpers to assist with inlining.
This is pretty much a patch maintenance
60 files changed, 383 insertions, 479 deletions
diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index 88bfd4bb36..887692ab8a 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -7,7 +7,7 @@ Loads each yml file for early init too so it can be used for early options diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java new file mode 100644 -index 0000000000000000000000000000000000000000..41c79650b169b87fbc70cf502438a5453a04f23d +index 0000000000000000000000000000000000000000..b8868b86338ce0e89bc74eccccf714b910d7a4fe --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -0,0 +1,256 @@ @@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..41c79650b169b87fbc70cf502438a545 + MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch + + MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); -+ ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); ++ ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); + info.left++; + info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1); + if (!chunkProviderServer.isInEntityTickingChunk(e)) { @@ -575,23 +575,6 @@ index 27e6872c675647d7e61040b76183dac4e347a40c..aa68eb71b131c1d529ded6c651621cfa this.setPVP(dedicatedserverproperties.pvp); this.setAllowFlight(dedicatedserverproperties.allowFlight); -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4ee11b6fbbb49b1f52fe2cf64f77c1bdd2fd3907..51499ef45faa2bba5f180ee333c09af73d3b708e 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -135,9 +135,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { - private static final DataWatcherObject<Boolean> aA = DataWatcher.a(Entity.class, DataWatcherRegistry.i); - protected static final DataWatcherObject<EntityPose> POSE = DataWatcher.a(Entity.class, DataWatcherRegistry.s); - public boolean inChunk; -- public int chunkX; -- public int chunkY; -- public int chunkZ; -+ public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER -+ public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER -+ public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER - private boolean aB; - public long Z; - public long aa; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java index 62f62c2c98fbaff163d9079091e6f39db2d77fa0..484e78746aa62bb0b12968165bf8e056b27152f3 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index 1576666f42..4423beb086 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -2284,9 +2284,22 @@ index 277d7a124e9a21803fe4d5a66fc0b311df2cfba7..02c09f39848399a86d46bd17569b4f01 double d0 = this.b(); double d1 = this.c(); diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index ff4b23927bb0e0ac8221d71fe2543cbee54f913a..ee28d0335418a0053f8448ab5e12ebba5a9a3b2d 100644 +index ff4b23927bb0e0ac8221d71fe2543cbee54f913a..b190cd9ef8f447e4e9ff1adb74bff6e63750caad 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -16,9 +16,9 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { + return IntStream.of(new int[]{baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()}); + }); + public static final BaseBlockPosition ZERO = new BaseBlockPosition(0, 0, 0); +- private int a; +- private int b; +- private int e; ++ private int a;public final void setX(final int x) { this.a = x; } // Paper - OBFHELPER ++ private int b;public final void setY(final int y) { this.b = y; } // Paper - OBFHELPER ++ private int e;public final void setZ(final int z) { this.e = z; } // Paper - OBFHELPER + + public BaseBlockPosition(int i, int j, int k) { + this.a = i; @@ -98,6 +98,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { return this.distanceSquared(iposition.getX(), iposition.getY(), iposition.getZ(), true) < d0 * d0; } @@ -2319,88 +2332,65 @@ index eff6ebcd30b538cbaedaa031a46a59ea956253ba..30cbfc8eac20910aa55951e3dce63862 public IBlockData getType(BlockPosition blockposition) { return Blocks.AIR.getBlockData(); diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 47324feca49786b49563d3d0e854e74ad27c190b..26d446077bb563ca3c5bb0339695b3364a3e41bf 100644 +index 47324feca49786b49563d3d0e854e74ad27c190b..788dec1be6124ac26eb5709fe45c2fac3d44e7a8 100644 --- a/src/main/java/net/minecraft/server/BlockBase.java +++ b/src/main/java/net/minecraft/server/BlockBase.java @@ -632,6 +632,7 @@ public abstract class BlockBase { return this.a != null ? this.a.e : Block.a(this.getCollisionShape(iblockaccess, blockposition)); } -+ public IBlockData getBlockData() { return p(); } // Paper - OBFHELPER ++ public final IBlockData getBlockData() { return p(); } // Paper - OBFHELPER protected abstract IBlockData p(); public boolean isAlwaysDestroyable() { diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 886b43e2b8f21c358b4d6785c677f14c91d191f3..f1ad6ad22a59b28d2e8aeb2c0f4c21bce6070bc5 100644 +index 886b43e2b8f21c358b4d6785c677f14c91d191f3..6641fd1580ffd2996ec6b74004ec3ed39516bb2f 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -98,6 +98,7 @@ public class BlockPosition extends BaseBlockPosition { return d0 == 0.0D && d1 == 0.0D && d2 == 0.0D ? this : new BlockPosition((double) this.getX() + d0, (double) this.getY() + d1, (double) this.getZ() + d2); } -+ public BlockPosition add(int i, int j, int k) {return b(i, j, k);} // Paper - OBFHELPER ++ public final BlockPosition add(int i, int j, int k) {return b(i, j, k);} // Paper - OBFHELPER public BlockPosition b(int i, int j, int k) { return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k); } -@@ -188,6 +189,8 @@ public class BlockPosition extends BaseBlockPosition { - return new BlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX()); - } - -+ @Deprecated // We'll replace this... -+ public BlockPosition asImmutable() { return immutableCopy(); } // Paper - OBFHELPER - public BlockPosition immutableCopy() { - return this; - } -@@ -368,6 +371,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -368,6 +369,7 @@ public class BlockPosition extends BaseBlockPosition { return super.a(enumblockrotation).immutableCopy(); } -+ public BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER ++ public final BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER public BlockPosition.MutableBlockPosition d(int i, int j, int k) { this.o(i); this.p(j); -@@ -375,6 +379,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -375,6 +377,7 @@ public class BlockPosition extends BaseBlockPosition { return this; } -+ public BlockPosition.MutableBlockPosition setValues(double d0, double d1, double d2) { return c(d0, d1, d2);} // Paper - OBFHELPER ++ public final BlockPosition.MutableBlockPosition setValues(double d0, double d1, double d2) { return c(d0, d1, d2);} // Paper - OBFHELPER public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) { return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } -@@ -424,16 +429,19 @@ public class BlockPosition extends BaseBlockPosition { +@@ -424,6 +427,7 @@ public class BlockPosition extends BaseBlockPosition { } } -+ public final void setX(final int x) { super.o(x); } // Paper - OBFHELPER ++ /* // Paper start - comment out useless overrides @Override @Override public void o(int i) { super.o(i); - } - -+ public final void setY(final int y) { super.p(y); } // Paper - OBFHELPER - @Override - public void p(int i) { +@@ -434,10 +438,10 @@ public class BlockPosition extends BaseBlockPosition { super.p(i); } -+ public final void setZ(final int z) { super.q(z); } // Paper - OBFHELPER - @Override +- @Override public void q(int i) { super.q(i); -@@ -444,4 +452,13 @@ public class BlockPosition extends BaseBlockPosition { - return new BlockPosition(this); } - } -+ -+ // Paper start -+ public static class PooledBlockPosition extends BlockPosition.MutableBlockPosition implements AutoCloseable { -+ @Deprecated -+ public void close() {} -+ @Deprecated -+ public static BlockPosition.PooledBlockPosition acquire() { return new PooledBlockPosition(); } -+ } -+ // Paper end - } ++ */ // Paper end + + @Override + public BlockPosition immutableCopy() { diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 3cdcdc60df4f28197cf19c59ea42a92ae4af3819..7c7826cf3adb19814984ab627e4c4726d8933244 100644 --- a/src/main/java/net/minecraft/server/Chunk.java @@ -2697,10 +2687,10 @@ index b703382204a3ccd57e642cff18c7c28fef157cc0..8eecdcde510661ec3a13a25a04ba394f @Override public TileEntity getTileEntity(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 2837823547bdc9655376af3af89c43d84719d513..35b8a85d1280ba3be757b14b14388954ac1617d4 100644 +index 2837823547bdc9655376af3af89c43d84719d513..f0e28f03074bc5e24e5fa64dca94c7573f952357 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -@@ -11,27 +11,33 @@ public class ChunkCoordIntPair { +@@ -11,27 +11,32 @@ public class ChunkCoordIntPair { public static final long a = pair(1875016, 1875016); public final int x; public final int z; @@ -2730,8 +2720,7 @@ index 2837823547bdc9655376af3af89c43d84719d513..35b8a85d1280ba3be757b14b14388954 } - public static long pair(int i, int j) { -+ public static long asLong(final BlockPosition pos) { return pair(pos.getX() >> 4, pos.getZ() >> 4); } // Paper - OBFHELPER -+ public static long asLong(int x, int z) { return pair(x, z); } // Paper - OBFHELPER ++ public static long pair(final BlockPosition pos) { return pair(pos.getX() >> 4, pos.getZ() >> 4); } // Paper - OBFHELPER + public static long pair(int i, int j) { return (long) i & 4294967295L | ((long) j & 4294967295L) << 32; } @@ -2994,14 +2983,14 @@ index b0f7ea97d4795655b6c30b296fd929806dac4ef1..882c2733beaff1df68b892d44fc77cac packetdataserializer.writeShort(this.nonEmptyBlockCount); this.blockIds.b(packetdataserializer); diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index cd572c76522b2ee900a03fd5cf6753f3297c1ccd..2c3580c1c7bcd6afc83a45550c0f672a592e0c38 100644 +index cd572c76522b2ee900a03fd5cf6753f3297c1ccd..e58593e6ecc224db1b6e4bac6183d3cb032ddb4a 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -83,6 +83,7 @@ public class DataBits { return (int) (k >> l & this.d); } -+ public long[] getDataBits() { return this.a(); } // Paper - OBFHELPER ++ public final long[] getDataBits() { return this.a(); } // Paper - OBFHELPER public long[] a() { return this.b; } @@ -3023,7 +3012,7 @@ index b7f4330bbe3b51e6792043cbd0c46c73aad457cb..75b721933ccbe8edc1cd7ea5cc456221 T a(int i); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 8856981da86219bdb036aa6246152f382ff8a818..4c6979903d287f7f37d9029f6ce2551742f26164 100644 +index 8856981da86219bdb036aa6246152f382ff8a818..32849e360a396128bd228db269ad1a8f7c6583a8 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -10,7 +10,7 @@ import java.util.stream.Collectors; @@ -3042,7 +3031,7 @@ index 8856981da86219bdb036aa6246152f382ff8a818..4c6979903d287f7f37d9029f6ce25517 - protected DataBits a; - private DataPalette<T> h; - private int i; -+ protected DataBits a; protected DataBits getDataBits() { return this.a; } // Paper - OBFHELPER ++ protected DataBits a; public final DataBits getDataBits() { return this.a; } // Paper - OBFHELPER + private DataPalette<T> h; private DataPalette<T> getDataPalette() { return this.h; } // Paper - OBFHELPER + private int i; private int getBitsPerObject() { return this.i; } // Paper - OBFHELPER private final ReentrantLock j = new ReentrantLock(); @@ -3065,7 +3054,7 @@ index 8856981da86219bdb036aa6246152f382ff8a818..4c6979903d287f7f37d9029f6ce25517 this.a(); packetdataserializer.writeByte(this.i); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 51499ef45faa2bba5f180ee333c09af73d3b708e..9da321fc0e02e4a2e47f515011df33714affd368 100644 +index 4ee11b6fbbb49b1f52fe2cf64f77c1bdd2fd3907..c6466b16926a368a4f149cedd3f2dc90ec86290d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -983,8 +983,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { @@ -3114,7 +3103,7 @@ index b309d9a13b35f5c04c3a0f048e858df99d8ac617..e5455d99e3f5607a5754e5760d42853a // CraftBukkit start - fire event setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 8ff295ed373cc316e56e4a01a268f98b7b773bd5..dccb315440f7429fe881bd0d12af8f1ae8e35c3d 100644 +index 7b4d71d1eb62d9368c379ccb3fb78dd930267c87..e0e918cf425c87e4f808ae1d3bd13380d37940dd 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -137,6 +137,7 @@ public abstract class EntityLiving extends Entity { @@ -3183,7 +3172,7 @@ index 484e78746aa62bb0b12968165bf8e056b27152f3..9a772e40ad8f9858e6278b99d9d1ff5d } diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba..1ba26ee10f338edbec0f580bb55d083a3d6d2284 100644 +index b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba..4c65bf1f692b20d5c876a2840d5d9f76b67c6d2d 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -68,6 +68,15 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R @@ -3198,7 +3187,7 @@ index b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba..1ba26ee10f338edbec0f580bb55d083a + } + // Paper end + -+ public void addTask(R r0) { a(r0); }; // Paper - OBFHELPER ++ public final void addTask(R r0) { a(r0); }; // Paper - OBFHELPER public void a(R r0) { this.d.add(r0); LockSupport.unpark(this.getThread()); @@ -4199,7 +4188,7 @@ index 5f692d719fd270120207ebcf6d0a2a24e8d59f7b..3e2e355177e32856dac07dc8b98658ad @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 92922db3f57877507c6443c49f4c021aee667b1d..b8d3c4d35cee2ba4678f6d22b8ea956d598d9d9b 100644 +index 051bdbd602eb25c7d2f4a78a1a74946437d64294..d729a6a231f0b48b5b9ddabdf26febb66c0166d9 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch index 48fd21a4f6..f059c86728 100644 --- a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch +++ b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add MinecraftKey Information to Objects Stores the reference to the objects respective MinecraftKey diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 41c79650b169b87fbc70cf502438a5453a04f23d..b839769ceae8932bb121a0b96fde1e7d129a1f63 100644 +index b8868b86338ce0e89bc74eccccf714b910d7a4fe..9cb2f3b31921870ddba044840e99eb04babe26bb 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -178,7 +178,7 @@ public class PaperCommand extends Command { @@ -17,9 +17,9 @@ index 41c79650b169b87fbc70cf502438a5453a04f23d..b839769ceae8932bb121a0b96fde1e7d + MinecraftKey key = e.getMinecraftKey(); MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); - ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9da321fc0e02e4a2e47f515011df33714affd368..ee93b977b5f78855fd58a2055ca4e17255f3388b 100644 +index c6466b16926a368a4f149cedd3f2dc90ec86290d..2b1d674474cce96c02e5cdf71bc2c796447be59c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -49,7 +49,7 @@ import org.bukkit.event.player.PlayerTeleportEvent; diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index fd87bcbea8..ddef59e3ee 100644 --- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -8,7 +8,7 @@ This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7c7826cf3adb19814984ab627e4c4726d8933244..bd92ed2e6d4766f4f16ec3002c41b36b5a7e0358 100644 +index 7c7826cf3adb19814984ab627e4c4726d8933244..9cc32b879b02c8e31128e8d422221e0263126799 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -56,11 +56,36 @@ public class Chunk implements IChunkAccess { @@ -61,7 +61,7 @@ index 7c7826cf3adb19814984ab627e4c4726d8933244..bd92ed2e6d4766f4f16ec3002c41b36b ((HeightMap) this.heightMap.get(heightmap_type)).a(along); } -+ public void removeEntity(Entity entity) { this.b(entity); } // Paper - OBFHELPER ++ public final void removeEntity(Entity entity) { this.b(entity); } // Paper - OBFHELPER public void b(Entity entity) { this.a(entity, entity.chunkY); } @@ -80,7 +80,7 @@ index 7c7826cf3adb19814984ab627e4c4726d8933244..bd92ed2e6d4766f4f16ec3002c41b36b } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ee93b977b5f78855fd58a2055ca4e17255f3388b..e3f2e259b2c5e478bde45554995b9c742d9e2008 100644 +index 2b1d674474cce96c02e5cdf71bc2c796447be59c..dda4a16a6af6c39105b7dc4c2397ec5015b21ebd 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -178,7 +178,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -110,7 +110,7 @@ index ee93b977b5f78855fd58a2055ca4e17255f3388b..e3f2e259b2c5e478bde45554995b9c74 + return chunk; + } + -+ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ()); ++ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(chunkX, chunkZ); + } + private MinecraftKey entityKey; diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index 92c4a40e7a..1f7dbfe699 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -736,7 +736,7 @@ index c95bbcd46978522a2dce173b4c116aa39c8f2f01..3cc572b0ce757160c7ab4733b98d8ca8 private String name; @Nullable diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index eb08c7467595394fff9adf4f162aba9d71d7a7c2..09b4594ae6750252b4b13ed4735dad0d00e2aeec 100644 +index 86b2e9e52d3b39f4b3cf3e93eced3d01aa84c954..87d108135d58cd75f8cba2831728cf3c33d9c337 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -693,6 +693,7 @@ public class Chunk implements IChunkAccess { @@ -884,7 +884,7 @@ index 79e0e65a35945a6071cf08f688311ec4d1f71c72..28039aa8421207ce04840cc90e03d21b private static NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair, Map<StructureGenerator<?>, StructureStart<?>> map, Map<StructureGenerator<?>, LongSet> map1) { diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java -index 6d628c759346701c4097f36c302d1a1ab258bf9c..dd945eb709f75da58889002c9b8f7c22aaeeb30f 100644 +index 6d628c759346701c4097f36c302d1a1ab258bf9c..67e1b153a6f2ff9547dd03fcf4abcbea851e69f9 100644 --- a/src/main/java/net/minecraft/server/CustomFunction.java +++ b/src/main/java/net/minecraft/server/CustomFunction.java @@ -13,12 +13,22 @@ public class CustomFunction { @@ -906,7 +906,7 @@ index 6d628c759346701c4097f36c302d1a1ab258bf9c..dd945eb709f75da58889002c9b8f7c22 this.a = acustomfunction_c; } -+ public MinecraftKey getMinecraftKey() { return this.a(); } // Paper - OBFHELPER ++ public final MinecraftKey getMinecraftKey() { return this.a(); } // Paper - OBFHELPER public MinecraftKey a() { return this.b; } @@ -1003,7 +1003,7 @@ index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e3f2e259b2c5e478bde45554995b9c742d9e2008..98eec5efe474011665bd819d0d0b11abd6a068ea 100644 +index dda4a16a6af6c39105b7dc4c2397ec5015b21ebd..15b8767d330bd89c070116f1f180841d3ef9342a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender; diff --git a/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index 3e47e61bdd..17c043634b 100644 --- a/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -19,26 +19,26 @@ index 7d9976ce6bf86e6fdfd0c7770104cee0db363a6d..6d6a68cb1b952da8308ac9ce5b54694b + } } diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java -index 2e869004c8c6b8bfbb002fb4eda04519d50390c8..8a6856e0fd7b9b515d98f45aaabefbc30d532596 100644 +index 2e869004c8c6b8bfbb002fb4eda04519d50390c8..22eb89df768819f0a18f91b806b56acec8489281 100644 --- a/src/main/java/net/minecraft/server/ControllerJump.java +++ b/src/main/java/net/minecraft/server/ControllerJump.java @@ -13,6 +13,7 @@ public class ControllerJump { this.a = true; } -+ public void jumpIfSet() { this.b(); } // Paper - OBFHELPER ++ public final void jumpIfSet() { this.b(); } // Paper - OBFHELPER public void b() { this.b.setJumping(this.a); this.a = false; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 98eec5efe474011665bd819d0d0b11abd6a068ea..a50b005b9f3fc58674560f42b9c4a20fd8b669fa 100644 +index 15b8767d330bd89c070116f1f180841d3ef9342a..faf51fd55870cc8fff5b92e7ba9eeb0ed039c079 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1024,6 +1024,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.isInWater() || this.isInRain(); } -+ public boolean isInWaterOrRainOrBubble() { return aC(); } // Paper - OBFHELPER ++ public final boolean isInWaterOrRainOrBubble() { return aC(); } // Paper - OBFHELPER public boolean aC() { return this.isInWater() || this.isInRain() || this.k(); } diff --git a/Spigot-Server-Patches/0025-Entity-Origin-API.patch b/Spigot-Server-Patches/0025-Entity-Origin-API.patch index 1e4a5b7dca..1390084050 100644 --- a/Spigot-Server-Patches/0025-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0025-Entity-Origin-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e85172eb69b04746eab08abf213dcd02cd4513ee..bfe36be070677d215eadd3ad38f93c6bddab0b75 100644 +index 20fbe45c9daa629e1c9841936a0bf1795b40f6a9..c1bb876262c17d32b1f14fd818f990c32011b272 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -167,6 +167,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -46,7 +46,7 @@ index e85172eb69b04746eab08abf213dcd02cd4513ee..bfe36be070677d215eadd3ad38f93c6b protected abstract void saveData(NBTTagCompound nbttagcompound); -+ protected NBTTagList createList(double... adouble) { return a(adouble); } // Paper - OBFHELPER ++ protected final NBTTagList createList(double... adouble) { return a(adouble); } // Paper - OBFHELPER protected NBTTagList a(double... adouble) { NBTTagList nbttaglist = new NBTTagList(); double[] adouble1 = adouble; diff --git a/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch index f9bb7a0d16..b218cac77a 100644 --- a/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -13,12 +13,12 @@ Replace all calls to the new place to the unnecessary forward. Optimize getType and getBlockData to manually inline and optimize the calls diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index ee28d0335418a0053f8448ab5e12ebba5a9a3b2d..8b202b342f899a38b989b683bd8be4f5c4061f48 100644 +index b190cd9ef8f447e4e9ff1adb74bff6e63750caad..1e1f4663525db5ab80e7c645be19a6ab4f335e5b 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -20,6 +20,15 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { - private int b; - private int e; + private int b;public final void setY(final int y) { this.b = y; } // Paper - OBFHELPER + private int e;public final void setZ(final int z) { this.e = z; } // Paper - OBFHELPER + // Paper start + public boolean isValidLocation() { @@ -33,7 +33,7 @@ index ee28d0335418a0053f8448ab5e12ebba5a9a3b2d..8b202b342f899a38b989b683bd8be4f5 this.a = i; this.b = j; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 3ade9a83f750854cd5663a6a177fe27eaac73c39..dc65ad095f9ec281c13f04254311d9cea80f43f8 100644 +index 421997be8a8519ed6e24eae2db5e77a4322adb2a..64a1c6f4672626818e28842bca7e8d78d013d14a 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -308,12 +308,27 @@ public class Chunk implements IChunkAccess { @@ -122,7 +122,7 @@ index 882c2733beaff1df68b892d44fc77cacf4364ff4..bd2290a4d4ec314b7afdb1f63d711f80 public Fluid b(int i, int j, int k) { diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 4c6979903d287f7f37d9029f6ce2551742f26164..bcf249aab7d8223f6d9b597fcb20c1aa523ab862 100644 +index 32849e360a396128bd228db269ad1a8f7c6583a8..eabc9d7b934f27c823e012f3f10fffc23b461292 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -124,7 +124,7 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> { diff --git a/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch index d6abf7a8d1..2291c3bd62 100644 --- a/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch @@ -378,10 +378,10 @@ index 0000000000000000000000000000000000000000..b5401eaf974857455c17c3f9cfdedf2e +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java new file mode 100644 -index 0000000000000000000000000000000000000000..f9fbc221bd8f9b04276611ef5b800595f23dedd7 +index 0000000000000000000000000000000000000000..8c1fa60a55570be91ab5ea63cb2005caa09e3600 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java -@@ -0,0 +1,64 @@ +@@ -0,0 +1,63 @@ +package com.destroystokyo.paper.loottable; + +import net.minecraft.server.Entity; @@ -401,7 +401,7 @@ index 0000000000000000000000000000000000000000..f9fbc221bd8f9b04276611ef5b800595 + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return entity.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTableKey())) : null; ++ return entity.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.lootTable)) : null; + } + + @Override @@ -422,8 +422,7 @@ index 0000000000000000000000000000000000000000..f9fbc221bd8f9b04276611ef5b800595 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ entity.setLootTable(newKey); ++ entity.lootTable = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); + } + + @Override @@ -448,10 +447,10 @@ index 0000000000000000000000000000000000000000..f9fbc221bd8f9b04276611ef5b800595 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java new file mode 100644 -index 0000000000000000000000000000000000000000..d50410532c27bd2aa932c2a3f5765ca1eede5304 +index 0000000000000000000000000000000000000000..a1923aff2b5e2e867670a5a064a767915fc1cc2a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java -@@ -0,0 +1,67 @@ +@@ -0,0 +1,66 @@ +package com.destroystokyo.paper.loottable; + +import net.minecraft.server.MCUtil; @@ -470,7 +469,7 @@ index 0000000000000000000000000000000000000000..d50410532c27bd2aa932c2a3f5765ca1 + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return tileEntityLootable.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.getLootTableKey())) : null; ++ return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; + } + + @Override @@ -481,18 +480,17 @@ index 0000000000000000000000000000000000000000..d50410532c27bd2aa932c2a3f5765ca1 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ tileEntityLootable.setLootTable(newKey); ++ tileEntityLootable.lootTable = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); + } + + @Override + public void setSeed(long seed) { -+ tileEntityLootable.setSeed(seed); ++ tileEntityLootable.lootTableSeed = seed; + } + + @Override + public long getSeed() { -+ return tileEntityLootable.getSeed(); ++ return tileEntityLootable.lootTableSeed; + } + + @Override @@ -520,7 +518,7 @@ index 0000000000000000000000000000000000000000..d50410532c27bd2aa932c2a3f5765ca1 + } +} diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b5625318ca6bfeeada2d3fb009b711685265ebaa..562f2e3e639a07852951081ea0887a9c582be6c5 100644 +index d20d8f37dd8e09afaa763312040d31adddff5838..05a297534e1986226404f5fa27d817eb0fe87fec 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -532,15 +530,10 @@ index b5625318ca6bfeeada2d3fb009b711685265ebaa..562f2e3e639a07852951081ea0887a9c public CraftEntity getBukkitEntity() { diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..397fc1a9857cf91043ebd7982e16ea92d95b5cde 100644 +index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..510bfffcb986eed991f0b6981eeba5ce62fc3ed0 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -@@ -15,10 +15,11 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - private NonNullList<ItemStack> items; - private boolean c; - @Nullable -- public MinecraftKey lootTable; -+ public MinecraftKey lootTable; public MinecraftKey getLootTableKey() { return this.lootTable; } public void setLootTable(final MinecraftKey key) { this.lootTable = key; } // Paper - OBFHELPER +@@ -19,6 +19,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp public long lootTableSeed; // CraftBukkit start @@ -596,17 +589,13 @@ index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..397fc1a9857cf91043ebd7982e16ea92 if (entityhuman != null) { diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java -index 1eb43345bda9fa96d4f3383afb2fed1e998c9da6..e00ae999194f96fb4de556518abe495432a43a62 100644 +index 1eb43345bda9fa96d4f3383afb2fed1e998c9da6..006f8bace83ba1e540399b3f05952fa5edb0681f 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java -@@ -6,8 +6,9 @@ import javax.annotation.Nullable; - public abstract class TileEntityLootable extends TileEntityContainer { - +@@ -8,6 +8,7 @@ public abstract class TileEntityLootable extends TileEntityContainer { @Nullable -- public MinecraftKey lootTable; -- public long lootTableSeed; -+ public MinecraftKey lootTable; public MinecraftKey getLootTableKey() { return this.lootTable; } public void setLootTable(final MinecraftKey key) { this.lootTable = key; } // Paper - OBFHELPER -+ public long lootTableSeed; public long getSeed() { return this.lootTableSeed; } public void setSeed(final long seed) { this.lootTableSeed = seed; } // Paper - OBFHELPER + public MinecraftKey lootTable; + public long lootTableSeed; + public final com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData = new com.destroystokyo.paper.loottable.PaperLootableInventoryData(new com.destroystokyo.paper.loottable.PaperTileEntityLootableInventory(this)); // Paper protected TileEntityLootable(TileEntityTypes<?> tileentitytypes) { diff --git a/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch index 2474bd6538..e3098a696b 100644 --- a/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't let fishinghooks use portals diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 14351cc9e60a0b8d33d319da9d473e74072767d7..393a2d3ede8e82b33979f18e0cda796bf003f8ef 100644 +index 62516bd33f52c01502157def48601f129e49b618..a82cafc57b4ac27c3920e30c999c1a36478e9f7c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -162,7 +162,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -18,7 +18,7 @@ index 14351cc9e60a0b8d33d319da9d473e74072767d7..393a2d3ede8e82b33979f18e0cda796b protected BlockPosition ah; protected Vec3D ai; diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index ab8f67c11419cc788fc3cb814d2224e65217dd08..13b46c59b9a017bfa985ad74f80eca77608d1891 100644 +index ab8f67c11419cc788fc3cb814d2224e65217dd08..588997ffe1e1d9bbc17a2fe64063138bde1469b8 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -191,6 +191,12 @@ public class EntityFishingHook extends IProjectile { @@ -27,7 +27,7 @@ index ab8f67c11419cc788fc3cb814d2224e65217dd08..13b46c59b9a017bfa985ad74f80eca77 this.ac(); + + // Paper start - These shouldn't be going through portals -+ if (this.inPortal()) { ++ if (this.inPortal) { + this.die(); + } + // Paper end diff --git a/Spigot-Server-Patches/0132-Firework-API-s.patch b/Spigot-Server-Patches/0132-Firework-API-s.patch index e8539eaf0f..eccccc9865 100644 --- a/Spigot-Server-Patches/0132-Firework-API-s.patch +++ b/Spigot-Server-Patches/0132-Firework-API-s.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Firework API's diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index fd34a0f2dcfe300763f31eda4d53951d66d875f7..5ac7957016d1ca6bc78ced0bcf3767d358677f45 100644 +index fd34a0f2dcfe300763f31eda4d53951d66d875f7..438002cd5d6c3e56ed05e99d89a061f07ecfe73f 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java @@ -13,7 +13,8 @@ public class EntityFireworks extends IProjectile { @@ -13,7 +13,7 @@ index fd34a0f2dcfe300763f31eda4d53951d66d875f7..5ac7957016d1ca6bc78ced0bcf3767d3 private int ticksFlown; public int expectedLifespan; - private EntityLiving ridingEntity; -+ private EntityLiving ridingEntity; public final EntityLiving getBoostedEntity() { return this.ridingEntity; } // Paper - OBFHELPER ++ public EntityLiving ridingEntity; // Paper - public + public java.util.UUID spawningEntity; // Paper public EntityFireworks(EntityTypes<? extends EntityFireworks> entitytypes, World world) { @@ -93,7 +93,7 @@ index c16ff6723d3fd191b990002d40dc021d7870555d..9c445902e6adc05773497bc4444203ca NBTBase nbtbase = this.get(s); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -index d984a7a78e9f8536abf7c30df9aa59dbfc7984ce..2dfa24e52ae9c46291090d367b1ee4e25a71c213 100644 +index d984a7a78e9f8536abf7c30df9aa59dbfc7984ce..f3066e6c781bcee72c235abcef5060fb080892d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java @@ -78,4 +78,17 @@ public class CraftFirework extends CraftProjectile implements Firework { @@ -109,7 +109,7 @@ index d984a7a78e9f8536abf7c30df9aa59dbfc7984ce..2dfa24e52ae9c46291090d367b1ee4e2 + + @Override + public org.bukkit.entity.LivingEntity getBoostedEntity() { -+ net.minecraft.server.EntityLiving boostedEntity = getHandle().getBoostedEntity(); ++ net.minecraft.server.EntityLiving boostedEntity = getHandle().ridingEntity; + return boostedEntity != null ? (org.bukkit.entity.LivingEntity) boostedEntity.getBukkitEntity() : null; + } + // Paper end diff --git a/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch index 6f1afc30e8..431ed9ed5e 100644 --- a/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch @@ -7,7 +7,7 @@ Establishes base extension of profile systems for future edits too diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java new file mode 100644 -index 0000000000000000000000000000000000000000..293b73f4747f48dbf8b6a8453d3fc777de11588d +index 0000000000000000000000000000000000000000..2751ce7f1556da07ef853807a588f096adf6ef7f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -0,0 +1,297 @@ @@ -196,7 +196,7 @@ index 0000000000000000000000000000000000000000..293b73f4747f48dbf8b6a8453d3fc777 + + boolean isCompleteFromCache = this.completeFromCache(true, onlineMode); + if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) { -+ GameProfile result = server.getSessionService().fillProfileProperties(profile, true); ++ GameProfile result = server.getMinecraftSessionService().fillProfileProperties(profile, true); + if (result != null) { + copyProfileProperties(result, this.profile, true); + } @@ -462,18 +462,6 @@ index 11ad9ca7d030895662903a09558fd353dcc3e49e..52476513405a28b4125170650ff53a07 MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService(); GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName())); -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 737159212c5139ba07dca2484c6cce8946167dba..5a5fc0626562d46f1ea6ce3e779e75de55611548 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1601,6 +1601,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas - this.G = i; - } - -+ public final MinecraftSessionService getSessionService() { return this.getMinecraftSessionService(); } // Paper - OBFHELPER - public MinecraftSessionService getMinecraftSessionService() { - return this.minecraftSessionService; - } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java index 4f769211cf98c3da720a904da3dcdcd4c7611f0b..a038397028848edb4f43cd4f7262546666e32883 100644 --- a/src/main/java/net/minecraft/server/UserCache.java diff --git a/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch index fed450f2f2..c06cd20829 100644 --- a/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..eaed020982bd19dab72872849170fa62d75699eb 100644 +index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..8ea9e23649da37f853478e4e7a9b2542de2a0355 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -1002,6 +1002,15 @@ public abstract class EntityHuman extends EntityLiving { @@ -15,7 +15,7 @@ index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..eaed020982bd19dab72872849170fa62 + // Paper start - send SoundEffect to everyone who can see fromEntity + private static void sendSoundEffect(EntityHuman fromEntity, double x, double y, double z, SoundEffect soundEffect, SoundCategory soundCategory, float volume, float pitch) { -+ fromEntity.world.sendSoundEffect(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself ++ fromEntity.world.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself + if (fromEntity instanceof EntityPlayer) { + ((EntityPlayer) fromEntity).playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(soundEffect, soundCategory, x, y, z, volume, pitch)); + } @@ -71,19 +71,3 @@ index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..eaed020982bd19dab72872849170fa62 if (flag4) { entity.extinguish(); } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f182fb60f572fe6e1f055cdb3ce28581a46783ad..16a87029aaa34601bc312db29925af1b0e568247 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -646,6 +646,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - this.playSound(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1); - } - -+ // Paper start - OBFHELPER -+ public final void sendSoundEffect(@Nullable EntityHuman fromEntity, double x, double y, double z, SoundEffect soundeffect, SoundCategory soundcategory, float volume, float pitch) { -+ this.playSound(fromEntity, x, y, z, soundeffect, soundcategory, volume, pitch); -+ } -+ // Paper end - public abstract void playSound(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, SoundEffect soundeffect, SoundCategory soundcategory, float f, float f1); - - public abstract void playSound(@Nullable EntityHuman entityhuman, Entity entity, SoundEffect soundeffect, SoundCategory soundcategory, float f, float f1); diff --git a/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch index 8375369aca..276c8a8b48 100644 --- a/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch @@ -10,35 +10,34 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index cea65c1d80a7bd303cf28a6fe2bd73d542a19557..92ceb8bb7d7c47e395dfdcfe6d01f807c048ddc1 100644 +index cea65c1d80a7bd303cf28a6fe2bd73d542a19557..7a4768c32c426ef3cf16904e0f565a7f8fdc753f 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java -@@ -251,6 +251,11 @@ public class EnchantmentManager { +@@ -251,8 +251,8 @@ public class EnchantmentManager { return getEnchantmentLevel(Enchantments.CHANNELING, itemstack) > 0; } -+ // Paper - OBFHELPER -+ public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { -+ Entry<EnumItemSlot, ItemStack> entry = b(enchantment, entityliving); -+ return entry != null ? entry.getValue() : ItemStack.NULL_ITEM; -+ } - @Nullable - public static Entry<EnumItemSlot, ItemStack> b(Enchantment enchantment, EntityLiving entityliving) { +- @Nullable +- public static Entry<EnumItemSlot, ItemStack> b(Enchantment enchantment, EntityLiving entityliving) { ++ public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { Entry<EnumItemSlot, ItemStack> entry = b(enchantment, entityliving); return entry != null ? entry.getValue() : ItemStack.NULL_ITEM; } // Paper - OBFHELPER ++ @Nullable public static Entry<EnumItemSlot, ItemStack> b(Enchantment enchantment, EntityLiving entityliving) { return a(enchantment, entityliving, (itemstack) -> { + return true; + }); diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index e7fb982913f391bafd608c4626086cd9cab7fad7..7f2d8de12473c5413bbfc10ea0947d6a30802645 100644 +index e7fb982913f391bafd608c4626086cd9cab7fad7..86fb9286cfd4e0debc00e034c3a5ff33f0a1fe06 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -249,10 +249,12 @@ public class EntityExperienceOrb extends Entity { } } -+ public int durToXp(int i) { return b(i); } // Paper OBFHELPER ++ public final int durToXp(int i) { return b(i); } // Paper OBFHELPER private int b(int i) { return i / 2; } -+ public int xpToDur(int i) { return c(i); } // Paper OBFHELPER ++ public final int xpToDur(int i) { return c(i); } // Paper OBFHELPER private int c(int i) { return i * 2; } diff --git a/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch b/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch index 166e3a2751..d633931458 100644 --- a/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch +++ b/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch @@ -19,15 +19,11 @@ index 35075ffac394153e28039809e0ed48fe066a6223..6352051ab937d4d365e823a7112e76dc + } } diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java -index 356defd19ebba5b051b7dbdcc21f0139bbdc4a84..69faefbdbf338b38311cd2a5d3183a104ec36f86 100644 +index 356defd19ebba5b051b7dbdcc21f0139bbdc4a84..e2c1de7ab246f1b4c8add06c513afc2eca97d796 100644 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java -@@ -28,10 +28,10 @@ public class EnderDragonBattle { - private int h; - private int i; - private int j; -- private boolean dragonKilled; -+ private boolean dragonKilled; private void setDragonKilled(boolean dragonKilled) { this.dragonKilled = dragonKilled; } // Paper - OBFHELPER +@@ -31,7 +31,7 @@ public class EnderDragonBattle { + private boolean dragonKilled; private boolean previouslyKilled; public UUID dragonUUID; - private boolean n; @@ -41,7 +37,7 @@ index 356defd19ebba5b051b7dbdcc21f0139bbdc4a84..69faefbdbf338b38311cd2a5d3183a10 this.n = true; + // Paper start + setScanForLegacyFight(worldserver.paperConfig.scanForLegacyEnderDragon); -+ if (!scanForLegacyFight()) setDragonKilled(true); ++ if (!scanForLegacyFight()) dragonKilled = true; + // Paper end this.world = worldserver; if (nbttagcompound.hasKeyOfType("DragonKilled", 99)) { diff --git a/Spigot-Server-Patches/0245-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0245-add-more-information-to-Entity.toString.patch index e888f67d61..6012b118f9 100644 --- a/Spigot-Server-Patches/0245-add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/0245-add-more-information-to-Entity.toString.patch @@ -6,7 +6,7 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 2dfc881894753469080a5038c770e126cb19a806..50f9d217494ab2823596523839d5992fc480912d 100644 +index b6a989378d1b6f6d05a52b20b0215feb093688f1..4647f3d38953c941d03f8b68dcc62a74e1cc4bd4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2435,7 +2435,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -14,7 +14,7 @@ index 2dfc881894753469080a5038c770e126cb19a806..50f9d217494ab2823596523839d5992f public String toString() { - return String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getDisplayName().getString(), this.id, this.world == null ? "~NULL~" : this.world.toString(), this.locX(), this.locY(), this.locZ()); -+ return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", new Object[] { this.getClass().getSimpleName(), this.getDisplayName().getString(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.toString(), Double.valueOf(this.locX()), Double.valueOf(this.locY()), Double.valueOf(this.locZ()), getChunkX(), getChunkZ(), this.ticksLived, this.valid, this.dead}); // Paper - add more information ++ return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", new Object[] { this.getClass().getSimpleName(), this.getDisplayName().getString(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.toString(), Double.valueOf(this.locX()), Double.valueOf(this.locY()), Double.valueOf(this.locZ()), chunkX, chunkZ, this.ticksLived, this.valid, this.dead}); // Paper - add more information } public boolean isInvulnerable(DamageSource damagesource) { diff --git a/Spigot-Server-Patches/0247-EnderDragon-Events.patch b/Spigot-Server-Patches/0247-EnderDragon-Events.patch index b02fa9d772..1577dc2d0a 100644 --- a/Spigot-Server-Patches/0247-EnderDragon-Events.patch +++ b/Spigot-Server-Patches/0247-EnderDragon-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] EnderDragon Events diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java -index fbc2ec88f7c71c853c492301986a23dafc8fa7a6..274ebd7dab74ca9bff3d5ea941b7335bdf601db8 100644 +index fbc2ec88f7c71c853c492301986a23dafc8fa7a6..0d860d5dbef667b40a137127fcb73fd6611dcba8 100644 --- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java @@ -71,7 +71,11 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded @@ -20,14 +20,17 @@ index fbc2ec88f7c71c853c492301986a23dafc8fa7a6..274ebd7dab74ca9bff3d5ea941b7335b } } -@@ -82,6 +86,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded +@@ -82,8 +86,8 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded ++this.c; } -+ public void removeAreaEffect() { this.e(); } // Paper - OBFHELPER - @Override - public void e() { +- @Override +- public void e() { ++ public final void removeAreaEffect() { this.e(); } // Paper - OBFHELPER ++ @Override public void e() { if (this.d != null) { + this.d.die(); + this.d = null; diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java index 7c94faa59c2b9887292c6d88fa2e3bb46e3e67c7..ac546ff959510a2d0120c24c90bf13ff83873161 100644 --- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java diff --git a/Spigot-Server-Patches/0251-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0251-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 4198002581..2942a85e48 100644 --- a/Spigot-Server-Patches/0251-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0251-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -19,10 +19,10 @@ index d6a3d882e375ac5a2b6ec8920532db615f4fe4ef..14bb9d843f05058cae5cc64de8149d2c + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 530f204b9bcacdac127a44554e06aabac3897766..26f6b50b202bc13cfb85c2d57580d6fff163e252 100644 +index a970599a2a2faf604d1c79645c27610e39d73d82..66ad97dd4987544f7560b20afc6c72134968287b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -842,6 +842,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -837,6 +837,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // Paper end } } diff --git a/Spigot-Server-Patches/0259-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0259-Ignore-Dead-Entities-in-entityList-iteration.patch index c32c8a5919..d8411a6872 100644 --- a/Spigot-Server-Patches/0259-Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/0259-Ignore-Dead-Entities-in-entityList-iteration.patch @@ -11,7 +11,7 @@ This will ensure that dead entities are skipped from iteration since they shouldn't of been in the list in the first place. diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index b839769ceae8932bb121a0b96fde1e7d129a1f63..5acad8e44f024d3ddf5ef4fd320460ac516e0fb8 100644 +index 9cb2f3b31921870ddba044840e99eb04babe26bb..f0a836db74ad3e20778d3863223bc9a35ff4ad41 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -179,6 +179,7 @@ public class PaperCommand extends Command { @@ -21,9 +21,9 @@ index b839769ceae8932bb121a0b96fde1e7d129a1f63..5acad8e44f024d3ddf5ef4fd320460ac + if (e.shouldBeRemoved) return; // Paper MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); - ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 3ba19f75d24a1539c94f4fed9b8f90aecc918cdc..f7be161c8557ae3848227b1a61e27374770ad243 100644 +index 170218bf175dc836da749f125b4775e9c5e4d5a8..795c9da02089fca71a1d5ff25fcbf1bcee9aed02 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -818,6 +818,7 @@ public class Chunk implements IChunkAccess { @@ -51,7 +51,7 @@ index 3ba19f75d24a1539c94f4fed9b8f90aecc918cdc..f7be161c8557ae3848227b1a61e27374 if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check list.add(t0); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b0338278f3cfecdb30e1d2febf1ff2a04d0cc66d..55f8863f823836065f4de8240bfeb490bd391a55 100644 +index 953b9090da35dc1d40c1d89b2072b84d5b971da2..64a8efb51bef235644bb40836a59e5420fbc0d48 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -195,6 +195,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -83,7 +83,7 @@ index fb1e774f5868da170891de7183b63dc3a89ca935..9cdb6ee9a718ed3464b525a4d79256b5 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b1e51fa8593cd9459058a557f1b506817879bdd4..898b97b52dd1bf8c5aa0b436b01ed0d83681810e 100644 +index 5a434feea44b2564f154914569628aa205451836..f3c10aacb27bbefdf5519043acc7631a049c3f69 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1041,6 +1041,7 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0260-Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/0260-Implement-Expanded-ArmorStand-API.patch index f305f31ce2..7516179ce7 100644 --- a/Spigot-Server-Patches/0260-Implement-Expanded-ArmorStand-API.patch +++ b/Spigot-Server-Patches/0260-Implement-Expanded-ArmorStand-API.patch @@ -8,7 +8,7 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 0232ffba7b18174e0ce44d91285541a9869d07b9..a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0 100644 +index 0232ffba7b18174e0ce44d91285541a9869d07b9..8beb3cb9efbb8953dd24390fe58240f3b9841e79 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -36,7 +36,7 @@ public class EntityArmorStand extends EntityLiving { @@ -16,7 +16,7 @@ index 0232ffba7b18174e0ce44d91285541a9869d07b9..a70b1a17fe884980ef7c3c0a36e567a0 private boolean armorStandInvisible; public long bp; - private int bA; -+ private int bA; public void setDisabledSlots(int i) { bA = i; } public int getDisabledSlots() { return bA; } // Paper - OBFHELPER ++ private int bA; public final void setDisabledSlots(int i) { bA = i; } public final int getDisabledSlots() { return bA; } // Paper - OBFHELPER public Vector3f headPose; public Vector3f bodyPose; public Vector3f leftArmPose; @@ -24,7 +24,7 @@ index 0232ffba7b18174e0ce44d91285541a9869d07b9..a70b1a17fe884980ef7c3c0a36e567a0 return enumitemslot; } -+ public boolean isSlotDisabled(EnumItemSlot slot) { return this.d(slot); } // Paper - OBFHELPER ++ public final boolean isSlotDisabled(EnumItemSlot slot) { return this.d(slot); } // Paper - OBFHELPER private boolean d(EnumItemSlot enumitemslot) { return (this.bA & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); } diff --git a/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch index bff0bb0a3f..9494e8d803 100644 --- a/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index d9e5d71a87140c90b79902887bd2f481f02956dc..afc665bfe9d527ca8d19f3ab9df0900d87f2d3f2 100644 +index 073faedf0c4fcf9e46be17b3a25d6467c2f1f880..fa656a424cebe42f12c3f8ecf82204e9d837c868 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2006,14 +2006,17 @@ public abstract class EntityHuman extends EntityLiving { +@@ -2006,6 +2006,7 @@ public abstract class EntityHuman extends EntityLiving { this.datawatcher.set(EntityHuman.bs, nbttagcompound); } @@ -16,18 +16,8 @@ index d9e5d71a87140c90b79902887bd2f481f02956dc..afc665bfe9d527ca8d19f3ab9df0900d public float eR() { return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D); } - -+ public float getCooledAttackStrength(float adjustTicks) { return getAttackCooldown(adjustTicks); } // Paper - OBFHELPER - public float getAttackCooldown(float f) { - return MathHelper.a(((float) this.aA + f) / this.eR(), 0.0F, 1.0F); - } - -+ public void resetCooldown() { this.ey(); } // Paper - OBFHELPER - public void resetAttackCooldown() { - this.aA = 0; - } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 59b3baaa84c2f1db2d17c677c9eb0299b1494329..7828241b4ab42fd684e62950ddac85b3e43e45be 100644 +index 59b3baaa84c2f1db2d17c677c9eb0299b1494329..585e1b6de2a513a3c360e283ade360ed191cd643 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1977,6 +1977,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -40,11 +30,11 @@ index 59b3baaa84c2f1db2d17c677c9eb0299b1494329..7828241b4ab42fd684e62950ddac85b3 + } + + public float getCooledAttackStrength(float adjustTicks) { -+ return getHandle().getCooledAttackStrength(adjustTicks); ++ return getHandle().getAttackCooldown(adjustTicks); + } + + public void resetCooldown() { -+ getHandle().resetCooldown(); ++ getHandle().resetAttackCooldown(); + } + // Paper end + diff --git a/Spigot-Server-Patches/0286-Improve-death-events.patch b/Spigot-Server-Patches/0286-Improve-death-events.patch index 149c1819fd..58335c9550 100644 --- a/Spigot-Server-Patches/0286-Improve-death-events.patch +++ b/Spigot-Server-Patches/0286-Improve-death-events.patch @@ -15,26 +15,26 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java -index 6281f7900afab3ef1c9ba3c034b91cbfa1900f50..3c2f8407906879c8dca07b538f59f4bbd31b278f 100644 +index 6281f7900afab3ef1c9ba3c034b91cbfa1900f50..7f3401d5d7878e4a0f407e92bf110dbe7c7868a6 100644 --- a/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java @@ -192,6 +192,7 @@ public class CombatTracker { this.h = null; } -+ public void reset() { this.g(); } // Paper - OBFHELPER ++ public final void reset() { this.g(); } // Paper - OBFHELPER public void g() { int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 55f8863f823836065f4de8240bfeb490bd391a55..a9664f03b8b7d2c12565b8c08891c7021aa5482b 100644 +index 64a8efb51bef235644bb40836a59e5420fbc0d48..b54b6c85188f231e768048c60c6cb7096a80df84 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1460,6 +1460,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end -+ public void runKillTrigger(Entity entity, int kills, DamageSource damageSource) { this.a(entity, kills, damageSource); } // Paper - OBFHELPER ++ public final void runKillTrigger(Entity entity, int kills, DamageSource damageSource) { this.a(entity, kills, damageSource); } // Paper - OBFHELPER public void a(Entity entity, int i, DamageSource damagesource) { if (entity instanceof EntityPlayer) { CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource); @@ -42,12 +42,12 @@ index 55f8863f823836065f4de8240bfeb490bd391a55..a9664f03b8b7d2c12565b8c08891c702 this.fallDistance = 0.0F; } -+ public void onKill(EntityLiving entityLiving) { this.a_(entityLiving); } // Paper - OBFHELPER ++ public final void onKill(EntityLiving entityLiving) { this.a_(entityLiving); } // Paper - OBFHELPER public void a_(EntityLiving entityliving) {} protected void k(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index d5c09152acc93b25d626284071599afdbd76b709..51e9f4a6e09474a7489d2872a800308ee3f02e46 100644 +index c3dcccd7ae8267e5db942b46d48ee8b71a680960..6606ef0c168556ce3961f7a98b21c49fcc23e5ca 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -701,7 +701,8 @@ public class EntityArmorStand extends EntityLiving { @@ -347,7 +347,7 @@ index 7b565ddfffd0b9c78392ee115ef9c20ab89a3380..d78b9fd608da691220f1edeff506b36e this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7828241b4ab42fd684e62950ddac85b3e43e45be..139ea71a17a014be2be735395c99c1d5354a4383 100644 +index 585e1b6de2a513a3c360e283ade360ed191cd643..d0fd47a4f8b80ea52b53e6e0071b998e15ac018c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1768,7 +1768,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -368,7 +368,7 @@ index 7828241b4ab42fd684e62950ddac85b3e43e45be..139ea71a17a014be2be735395c99c1d5 public void injectScaledMaxHealth(Collection<AttributeModifiable> collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a86939235a1a5624710744ec3550e6131482c284..59205a848524f281edcab388a9ca40b3e08a9556 100644 +index a86939235a1a5624710744ec3550e6131482c284..1d6977a8e0a2d817311687cb386552fb96840466 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -784,9 +784,16 @@ public class CraftEventFactory { @@ -429,7 +429,7 @@ index a86939235a1a5624710744ec3550e6131482c284..59205a848524f281edcab388a9ca40b3 + double z = event.getEntity().getLocation().getZ(); + net.minecraft.server.SoundEffect soundEffect = org.bukkit.craftbukkit.CraftSound.getSoundEffect(event.getDeathSound()); + net.minecraft.server.SoundCategory soundCategory = net.minecraft.server.SoundCategory.valueOf(event.getDeathSoundCategory().name()); -+ victim.world.sendSoundEffect(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch()); ++ victim.world.playSound(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch()); + } + } + // Paper end diff --git a/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 38f33d38cb..ee3c5f208c 100644 --- a/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java -index b986a8e318733bdae766202bef93d4d25f18b58d..1f74602ff13a9f89c8dc40170353a79a41085649 100644 +index b986a8e318733bdae766202bef93d4d25f18b58d..e1894fe66911adb991989ff5322d2a9e9446fce7 100644 --- a/src/main/java/net/minecraft/server/ArgumentBlock.java +++ b/src/main/java/net/minecraft/server/ArgumentBlock.java @@ -45,7 +45,7 @@ public class ArgumentBlock { @@ -13,7 +13,7 @@ index b986a8e318733bdae766202bef93d4d25f18b58d..1f74602ff13a9f89c8dc40170353a79a private final Map<IBlockState<?>, Comparable<?>> k = Maps.newLinkedHashMap(); // CraftBukkit - stable private final Map<String, String> l = Maps.newHashMap(); - private MinecraftKey m = new MinecraftKey(""); -+ private MinecraftKey m = new MinecraftKey(""); public MinecraftKey getBlockKey() { return this.m; } // Paper - OBFHELPER ++ private MinecraftKey m = new MinecraftKey(""); public final MinecraftKey getBlockKey() { return this.m; } // Paper - OBFHELPER private BlockStateList<Block, IBlockData> n; private IBlockData o; @Nullable @@ -21,13 +21,13 @@ index b986a8e318733bdae766202bef93d4d25f18b58d..1f74602ff13a9f89c8dc40170353a79a return this.p; } -+ public @Nullable MinecraftKey getTagKey() { return d(); } // Paper - OBFHELPER ++ public final @Nullable MinecraftKey getTagKey() { return d(); } // Paper - OBFHELPER @Nullable public MinecraftKey d() { return this.q; } -+ public ArgumentBlock parse(boolean parseTile) throws CommandSyntaxException { return this.a(parseTile); } // Paper - OBFHELPER ++ public final ArgumentBlock parse(boolean parseTile) throws CommandSyntaxException { return this.a(parseTile); } // Paper - OBFHELPER public ArgumentBlock a(boolean flag) throws CommandSyntaxException { this.s = this::l; if (this.i.canRead() && this.i.peek() == '#') { diff --git a/Spigot-Server-Patches/0302-Turtle-API.patch b/Spigot-Server-Patches/0302-Turtle-API.patch index 9e8e556e61..2d624e05db 100644 --- a/Spigot-Server-Patches/0302-Turtle-API.patch +++ b/Spigot-Server-Patches/0302-Turtle-API.patch @@ -5,24 +5,20 @@ Subject: [PATCH] Turtle API diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index dd745894614982fad6277e77b98bed75fc2a2f55..00827c335e9413e986d7f07d0adbcef0d106a553 100644 +index dd745894614982fad6277e77b98bed75fc2a2f55..cf90ebf0614422879f5f5da05c925728f94ef8be 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java -@@ -27,10 +27,12 @@ public class EntityTurtle extends EntityAnimal { - this.G = 1.0F; - } - -+ public final void setHome(BlockPosition pos) { setHomePos(pos); } // Paper - OBFHELPER +@@ -30,8 +30,7 @@ public class EntityTurtle extends EntityAnimal { public void setHomePos(BlockPosition blockposition) { this.datawatcher.set(EntityTurtle.bw, blockposition); } - -+ // TODO Paper: Obf helpers here can prolly be removed? check that no newer patches use them -+ public final BlockPosition getHome() { return this.getHomePos(); } // Paper - OBFHELPER - private BlockPosition getHomePos() { +- private BlockPosition getHomePos() { ++ public BlockPosition getHomePos() { // Paper - public return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); } -@@ -47,31 +49,37 @@ public class EntityTurtle extends EntityAnimal { + +@@ -47,31 +46,37 @@ public class EntityTurtle extends EntityAnimal { return (Boolean) this.datawatcher.get(EntityTurtle.bx); } @@ -61,7 +57,7 @@ index dd745894614982fad6277e77b98bed75fc2a2f55..00827c335e9413e986d7f07d0adbcef0 private void w(boolean flag) { this.datawatcher.set(EntityTurtle.bB, flag); } -@@ -438,14 +446,17 @@ public class EntityTurtle extends EntityAnimal { +@@ -438,14 +443,17 @@ public class EntityTurtle extends EntityAnimal { if (!this.g.isInWater() && this.k()) { if (this.g.bC < 1) { @@ -82,7 +78,7 @@ index dd745894614982fad6277e77b98bed75fc2a2f55..00827c335e9413e986d7f07d0adbcef0 } // CraftBukkit end this.g.setHasEgg(false); -@@ -574,7 +585,7 @@ public class EntityTurtle extends EntityAnimal { +@@ -574,7 +582,7 @@ public class EntityTurtle extends EntityAnimal { @Override public boolean a() { @@ -92,7 +88,7 @@ index dd745894614982fad6277e77b98bed75fc2a2f55..00827c335e9413e986d7f07d0adbcef0 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java -index 123a2c75cad410d079cfb23223ab509e4b4c63f7..8edcf7af65ec8790fe946020a8f74932b4436d16 100644 +index 123a2c75cad410d079cfb23223ab509e4b4c63f7..f2b09a1e66dfbcd943612b5170d20bb284fbcc68 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java @@ -1,6 +1,8 @@ @@ -112,12 +108,12 @@ index 123a2c75cad410d079cfb23223ab509e4b4c63f7..8edcf7af65ec8790fe946020a8f74932 + // Paper start + @Override + public Location getHome() { -+ return MCUtil.toLocation(getHandle().world, getHandle().getHome()); ++ return MCUtil.toLocation(getHandle().world, getHandle().getHomePos()); + } + + @Override + public void setHome(Location location) { -+ getHandle().setHome(MCUtil.toBlockPosition(location)); ++ getHandle().setHomePos(MCUtil.toBlockPosition(location)); + } + + @Override diff --git a/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch index dac4e7081e..d7242c3144 100644 --- a/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch @@ -130,7 +130,7 @@ index 0000000000000000000000000000000000000000..fdd8708f974700c7cde6e436c2f189d9 + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..7d65ce89622b00a121ce0353f697b07d9e99d0ce 100644 +index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..d1f62864fd2785702a770397eee7831dd9cb2cdb 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -25,6 +25,7 @@ import org.bukkit.craftbukkit.util.Waitable; @@ -194,7 +194,7 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..7d65ce89622b00a121ce0353f697b07d + return; + } + -+ this.networkManager.setSpoofedRemoteAddress(new java.net.InetSocketAddress(com.destroystokyo.paper.proxy.VelocityProxy.readAddress(buf), ((java.net.InetSocketAddress) this.networkManager.getSocketAddress()).getPort())); ++ this.networkManager.socketAddress = new java.net.InetSocketAddress(com.destroystokyo.paper.proxy.VelocityProxy.readAddress(buf), ((java.net.InetSocketAddress) this.networkManager.getSocketAddress()).getPort()); + + this.setGameProfile(com.destroystokyo.paper.proxy.VelocityProxy.createProfile(buf)); + @@ -213,19 +213,6 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..7d65ce89622b00a121ce0353f697b07d this.disconnect(new ChatMessage("multiplayer.disconnect.unexpected_query_response")); } -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 8cb29ddc0d5a5951ea35e1a16c023efb9b0be42d..2916119507ec5ecd9266569b0003d0504a79f6c4 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -44,7 +44,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { - private final EnumProtocolDirection h; - private final Queue<NetworkManager.QueuedPacket> packetQueue = Queues.newConcurrentLinkedQueue(); - public Channel channel; -- public SocketAddress socketAddress; -+ public SocketAddress socketAddress; public void setSpoofedRemoteAddress(SocketAddress address) { this.socketAddress = address; } // Paper - OBFHELPER - // Spigot Start - public java.util.UUID spoofedUUID; - public com.mojang.authlib.properties.Property[] spoofedProfile; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java index 7e116d83a62ef42e241ee9e05fdd7ecb30a2ed95..31e7fb56206a522a335f5e78afd09324d1c38864 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java diff --git a/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch index 560f5426f2..1813551648 100644 --- a/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a9664f03b8b7d2c12565b8c08891c7021aa5482b..1a677783baa0b9a3dcfcd84caccba61d76fad2fb 100644 +index b54b6c85188f231e768048c60c6cb7096a80df84..3c2cfca679e88aa07be6c747822317ecb28f091d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2262,6 +2262,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } -+ public int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER ++ public final int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER public int bD() { return 300; } diff --git a/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch b/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch index b1b358f714..65f547ca92 100644 --- a/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch @@ -4,21 +4,8 @@ Date: Sun, 7 Oct 2018 04:29:59 -0500 Subject: [PATCH] Add more Zombie API -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index e0ecdb8f87ec82b97a056c8f6d91d6a86f37bd34..5e9a05dfe822c42b83da84a154fe881d57ac1689 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1418,6 +1418,8 @@ public abstract class EntityInsentient extends EntityLiving { - this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3)); - } - -+ public boolean isArmsRaisedZombie() { return (this.datawatcher.get(EntityInsentient.b) & 4) != 0; } // Paper - OBFHELPER -+ public void setArmsRaisedZombie(boolean flag) { this.setAggressive(flag); } // Paper - OBFHELPER - public void setAggressive(boolean flag) { - byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b); - diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index bb7f62fa52b758ed83db7def9053b79da3d97dcd..c9f212b586662856f1503bb0ca8d91900f2e9c5f 100644 +index bb7f62fa52b758ed83db7def9053b79da3d97dcd..641d0b462d326dc9b5f6ce2d7f620e428dc25539 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -33,6 +33,7 @@ public class EntityZombie extends EntityMonster { @@ -29,15 +16,7 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..c9f212b586662856f1503bb0ca8d9190 public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) { super(entitytypes, world); -@@ -74,6 +75,7 @@ public class EntityZombie extends EntityMonster { - this.getDataWatcher().register(EntityZombie.DROWN_CONVERTING, false); - } - -+ public boolean isDrowning() { return isDrownConverting(); } // Paper - OBFHELPER - public boolean isDrownConverting() { - return (Boolean) this.getDataWatcher().get(EntityZombie.DROWN_CONVERTING); - } -@@ -206,6 +208,13 @@ public class EntityZombie extends EntityMonster { +@@ -206,6 +207,13 @@ public class EntityZombie extends EntityMonster { this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true); } @@ -51,7 +30,7 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..c9f212b586662856f1503bb0ca8d9190 protected void eQ() { this.c(EntityTypes.DROWNED); if (!this.isSilent()) { -@@ -225,10 +234,17 @@ public class EntityZombie extends EntityMonster { +@@ -225,10 +233,17 @@ public class EntityZombie extends EntityMonster { } @@ -70,7 +49,7 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..c9f212b586662856f1503bb0ca8d9190 @Override public boolean damageEntity(DamageSource damagesource, float f) { if (super.damageEntity(damagesource, f)) { -@@ -348,6 +364,7 @@ public class EntityZombie extends EntityMonster { +@@ -348,6 +363,7 @@ public class EntityZombie extends EntityMonster { nbttagcompound.setBoolean("CanBreakDoors", this.eV()); nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bA : -1); nbttagcompound.setInt("DrownedConversionTime", this.isDrownConverting() ? this.drownedConversionTime : -1); @@ -78,7 +57,7 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..c9f212b586662856f1503bb0ca8d9190 } @Override -@@ -362,7 +379,11 @@ public class EntityZombie extends EntityMonster { +@@ -362,7 +378,11 @@ public class EntityZombie extends EntityMonster { if (nbttagcompound.hasKeyOfType("DrownedConversionTime", 99) && nbttagcompound.getInt("DrownedConversionTime") > -1) { this.startDrownedConversion(nbttagcompound.getInt("DrownedConversionTime")); } @@ -92,7 +71,7 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..c9f212b586662856f1503bb0ca8d9190 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -index 0429cf020e462d3655bf1159ec857cad33544b71..c4320dbb67059be9456b0eef700a5f3e83c7c75b 100644 +index 0429cf020e462d3655bf1159ec857cad33544b71..30004ea3a36029827e90e587017a1dad2ede4435 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java @@ -80,4 +80,41 @@ public class CraftZombie extends CraftMonster implements Zombie { @@ -103,7 +82,7 @@ index 0429cf020e462d3655bf1159ec857cad33544b71..c4320dbb67059be9456b0eef700a5f3e + // Paper start + @Override + public boolean isDrowning() { -+ return getHandle().isDrowning(); ++ return getHandle().isDrownConverting(); + } + + @Override @@ -123,12 +102,12 @@ index 0429cf020e462d3655bf1159ec857cad33544b71..c4320dbb67059be9456b0eef700a5f3e + + @Override + public boolean isArmsRaised() { -+ return getHandle().isArmsRaisedZombie(); ++ return getHandle().isAggressive(); + } + + @Override + public void setArmsRaised(final boolean raised) { -+ getHandle().setArmsRaisedZombie(raised); ++ getHandle().setAggressive(raised); + } + + @Override diff --git a/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch index 21616b9320..c974b87209 100644 --- a/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch +++ b/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,12 +12,12 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 96ce5f7f5a31df8c1e73eb1afc2d15f7ac716c06..ff602df37c0a621cfe6ebce13ae6cc777378e591 100644 +index f34b029e23b273b2243e8fbb8459d6f5e33e722c..4c19e3f6176a31f5447e72f5750e3eab61bc261e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2022,6 +2022,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { - getHandle().resetCooldown(); + getHandle().resetAttackCooldown(); } + + @Override diff --git a/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch b/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch index a954bfffb5..cd037bb19d 100644 --- a/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch +++ b/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Set Zombie last tick at start of drowning process Fixes GH-1887 diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index c9f212b586662856f1503bb0ca8d91900f2e9c5f..05d19850538b7d853b270d952739d5d1b151690c 100644 +index 641d0b462d326dc9b5f6ce2d7f620e428dc25539..e436b0f4691154e200b9a5c28566074ff8bc0df9 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -162,6 +162,7 @@ public class EntityZombie extends EntityMonster { +@@ -161,6 +161,7 @@ public class EntityZombie extends EntityMonster { ++this.bA; if (this.bA >= 600) { this.startDrownedConversion(300); diff --git a/Spigot-Server-Patches/0351-Optimize-Captured-TileEntity-Lookup.patch b/Spigot-Server-Patches/0351-Optimize-Captured-TileEntity-Lookup.patch index 04a4494da7..14325c5f73 100644 --- a/Spigot-Server-Patches/0351-Optimize-Captured-TileEntity-Lookup.patch +++ b/Spigot-Server-Patches/0351-Optimize-Captured-TileEntity-Lookup.patch @@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to just do a get call since the value can never be null. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 722db2c45da211ef376fff4aa17964009b2e53e2..40f778ceefdb97f4702edba6f78c0569a414cf80 100644 +index a520b18f15a9f4b4d65ed185894c3741daa65f7f..cad22702ad981f57fdd8760ffd6b0d0218732325 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -945,12 +945,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -940,12 +940,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return null; } else { // CraftBukkit start diff --git a/Spigot-Server-Patches/0357-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch b/Spigot-Server-Patches/0357-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch index 97b04708fa..4ffe072665 100644 --- a/Spigot-Server-Patches/0357-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch +++ b/Spigot-Server-Patches/0357-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch @@ -16,10 +16,10 @@ handling that should have been handled synchronously will be handled synchronously when the server gets shut down. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a97e6bc15dd07594379475e5dec0fc957ca1314a..b9e047643e1c3f84f26d936fcb067f607018ef34 100644 +index 0ec47d6ae36570ce1bdd7361fde223c13672f02d..3cef06734e2c6d9b49dd6307f285d00127b66233 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2065,7 +2065,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -2064,7 +2064,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas // CraftBukkit start @Override public boolean isMainThread() { diff --git a/Spigot-Server-Patches/0359-Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/0359-Duplicate-UUID-Resolve-Option.patch index 3f0095d205..8fbcf316ac 100644 --- a/Spigot-Server-Patches/0359-Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/0359-Duplicate-UUID-Resolve-Option.patch @@ -81,7 +81,7 @@ index a73b88d51608ce94f6e4c9013c8c4de97523fe42..6e29e3294d0661cc35d53b4201d980a2 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index f7be161c8557ae3848227b1a61e27374770ad243..141f2e8975b01fc2a5e7743955894f100c3062a2 100644 +index 795c9da02089fca71a1d5ff25fcbf1bcee9aed02..81b7b6c110dfce7185ab59d41d7ef7d648522787 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -499,6 +499,7 @@ public class Chunk implements IChunkAccess { @@ -93,14 +93,14 @@ index f7be161c8557ae3848227b1a61e27374770ad243..141f2e8975b01fc2a5e7743955894f10 int k = MathHelper.floor(entity.locY() / 16.0D); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4502ea222d98872a4c33714a8c3149c6d42dee46..5a897b844d676309230fee83c0250a8a2600a581 100644 +index 84df0d90f19f7b541198a9b935a1491e41c015f3..668b720f17760de7d893bcdd95661f13601fcbd3 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2682,6 +2682,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke }); } -+ public void setUUID(UUID uuid) { a_(uuid); } // Paper - OBFHELPER ++ public final void setUUID(UUID uuid) { a_(uuid); } // Paper - OBFHELPER public void a_(UUID uuid) { this.uniqueID = uuid; this.al = this.uniqueID.toString(); diff --git a/Spigot-Server-Patches/0365-Chunk-debug-command.patch b/Spigot-Server-Patches/0365-Chunk-debug-command.patch index b5c50b5133..34d34a4a51 100644 --- a/Spigot-Server-Patches/0365-Chunk-debug-command.patch +++ b/Spigot-Server-Patches/0365-Chunk-debug-command.patch @@ -32,7 +32,7 @@ https://bugs.mojang.com/browse/MC-141484?focusedCommentId=528273&page=com.atlass https://bugs.mojang.com/browse/MC-141484?focusedCommentId=528577&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-528577 diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 5acad8e44f024d3ddf5ef4fd320460ac516e0fb8..af810987846efcd2bffbd23c31481b2d31c168dd 100644 +index f0a836db74ad3e20778d3863223bc9a35ff4ad41..9ead9b1ea1fafaa3d684c17efbae747386b7c587 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -28,14 +28,14 @@ public class PaperCommand extends Command { @@ -198,7 +198,7 @@ index 6921def2dc8dd7f2b8ba9d46ab697a9f9b62cf4e..9f4c79629c981d496b96cf8a7a4c8e05 public final ChunkGenerator chunkGenerator; private final WorldServer world; diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..99801463d958540b5148e55c1e44f90a1078c371 100644 +index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..baa0f67400d9f7d36900010c362fe4ef4186573f 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -5,7 +5,13 @@ import com.destroystokyo.paper.profile.CraftPlayerProfile; @@ -300,7 +300,7 @@ index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..99801463d958540b5148e55c1e44f90a + WorldServer world = ((org.bukkit.craftbukkit.CraftWorld)bukkitWorld).getHandle(); + PlayerChunkMap chunkMap = world.getChunkProvider().playerChunkMap; + Long2ObjectLinkedOpenHashMap<PlayerChunk> visibleChunks = chunkMap.visibleChunks; -+ ChunkMapDistance chunkMapDistance = chunkMap.getChunkMapDistanceManager(); ++ ChunkMapDistance chunkMapDistance = chunkMap.chunkDistanceManager; + List<PlayerChunk> allChunks = new ArrayList<>(visibleChunks.values()); + List<EntityPlayer> players = world.players; + @@ -412,7 +412,7 @@ index 5efd611859648ed3c1bcda70728ea6106bd4bf4c..d806b6acbcfbf141f4c1436bd5a163fb private int dirtyCount; private int r; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 936be3fd8954933ac218f62a172df6878d128ec9..684d84e3c5caf1a0c816895c4930d056b2ba8be5 100644 +index 936be3fd8954933ac218f62a172df6878d128ec9..ee062b05d0de2c434ca1199e9614824a3a23e73b 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -59,7 +59,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -424,15 +424,6 @@ index 936be3fd8954933ac218f62a172df6878d128ec9..684d84e3c5caf1a0c816895c4930d056 public final WorldServer world; private final LightEngineThreaded lightEngine; private final IAsyncTaskHandler<Runnable> executor; -@@ -72,7 +72,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxWorldGen; - private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain; - public final WorldLoadListener worldLoadListener; -- public final PlayerChunkMap.a chunkDistanceManager; -+ public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER - private final AtomicInteger u; - private final DefinedStructureManager definedStructureManager; - private final File w; diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java index 77bb6b092a0763ff27f90f0401a8a81b15aebb8c..7a8397815a5b7f79f3e3a0348aeedf63fe879f8f 100644 --- a/src/main/java/net/minecraft/server/Ticket.java diff --git a/Spigot-Server-Patches/0367-Fix-World-isChunkGenerated-calls.patch b/Spigot-Server-Patches/0367-Fix-World-isChunkGenerated-calls.patch index 6378e0ab03..d854627fb0 100644 --- a/Spigot-Server-Patches/0367-Fix-World-isChunkGenerated-calls.patch +++ b/Spigot-Server-Patches/0367-Fix-World-isChunkGenerated-calls.patch @@ -132,7 +132,7 @@ index d806b6acbcfbf141f4c1436bd5a163fbf11bf4e6..3b0d13d319fe1d274ab657c7c87e5a2d public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 684d84e3c5caf1a0c816895c4930d056b2ba8be5..6dda11ffc022aa9bc7481506811a710a184f5e78 100644 +index ee062b05d0de2c434ca1199e9614824a3a23e73b..dbfd1f4d2156a99ff11bc295d3751eadc87fd40c 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -938,12 +938,61 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -200,7 +200,7 @@ index 684d84e3c5caf1a0c816895c4930d056b2ba8be5..6dda11ffc022aa9bc7481506811a710a // Spigot start return isOutsideOfRange(chunkcoordintpair, false); diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..e1730709fff5dfee68621d0aaed70a00bab97948 100644 +index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..4f1a6954ea880857352003982627545dd3483ad2 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -36,6 +36,30 @@ public class RegionFile implements AutoCloseable { @@ -218,7 +218,7 @@ index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..e1730709fff5dfee68621d0aaed70a00 + // We've used an invalid region file. + throw new IllegalStateException("RegionFile is closed"); + } -+ this.statuses[this.getChunkLocation(new ChunkCoordIntPair(x, z))] = status; ++ this.statuses[getChunkLocation(x, z)] = status; + } + + public ChunkStatus getStatusIfCached(int x, int z) { @@ -226,7 +226,7 @@ index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..e1730709fff5dfee68621d0aaed70a00 + // We've used an invalid region file. + throw new IllegalStateException("RegionFile is closed"); + } -+ final int location = this.getChunkLocation(new ChunkCoordIntPair(x, z)); ++ final int location = getChunkLocation(x, z); + return this.statuses[location]; + } + // Paper end @@ -238,7 +238,7 @@ index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..e1730709fff5dfee68621d0aaed70a00 return this.getOffset(chunkcoordintpair) != 0; } -+ private final int getChunkLocation(ChunkCoordIntPair chunkcoordintpair) { return this.g(chunkcoordintpair); } // Paper - OBFHELPER ++ private static int getChunkLocation(int x, int z) { return (x & 31) + (z & 31) * 32; } // Paper - OBFHELPER - sort of, mirror of logic below private static int g(ChunkCoordIntPair chunkcoordintpair) { return chunkcoordintpair.j() + chunkcoordintpair.k() * 32; } @@ -279,7 +279,7 @@ index 02bd568af727633a6e834d5328683a9ff67b9dd7..341689ac996164b7b53e095495b92b6e throwable = throwable1; throw throwable1; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b5621b8456fbd3c5e94a9b9ec9b4be0068962674..1970751f89dcba3055c31caa2c6425fa4b13bc28 100644 +index c99932bc38ac2bb0bd82c694a76b844efcdbdd52..2f10a1c6f4f7b31c8054f3cd72947b2eb3a6ef24 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -19,6 +19,7 @@ import java.util.Objects; diff --git a/Spigot-Server-Patches/0371-Anti-Xray.patch b/Spigot-Server-Patches/0371-Anti-Xray.patch index abfd2eebd8..6b00aae71e 100644 --- a/Spigot-Server-Patches/0371-Anti-Xray.patch +++ b/Spigot-Server-Patches/0371-Anti-Xray.patch @@ -988,7 +988,7 @@ index 0000000000000000000000000000000000000000..333763936897befda5bb6c077944d266 + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8a316f732644886c476921c69838e9cb8b93a5b5..8fa440b313b414a79118089b7481dee9f7ba69a8 100644 +index 0073f8abe4001a4ea0fda97a1607d6317cbd3485..67fa80d677eb657ce0c44500f5dacedda8e74588 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -423,7 +423,7 @@ public class Chunk implements IChunkAccess { @@ -1023,7 +1023,7 @@ index 208a8ef3aaa4b33bfe2db2569a3588a332ab5686..be3c7a8697c540d03a143b9306311a18 protochunk.a(biomestorage); object = protochunk; diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index bd2290a4d4ec314b7afdb1f63d711f80803153cd..b168ad8021a5387e05023cd03ec1a69c8a86a233 100644 +index bd2290a4d4ec314b7afdb1f63d711f80803153cd..cb72be356a2f28cfebc0cb4a822fa21d22ca5064 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -1,6 +1,7 @@ @@ -1068,9 +1068,9 @@ index bd2290a4d4ec314b7afdb1f63d711f80803153cd..b168ad8021a5387e05023cd03ec1a69c - public void writeChunkSection(PacketDataSerializer packetDataSerializer) { this.b(packetDataSerializer); } // Paper - OBFHELPER - public void b(PacketDataSerializer packetdataserializer) { + // Paper start - Anti-Xray - Add chunk packet info -+ @Deprecated public void writeChunkSection(PacketDataSerializer packetDataSerializer) { this.b(packetDataSerializer); } // OBFHELPER // Notice for updates: Please make sure this method isn't used anywhere -+ @Deprecated public void b(PacketDataSerializer packetdataserializer) { this.writeChunkSection(packetdataserializer, null); } // Notice for updates: Please make sure this method isn't used anywhere -+ public void writeChunkSection(PacketDataSerializer packetDataSerializer, ChunkPacketInfo<IBlockData> chunkPacketInfo) { this.b(packetDataSerializer, chunkPacketInfo); } // OBFHELPER ++ @Deprecated public final void writeChunkSection(PacketDataSerializer packetDataSerializer) { this.b(packetDataSerializer); } // OBFHELPER // Notice for updates: Please make sure this method isn't used anywhere ++ @Deprecated public final void b(PacketDataSerializer packetdataserializer) { this.writeChunkSection(packetdataserializer, null); } // Notice for updates: Please make sure this method isn't used anywhere ++ public final void writeChunkSection(PacketDataSerializer packetDataSerializer, ChunkPacketInfo<IBlockData> chunkPacketInfo) { this.b(packetDataSerializer, chunkPacketInfo); } // OBFHELPER + public void b(PacketDataSerializer packetdataserializer, ChunkPacketInfo<IBlockData> chunkPacketInfo) { + // Paper end packetdataserializer.writeShort(this.nonEmptyBlockCount); @@ -1080,7 +1080,7 @@ index bd2290a4d4ec314b7afdb1f63d711f80803153cd..b168ad8021a5387e05023cd03ec1a69c public int j() { diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 4d397dc5a5127d5e9eb1ba5675239b022a1544c0..900b551f6f76862443b09c1e76ad596eda5655f4 100644 +index f4c1b8d32b239c44e70d3fa6d094b74955f75339..ed77117630d54b7ad81f633110c7d2a7c59288e9 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -1,6 +1,7 @@ @@ -1096,7 +1096,7 @@ index 4d397dc5a5127d5e9eb1ba5675239b022a1544c0..900b551f6f76862443b09c1e76ad596e private final Function<T, NBTTagCompound> f; private final T g; + private final T[] predefinedObjects; // Paper - Anti-Xray - Add predefined objects - protected DataBits a; protected DataBits getDataBits() { return this.a; } // Paper - OBFHELPER + protected DataBits a; public final DataBits getDataBits() { return this.a; } // Paper - OBFHELPER private DataPalette<T> h; private DataPalette<T> getDataPalette() { return this.h; } // Paper - OBFHELPER private int i; private int getBitsPerObject() { return this.i; } // Paper - OBFHELPER @@ -42,14 +44,47 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> { @@ -1292,7 +1292,7 @@ index 900f16efde29ace3f073b1cbc01df8bafc360a9a..8335d003369d94cbad17ec6fce76d6f9 } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 39d89d6209123ae2146ae292009cad44c25f490a..24f3e8a6866bb416f04aca342514fa5dd3d314c8 100644 +index 17c656a6cbbefea211414e8685d0f6b6aacb61c2..a21c9a0c3e25421510461b2e9fcc1ab69f731f61 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -608,7 +608,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -1372,7 +1372,7 @@ index ee8df274d43be753887fb77e4203e2ee30ea02b3..9f91c02b444874e690eacb0cfa0c8101 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a56604127e603721838cd9c322952cd64bca54e0..d3ab8299e759a30a04ec0d575a4b40a78ca1558d 100644 +index 9d79dfb0e31302ecb0fe5c43a9a56040861bba84..82faa08d5750dad6045ec3da9a52e90bc0b1bdb6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -2,6 +2,8 @@ package net.minecraft.server; diff --git a/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch index e9235089c6..2416982309 100644 --- a/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch @@ -161,7 +161,7 @@ index 944fd203e9f39d6c6fc9e270940c76c98067273a..a27dc38d1a29ed1d63d2f44b7984c2b6 public static Timing getTickList(WorldServer worldserver, String timingsType) { diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index af810987846efcd2bffbd23c31481b2d31c168dd..331493a172f58e71b464d635efdba461082bd27d 100644 +index 9ead9b1ea1fafaa3d684c17efbae747386b7c587..9b8b49be032d7ceebcea8d7b98f999ed7166d0a1 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -1,5 +1,6 @@ @@ -2756,7 +2756,7 @@ index be3c7a8697c540d03a143b9306311a184474857f..4d6e8f987233ca6c5f53d004031c022b nbttagcompound1.set("PostProcessing", a(ichunkaccess.l())); diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index 0939e015aad7d3fcc7908afcabee0100c4deee40..36c26512297430cf072b549614990b064db94152 100644 +index 0939e015aad7d3fcc7908afcabee0100c4deee40..7948b915bf1adaea49fb5c78284ce6d4a8e7f6df 100644 --- a/src/main/java/net/minecraft/server/ChunkStatus.java +++ b/src/main/java/net/minecraft/server/ChunkStatus.java @@ -159,6 +159,7 @@ public class ChunkStatus { @@ -2771,15 +2771,24 @@ index 0939e015aad7d3fcc7908afcabee0100c4deee40..36c26512297430cf072b549614990b06 this.t = chunkstatus == null ? 0 : chunkstatus.c() + 1; } -+ public int getStatusIndex() { return c(); } // Paper - OBFHELPER ++ public final int getStatusIndex() { return c(); } // Paper - OBFHELPER public int c() { return this.t; } +@@ -182,7 +184,7 @@ public class ChunkStatus { + return this.s; + } + +- public ChunkStatus getPreviousStatus() { return this.e(); } // Paper - OBFHELPER ++ public final ChunkStatus getPreviousStatus() { return this.e(); } // Paper - OBFHELPER + public ChunkStatus e() { + return this.u; + } @@ -195,6 +197,7 @@ public class ChunkStatus { return this.w.doWork(this, worldserver, definedstructuremanager, lightenginethreaded, function, ichunkaccess); } -+ public int getNeighborRadius() { return this.f(); } // Paper - OBFHELPER ++ public final int getNeighborRadius() { return this.f(); } // Paper - OBFHELPER public int f() { return this.x; } @@ -2787,12 +2796,12 @@ index 0939e015aad7d3fcc7908afcabee0100c4deee40..36c26512297430cf072b549614990b06 return this.z; } -+ public boolean isAtLeastStatus(ChunkStatus chunkstatus) { return b(chunkstatus); } // Paper - OBFHELPER ++ public final boolean isAtLeastStatus(ChunkStatus chunkstatus) { return b(chunkstatus); } // Paper - OBFHELPER public boolean b(ChunkStatus chunkstatus) { return this.c() >= chunkstatus.c(); } diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index 1ba26ee10f338edbec0f580bb55d083a3d6d2284..63fdae15ccbef0c39718b320dbd096794bcfa3b4 100644 +index 4c65bf1f692b20d5c876a2840d5d9f76b67c6d2d..c5259673ccddd6326d185370f8123aa936aae755 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -91,7 +91,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R @@ -2915,7 +2924,7 @@ index fa03834dacacf7ae6a326c88007256a261153c27..c0d2df8ef3b4d0224ede2b7a4ef4e3f9 } } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 99801463d958540b5148e55c1e44f90a1078c371..9615c4d324e42f7f91a7e60b6151c16d20e9c739 100644 +index baa0f67400d9f7d36900010c362fe4ef4186573f..8eb93f33da264cd5182d1399e40e1f63d83a3e98 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -696,4 +696,9 @@ public final class MCUtil { @@ -2941,7 +2950,7 @@ index 52476513405a28b4125170650ff53a07deba0ec2..79ac93c5f2cad09a5dd0450b55c70941 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataConverterRegistry.a(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4ffd9c1d7b4fc2f42fa157b2235365cab41e295f..0633944364179ffb9b9fdd0400d82fd5b2ab3892 100644 +index 7291946fdd283685b5eedf3503fb4c52544acc7b..15c35aacd8a1ef4c9d74df06c1689b1fb0e2bf3f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -807,7 +807,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -3046,7 +3055,7 @@ index 3e1c1253ad5e2fa68fd8a0bac100c2e7536ea080..b6868b6b23a09e8e0dfe7a5e378dca22 completablefuture = (CompletableFuture) this.statusFutures.get(i); if (completablefuture != null) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..2021c77c2cc832927de642d3542c385050193651 100644 +index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060b42e7abc 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -64,7 +64,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -3060,7 +3069,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..2021c77c2cc832927de642d3542c3850 private boolean updatingChunksModified; @@ -74,7 +74,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER + public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; - private final DefinedStructureManager definedStructureManager; + public final DefinedStructureManager definedStructureManager; // Paper - private -> public @@ -3496,7 +3505,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..2021c77c2cc832927de642d3542c3850 return this.m; } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 03ee383bfc3114a3be82d767d376bbf5f41bc5a7..0cba23c2c0880970dbb930caecb91bbc022cb52f 100644 +index ce9d797b1233efd8f3bdee012a7734f7bfe4b5fe..6dfdbd45e0f533ebca5138c071cc349cf8827cfd 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -544,6 +544,13 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -3514,7 +3523,7 @@ index 03ee383bfc3114a3be82d767d376bbf5f41bc5a7..0cba23c2c0880970dbb930caecb91bbc StringReader stringreader = new StringReader(packetplayintabcomplete.c()); diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index e1730709fff5dfee68621d0aaed70a00bab97948..93797395c3a710d228bd790771ac18b4baa3b1e2 100644 +index 4f1a6954ea880857352003982627545dd3483ad2..939b51826681a7648ad3ea2512c20082193e6a01 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -36,6 +36,8 @@ public class RegionFile implements AutoCloseable { @@ -4006,7 +4015,7 @@ index f1b2ef8836d31ce0dd5502357d6af655eabd9006..d88e7e24d5fdd8caa075fe2aaf22f11f } public void removeTicketsForSpawn(int radiusInBlocks, BlockPosition spawn) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1970751f89dcba3055c31caa2c6425fa4b13bc28..45999be11cbbd08155ea882b98380178efe514fb 100644 +index 2f10a1c6f4f7b31c8054f3cd72947b2eb3a6ef24..893406dfa074e1551513357a1b820de48076dfe4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -74,6 +74,7 @@ import net.minecraft.server.GroupDataEntity; diff --git a/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch b/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch index bc5712f15b..af28573983 100644 --- a/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch @@ -8,7 +8,7 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 70d3b429bfe08f1d2e5a3ac8368d8221770d5307..092e49ae11ff735cf0179de8e0aaa73f7842e372 100644 +index 6dfdbd45e0f533ebca5138c071cc349cf8827cfd..c555c5426281980bb8a5b3cf78f4203566a05bfb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1015,7 +1015,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -21,7 +21,7 @@ index 70d3b429bfe08f1d2e5a3ac8368d8221770d5307..092e49ae11ff735cf0179de8e0aaa73f return; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d3ab8299e759a30a04ec0d575a4b40a78ca1558d..8913e915b91b85a1f3efdc97809466f7933511d4 100644 +index 82faa08d5750dad6045ec3da9a52e90bc0b1bdb6..14ca9210e0501aff8e4559ddde9fd7d5db4c63c7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -104,6 +104,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -38,7 +38,7 @@ index d3ab8299e759a30a04ec0d575a4b40a78ca1558d..8913e915b91b85a1f3efdc97809466f7 protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper -@@ -1039,14 +1046,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1034,14 +1041,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } public boolean p(BlockPosition blockposition) { @@ -55,7 +55,7 @@ index d3ab8299e759a30a04ec0d575a4b40a78ca1558d..8913e915b91b85a1f3efdc97809466f7 return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a((IBlockAccess) this, blockposition, entity, enumdirection); } -@@ -1167,7 +1174,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1162,7 +1169,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { diff --git a/Spigot-Server-Patches/0379-Reduce-sync-loads.patch b/Spigot-Server-Patches/0379-Reduce-sync-loads.patch index 88c6e75440..8b961aa577 100644 --- a/Spigot-Server-Patches/0379-Reduce-sync-loads.patch +++ b/Spigot-Server-Patches/0379-Reduce-sync-loads.patch @@ -11,7 +11,7 @@ it must be enabled by setting the startup flag -Dpaper.debug-sync-loads=true To get a debug log for sync loads, the command is /paper syncloadinfo diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 331493a172f58e71b464d635efdba461082bd27d..182b440ba4802d199b8e44f7779b3401ace495d5 100644 +index 9b8b49be032d7ceebcea8d7b98f999ed7166d0a1..f7d98a5ba54d041eef10b04f821e0958ad898b0a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -1,10 +1,14 @@ @@ -298,10 +298,10 @@ index edd901bb53385fa3d189a0057d57f98bf8b7115c..707db4febac59a4d09d6420ea2add469 this.serverThreadQueue.awaitTasks(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8913e915b91b85a1f3efdc97809466f7933511d4..4c717afe243997e153a8ef5f703d8409bf126222 100644 +index 14ca9210e0501aff8e4559ddde9fd7d5db4c63c7..57f544eb6b2e3362b62e8541642bfc88419ab596 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1107,7 +1107,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1102,7 +1102,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 <= j; ++i1) { for (int j1 = k; j1 <= l; ++j1) { @@ -310,7 +310,7 @@ index 8913e915b91b85a1f3efdc97809466f7933511d4..4c717afe243997e153a8ef5f703d8409 if (chunk != null) { chunk.a(entity, axisalignedbb, list, predicate); -@@ -1128,7 +1128,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1123,7 +1123,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { @@ -319,7 +319,7 @@ index 8913e915b91b85a1f3efdc97809466f7933511d4..4c717afe243997e153a8ef5f703d8409 if (chunk != null) { chunk.a(entitytypes, axisalignedbb, list, predicate); -@@ -1151,7 +1151,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1146,7 +1146,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { diff --git a/Spigot-Server-Patches/0399-Optimize-Hoppers.patch b/Spigot-Server-Patches/0399-Optimize-Hoppers.patch index f65a9c19df..b7851eecda 100644 --- a/Spigot-Server-Patches/0399-Optimize-Hoppers.patch +++ b/Spigot-Server-Patches/0399-Optimize-Hoppers.patch @@ -73,7 +73,7 @@ index dea478d4790be0c0d6e14cd7673d161abfc46e08..d1e4ee64aa395b38cad22f316308c468 itemstack.d(this.D()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 41c4b2df34faa95afdd2d35b0bac021d77c56884..67ab908879146c83bf591ae9956d0c038fb5c5d9 100644 +index 6e67b4e1afd1425a99de8b27a9072cde0bbedf69..529721fb2f7da134957e2fee437dc159d40d1747 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1247,6 +1247,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -459,7 +459,7 @@ index a0a3adac3e2bc939b1809c5587929f674f4318a5..20df9bd21d0e4d2579d05d79672da2eb if (!list.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java -index e00ae999194f96fb4de556518abe495432a43a62..55b1e5da2b5128e479dbdf14eb1da692af1880fe 100644 +index 006f8bace83ba1e540399b3f05952fa5edb0681f..badf8e136ec3e45870c29e154cd4a855546c7530 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java @@ -77,12 +77,19 @@ public abstract class TileEntityLootable extends TileEntityContainer { @@ -485,10 +485,10 @@ index e00ae999194f96fb4de556518abe495432a43a62..55b1e5da2b5128e479dbdf14eb1da692 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4c717afe243997e153a8ef5f703d8409bf126222..a9aad7045cf67cca765500ebad4db9af3cf17262 100644 +index 57f544eb6b2e3362b62e8541642bfc88419ab596..325d7a313cfab72978f5c8fada1af6f19cdab239 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1139,8 +1139,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1134,8 +1134,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return list; } diff --git a/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch index e843e15bec..de9d60cbcf 100644 --- a/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch +++ b/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch @@ -14,9 +14,18 @@ Adds flying monsters to control ghast and phantoms Adds villagers as separate config diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 5a897b844d676309230fee83c0250a8a2600a581..067765981afda04959313fc5371e6da9d7564f1a 100644 +index 668b720f17760de7d893bcdd95661f13601fcbd3..2f224c29b25a480608a4da558706a285a223c667 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java +@@ -166,7 +166,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public boolean ac; + public boolean impulse; + public int portalCooldown; +- protected boolean inPortal; public final boolean inPortal() { return this.inPortal; } // Paper - OBFHELPER ++ public boolean inPortal; // Paper - public + protected int portalTicks; + protected BlockPosition ah; + protected Vec3D ai; @@ -192,6 +192,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; @@ -51,7 +60,7 @@ index 5a897b844d676309230fee83c0250a8a2600a581..067765981afda04959313fc5371e6da9 return this.al; } -+ public boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it! ++ public final boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it! public boolean bU() { // Paper start return this.pushedByWater(); @@ -68,7 +77,7 @@ index c94197a50269622e8995685119bac984c45e6833..11d384729326af693a9a679195acbd59 protected EntityCreature(EntityTypes<? extends EntityCreature> entitytypes, World world) { super(entitytypes, world); diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 5e9a05dfe822c42b83da84a154fe881d57ac1689..605bbf0174e60f795e445193a0284739ea452946 100644 +index e0ecdb8f87ec82b97a056c8f6d91d6a86f37bd34..a5c9526499c64dd8e4c760c322c0ab6a14a19087 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -47,7 +47,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -99,7 +108,7 @@ index 5e9a05dfe822c42b83da84a154fe881d57ac1689..605bbf0174e60f795e445193a0284739 if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) { EntityInsentient entityinsentient = (EntityInsentient) this.getVehicle(); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index b213a13c18ad483472808f4fe9743f74821a25cd..66bca610fbb8afc6f5b4430318c66d29af55fc19 100644 +index fd8b3d05238329adf3f638b1e04fd95c08e0a74a..9746346d6b9c432710f229f5355e4540c308ffb4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -97,7 +97,7 @@ public abstract class EntityLiving extends Entity { @@ -318,7 +327,7 @@ index 50487dbf0ac162d7608b67b4fb50fa7f8bfba69d..04b28555b1bb68536e40bb6526136787 return this.c; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a9aad7045cf67cca765500ebad4db9af3cf17262..822cd9b5a4695d5d17320a16d70eb4c977211759 100644 +index 325d7a313cfab72978f5c8fada1af6f19cdab239..1d8f091cf55c2296b87d74fb9948142952ebdce2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -82,6 +82,12 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -335,7 +344,7 @@ index a9aad7045cf67cca765500ebad4db9af3cf17262..822cd9b5a4695d5d17320a16d70eb4c9 public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..5dcc1ba547db7cc53a08426a7ad119ae88690136 100644 +index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..119a9c1e400ada270d0d97bea4170a8238d9c17d 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -2,24 +2,34 @@ package org.spigotmc; @@ -681,7 +690,7 @@ index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..5dcc1ba547db7cc53a08426a7ad119ae } + // Paper start - special case always immunities + // immunize brand new entities, dead entities, and portal scenarios -+ if (entity.defaultActivationState || entity.ticksLived < 20*10 || !entity.isAlive() || entity.inPortal() || entity.portalCooldown > 0) { ++ if (entity.defaultActivationState || entity.ticksLived < 20*10 || !entity.isAlive() || entity.inPortal || entity.portalCooldown > 0) { + return true; + } + // immunize leashed entities diff --git a/Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch index 80436106a1..c5fd5518e0 100644 --- a/Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch +++ b/Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Bees get gravity in void. Fixes MC-167279 diff --git a/src/main/java/net/minecraft/server/ControllerMove.java b/src/main/java/net/minecraft/server/ControllerMove.java -index f2d2d04fe16bc091a971c8c90db56e6cd2799555..ac6f9d9e5252b819f91703ad6aeaae3d580eeca0 100644 +index f2d2d04fe16bc091a971c8c90db56e6cd2799555..6393ff765f12db2911e2eaba800104b7539c290a 100644 --- a/src/main/java/net/minecraft/server/ControllerMove.java +++ b/src/main/java/net/minecraft/server/ControllerMove.java @@ -2,7 +2,7 @@ package net.minecraft.server; @@ -13,7 +13,7 @@ index f2d2d04fe16bc091a971c8c90db56e6cd2799555..ac6f9d9e5252b819f91703ad6aeaae3d public class ControllerMove { - protected final EntityInsentient a; -+ protected final EntityInsentient a; public EntityInsentient getEntity() { return a; } // Paper - OBFHELPER ++ protected final EntityInsentient a; public final EntityInsentient getEntity() { return a; } // Paper - OBFHELPER protected double b; protected double c; protected double d; diff --git a/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch b/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch index cbccde1fe6..defc46a6c7 100644 --- a/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch +++ b/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch @@ -71,10 +71,10 @@ index 0000000000000000000000000000000000000000..3edc8e52e06a62ce9f8cc734fd7458b3 + } +} diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index b50d86b39d2296e1dfb9aaaeb8f8f6f62a4e7430..2d3e73ef92c7b88d49f8eb27233cb823b425ea4a 100644 +index 4f0bcc096a7b1d51e4f7a3936d1dec7198002704..fc7dda277a0f80141e4de6f7efdbef0f19e19fc2 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -402,6 +402,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -400,6 +400,7 @@ public class BlockPosition extends BaseBlockPosition { return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } @@ -83,7 +83,7 @@ index b50d86b39d2296e1dfb9aaaeb8f8f6f62a4e7430..2d3e73ef92c7b88d49f8eb27233cb823 return this.d(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 b2713942d8cf5bedd91ac63df18a336743c72da5..a76b1d2fd81aaedb37190bcb8510020d5df2513e 100644 +index 74093f7757714a85f02492dddff23cbc91c28ae0..db5f22c3df9c7302e854f1f6d66067b0afeded28 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -593,8 +593,8 @@ public class Chunk implements IChunkAccess { @@ -98,7 +98,7 @@ index b2713942d8cf5bedd91ac63df18a336743c72da5..a76b1d2fd81aaedb37190bcb8510020d } diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index b168ad8021a5387e05023cd03ec1a69c8a86a233..cf444fa1cc96e881a1f9ed0c78d45935fe1c90ab 100644 +index cb72be356a2f28cfebc0cb4a822fa21d22ca5064..fbd2f6a068ee3037fc6fdc4a2f527f8b5b680afa 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -7,12 +7,14 @@ import javax.annotation.Nullable; @@ -174,7 +174,7 @@ index b168ad8021a5387e05023cd03ec1a69c8a86a233..cf444fa1cc96e881a1f9ed0c78d45935 } diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 48cca2b9a1dbb071615625842123c0c47e281b29..235c9ec37c00ce8838b3e7c02284e402f9d30e38 100644 +index 0e030347710df7c4bbf1ba695209ea66cec7c46d..e65fe633f5dc7df58fdc52955c23a9b9fbcdc4f6 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -111,4 +111,32 @@ public class DataBits { @@ -211,7 +211,7 @@ index 48cca2b9a1dbb071615625842123c0c47e281b29..235c9ec37c00ce8838b3e7c02284e402 + // Paper end } diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 900b551f6f76862443b09c1e76ad596eda5655f4..1cb45f97b644347d16b66b46113b1e4455004fd3 100644 +index ed77117630d54b7ad81f633110c7d2a7c59288e9..95ef96286855624590b72d69514b0fc0e08fddba 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -277,6 +277,14 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> { @@ -230,23 +230,23 @@ index 900b551f6f76862443b09c1e76ad596eda5655f4..1cb45f97b644347d16b66b46113b1e44 public interface a<T> { diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 00827c335e9413e986d7f07d0adbcef0d106a553..c66a8011dde4932e03ea91194ea92a7263e48428 100644 +index cf90ebf0614422879f5f5da05c925728f94ef8be..06333b69539a86b14b6b1efa5fee19b5bdfacfdf 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java -@@ -29,7 +29,7 @@ public class EntityTurtle extends EntityAnimal { +@@ -28,7 +28,7 @@ public class EntityTurtle extends EntityAnimal { + } - public final void setHome(BlockPosition pos) { setHomePos(pos); } // Paper - OBFHELPER public void setHomePos(BlockPosition blockposition) { - this.datawatcher.set(EntityTurtle.bw, blockposition); + this.datawatcher.set(EntityTurtle.bw, blockposition.immutableCopy()); // Paper - called with mutablepos... } - // TODO Paper: Obf helpers here can prolly be removed? check that no newer patches use them - public final BlockPosition getHome() { return this.getHomePos(); } // Paper - OBFHELPER + public BlockPosition getHomePos() { // Paper - public + return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7c6b7955c454c585eed7457d6680ce67e6219162..a31d293a00d325e4ee1eba48126b112df117fcfc 100644 +index e7dafb74d104ecd3fa05efc7189c8298abee8ca2..cad4cd2af375d80c6ceb82541ee248c742ba68e4 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1466,10 +1466,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1461,10 +1461,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public abstract TagRegistry p(); public BlockPosition a(int i, int j, int k, int l) { diff --git a/Spigot-Server-Patches/0425-Configurable-chance-of-villager-zombie-infection.patch b/Spigot-Server-Patches/0425-Configurable-chance-of-villager-zombie-infection.patch index 29c8b55f17..5c9d9586bc 100644 --- a/Spigot-Server-Patches/0425-Configurable-chance-of-villager-zombie-infection.patch +++ b/Spigot-Server-Patches/0425-Configurable-chance-of-villager-zombie-infection.patch @@ -22,10 +22,10 @@ index 1b2256144f7f968667570e5a9838a77173d515c5..f888fc1c5ef4212f81ed936da6485aba + } } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 05d19850538b7d853b270d952739d5d1b151690c..b66059836cc86cbef6c302c44d3f758067a4824d 100644 +index e436b0f4691154e200b9a5c28566074ff8bc0df9..8784da7ca664b93c4ce1d3e63bb841229f4616df 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -390,10 +390,14 @@ public class EntityZombie extends EntityMonster { +@@ -389,10 +389,14 @@ public class EntityZombie extends EntityMonster { @Override public void a_(EntityLiving entityliving) { super.a_(entityliving); diff --git a/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch b/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch index 16c7a7b64d..4678c272c9 100644 --- a/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch +++ b/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch @@ -48,16 +48,15 @@ index b74a31904f0fedbff0534dd90e189c05282258b8..415049bb5fdcc5c3edaf71bc8ddc330f public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java -index b1fea06d29a0c98136496d6eff81e6959cb73672..78029e10e6670936fb7dbedc7f34c5f8045fc291 100644 +index b1fea06d29a0c98136496d6eff81e6959cb73672..776e54ff472a67f535dfb409e753325a1105bcce 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java -@@ -4,13 +4,15 @@ import java.util.Random; +@@ -4,13 +4,13 @@ import java.util.Random; public class MobSpawnerPatrol implements MobSpawner { -+ private int getSpawnDelay() { return a; } // Paper - OBFHELPER -+ private void setSpawnDelay(int spawnDelay) { this.a = spawnDelay; } // Paper - OBFHELPER - private int a; +- private int a; ++ private int a;private int getSpawnDelay() { return a; } private void setSpawnDelay(int spawnDelay) { this.a = spawnDelay; } // Paper - OBFHELPER public MobSpawnerPatrol() {} @@ -68,7 +67,7 @@ index b1fea06d29a0c98136496d6eff81e6959cb73672..78029e10e6670936fb7dbedc7f34c5f8 if (!flag) { return 0; } else if (!worldserver.getGameRules().getBoolean(GameRules.DO_PATROL_SPAWNING)) { -@@ -18,23 +20,51 @@ public class MobSpawnerPatrol implements MobSpawner { +@@ -18,23 +18,51 @@ public class MobSpawnerPatrol implements MobSpawner { } else { Random random = worldserver.random; @@ -129,14 +128,14 @@ index b1fea06d29a0c98136496d6eff81e6959cb73672..78029e10e6670936fb7dbedc7f34c5f8 if (entityhuman.isSpectator()) { return 0; diff --git a/src/main/java/net/minecraft/server/StatisticWrapper.java b/src/main/java/net/minecraft/server/StatisticWrapper.java -index 3b6034038a4841ebc980b2392c71025d9b0dde35..9c95c0ccfcdc11d8b8bc60986365e76ca0821c68 100644 +index 3b6034038a4841ebc980b2392c71025d9b0dde35..795ea6fece2e28645e99f4578e26a6d12b4c1bf8 100644 --- a/src/main/java/net/minecraft/server/StatisticWrapper.java +++ b/src/main/java/net/minecraft/server/StatisticWrapper.java @@ -27,6 +27,7 @@ public class StatisticWrapper<T> implements Iterable<Statistic<T>> { return this.b.values().iterator(); } -+ public Statistic<T> get(T t) { return this.b(t); }; // Paper - OBFHELPER ++ public final Statistic<T> get(T t) { return this.b(t); }; // Paper - OBFHELPER public Statistic<T> b(T t0) { return this.a(t0, Counter.DEFAULT); } diff --git a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch index 74356f1cd9..18c159e4eb 100644 --- a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch +++ b/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch @@ -70,7 +70,7 @@ index ba9f75bd8f6fe1990d485548f4481bd1762d93af..e14e8bcf235339c1537a1e0a7702a364 if (optional.isPresent()) { diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 9615c4d324e42f7f91a7e60b6151c16d20e9c739..a68e4fc411ae84f12b1ca7443fa66f6325712af8 100644 +index 8eb93f33da264cd5182d1399e40e1f63d83a3e98..73e5a1a11c90aeb31e29d79fca2fedcd52e7439a 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -598,7 +598,7 @@ public final class MCUtil { @@ -79,11 +79,11 @@ index 9615c4d324e42f7f91a7e60b6151c16d20e9c739..a68e4fc411ae84f12b1ca7443fa66f63 PlayerChunkMap chunkMap = world.getChunkProvider().playerChunkMap; - Long2ObjectLinkedOpenHashMap<PlayerChunk> visibleChunks = chunkMap.visibleChunks; + Long2ObjectLinkedOpenHashMap<PlayerChunk> visibleChunks = chunkMap.getVisibleChunks(); - ChunkMapDistance chunkMapDistance = chunkMap.getChunkMapDistanceManager(); + ChunkMapDistance chunkMapDistance = chunkMap.chunkDistanceManager; List<PlayerChunk> allChunks = new ArrayList<>(visibleChunks.values()); List<EntityPlayer> players = world.players; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index d4207cb622bf17314f77831c604c8ba9e6cf848f..d95ef14f5a4babc8c8fff349baf6a9aa44edcc82 100644 +index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c87d9511c8 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -56,8 +56,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -243,7 +243,7 @@ index d4207cb622bf17314f77831c604c8ba9e6cf848f..d95ef14f5a4babc8c8fff349baf6a9aa while (objectbidirectionaliterator.hasNext()) { Entry<PlayerChunk> entry = (Entry) objectbidirectionaliterator.next(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 97176c02e31540315d256b7e0636e7285092c59e..b8bbc99d5d11cff21955f4b98f8673c6ad3580b7 100644 +index 045d874bffc25279247edfc413686d5b89cb301e..c57ccc003cf055c9e5dc704eaa07544881f32727 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -73,6 +73,7 @@ import net.minecraft.server.GameRules; diff --git a/Spigot-Server-Patches/0441-Add-tick-times-API-and-mspt-command.patch b/Spigot-Server-Patches/0441-Add-tick-times-API-and-mspt-command.patch index bc1367847d..f844f52cfa 100644 --- a/Spigot-Server-Patches/0441-Add-tick-times-API-and-mspt-command.patch +++ b/Spigot-Server-Patches/0441-Add-tick-times-API-and-mspt-command.patch @@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..d0211d4f39f9d6af1d751ac66342b42c + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index aad1420dc63c16b558ad1ca34accf8a7a9af6363..ac01d492872fde6df2b7113005457c714b91fe44 100644 +index 7b37f46b29699603629e5e635be89f725f163f00..093605fe8e079d9ec973702c55ea6caddf0369f1 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -69,6 +69,7 @@ public class PaperConfig { @@ -87,7 +87,7 @@ index aad1420dc63c16b558ad1ca34accf8a7a9af6363..ac01d492872fde6df2b7113005457c71 version = getInt("config-version", 20); set("config-version", 20); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5b6f3d811ff55d0c6d55bddc7707ef878baff782..04eb2af28f9843ef7641f5464d2a043c696de864 100644 +index 0573b03a2213661e9d9595af735e4a769586f0b8..251e07ca1955533be4e6075af4200a53d2bb4bdb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -107,6 +107,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -115,7 +115,7 @@ index 5b6f3d811ff55d0c6d55bddc7707ef878baff782..04eb2af28f9843ef7641f5464d2a043c this.circularTimer.a(i1 - i); this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot -@@ -2171,4 +2182,30 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -2170,4 +2181,30 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas public SaveData getSaveData() { return this.saveData; } diff --git a/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch b/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch index 09bd2265e8..04b712a32e 100644 --- a/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch +++ b/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch @@ -97,7 +97,7 @@ index 87753a94792af94454f76a2beb1ab9f1027f514f..4c561181a977fd0244325880bb6a8cd6 @Override diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index 63fdae15ccbef0c39718b320dbd096794bcfa3b4..6beefff203ed6e448898eb5b2e95800def868381 100644 +index c5259673ccddd6326d185370f8123aa936aae755..fb4c5ae4011e104848bab9e9141d9e90a5cb45ca 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -135,6 +135,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R @@ -109,7 +109,7 @@ index 63fdae15ccbef0c39718b320dbd096794bcfa3b4..6beefff203ed6e448898eb5b2e95800d } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 04eb2af28f9843ef7641f5464d2a043c696de864..fb65978d783a91b341658e0ebe393ab77153a0d9 100644 +index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9f7a64d35 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -159,7 +159,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -256,7 +256,7 @@ index 04eb2af28f9843ef7641f5464d2a043c696de864..fb65978d783a91b341658e0ebe393ab7 throw new RuntimeException("Error generating crash report", t); } // Spigot End -@@ -1757,7 +1810,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1756,7 +1809,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.resourcePackRepository.a(collection); this.saveData.a(a(this.resourcePackRepository)); datapackresources.i(); @@ -267,7 +267,7 @@ index 04eb2af28f9843ef7641f5464d2a043c696de864..fb65978d783a91b341658e0ebe393ab7 this.customFunctionData.a(this.dataPackResources.a()); this.ak.a(this.dataPackResources.h()); diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index d95ef14f5a4babc8c8fff349baf6a9aa44edcc82..1fcf75b2ed3c8c1ca2e31f679fc7d507f963caf2 100644 +index 2fc063add21b89ee5a456536088fe0c87d9511c8..8e60f1e24d4adc3580864ef51188dffa46c17830 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -486,6 +486,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -304,10 +304,10 @@ index 5579044782f155f587de1e2ea5115bde6053f722..e8075ad6b5395c7dce12741fe85dafd1 a(SystemUtils.e); a(SystemUtils.f); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a31d293a00d325e4ee1eba48126b112df117fcfc..bcfa630ae8d7a1454ea2f8e6e88b8902cb586467 100644 +index cad4cd2af375d80c6ceb82541ee248c742ba68e4..ada3364150e55273cc699889e3a98cf0b9680219 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -846,6 +846,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -841,6 +841,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { gameprofilerfiller.exit(); } catch (Throwable throwable) { @@ -315,7 +315,7 @@ index a31d293a00d325e4ee1eba48126b112df117fcfc..bcfa630ae8d7a1454ea2f8e6e88b8902 // Paper start - Prevent tile entity and entity crashes String msg = "TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ(); System.err.println(msg); -@@ -921,6 +922,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -916,6 +917,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { try { consumer.accept(entity); } catch (Throwable throwable) { diff --git a/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch b/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch index 3b50e1bdc1..163f97fb60 100644 --- a/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch +++ b/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch @@ -11,7 +11,7 @@ Less crammed entities are likely to show significantly less benefit. Effectively, this patch optimises crammed entity situations. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index cb24f27bc443880b18ffc36236f6ec7174c9d493..b65ae2d6919a67498d0646c5522735086fec00c1 100644 +index 0d7a2812ec739dbde52b551834a88a7c516cea13..8346592e75e0d719cbec0e03bff0864990c0a47c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -91,6 +91,54 @@ public class Chunk implements IChunkAccess { @@ -88,7 +88,7 @@ index cb24f27bc443880b18ffc36236f6ec7174c9d493..b65ae2d6919a67498d0646c552273508 } if (entity instanceof EntityItem) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 152f613159ef88977de867c0deec94bfa4353f7a..a0249d7a60c1381ebd7131d735a73fa2e9250543 100644 +index 82042830979c5d7e39dc03f5ac4fe1c3199fdebb..f8a7ddeb70a1708805f22a1fd23e44f8906ea507 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -211,6 +211,40 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -190,10 +190,10 @@ index 74d4c28246e7db850e6d993e07a84b2a6ca24ce2..267a6baae89c181eed545e6758fac711 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index bcfa630ae8d7a1454ea2f8e6e88b8902cb586467..24047e02c0232217be6ced5708daef754d74e280 100644 +index ada3364150e55273cc699889e3a98cf0b9680219..7342bdaa5f1cc0ae6a889149d45a97b6597a1e5b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1111,6 +1111,32 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1106,6 +1106,32 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return this.getChunkAt(i, j, ChunkStatus.FULL, false); } diff --git a/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch b/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch index c7a503f05d..9f70e8ca14 100644 --- a/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch +++ b/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch @@ -85,7 +85,7 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb + } +} diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 22acfe1350eb122b7eaa7209f519e4f4f1469b6c..2cada09ced1660526e9c112c2c8d92bbf9d6ea98 100644 +index 9fe3a6e16e2a5c6b83ac559c440dfce60cb5ef6b..e411f6280d07e3f6a953e1fcaffaaa49f85dc7cc 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -36,7 +36,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -98,7 +98,7 @@ index 22acfe1350eb122b7eaa7209f519e4f4f1469b6c..2cada09ced1660526e9c112c2c8d92bb protected static final DataWatcherObject<NBTTagCompound> br = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); protected static final DataWatcherObject<NBTTagCompound> bs = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 99513a682c0b1bbe141098427883ee561a4d5e9d..d4d789e84a2b6a3ba108532630a89f51b3a23f54 100644 +index 99513a682c0b1bbe141098427883ee561a4d5e9d..15696359ac65f00bbff82c54d445562fccab86ba 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -122,23 +122,14 @@ index 99513a682c0b1bbe141098427883ee561a4d5e9d..d4d789e84a2b6a3ba108532630a89f51 public String locale = null; // CraftBukkit - lowercase // Paper - default to null public void a(PacketPlayInSettings packetplayinsettings) { -+ new PlayerClientOptionsChangeEvent(getBukkitEntity(), packetplayinsettings.getLocale(), packetplayinsettings.viewDistance, com.destroystokyo.paper.ClientOption.ChatVisibility.valueOf(packetplayinsettings.getChatVisibility().name()), packetplayinsettings.hasChatColorsEnabled(), new com.destroystokyo.paper.PaperSkinParts(packetplayinsettings.getSkinParts()), packetplayinsettings.getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT).callEvent(); // Paper - settings event ++ new PlayerClientOptionsChangeEvent(getBukkitEntity(), packetplayinsettings.locale, packetplayinsettings.viewDistance, com.destroystokyo.paper.ClientOption.ChatVisibility.valueOf(packetplayinsettings.getChatVisibility().name()), packetplayinsettings.hasChatColorsEnabled(), new com.destroystokyo.paper.PaperSkinParts(packetplayinsettings.getSkinParts()), packetplayinsettings.getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT).callEvent(); // Paper - settings event // CraftBukkit start if (getMainHand() != packetplayinsettings.getMainHand()) { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT); diff --git a/src/main/java/net/minecraft/server/PacketPlayInSettings.java b/src/main/java/net/minecraft/server/PacketPlayInSettings.java -index dbc3552d50c4129e1844c8a379ab5ba396645f52..be97a0b01b3272e01ece90172f283e3feca10d14 100644 +index dbc3552d50c4129e1844c8a379ab5ba396645f52..87ec3987d4b6de836016e91ef90383e3e5bb2d16 100644 --- a/src/main/java/net/minecraft/server/PacketPlayInSettings.java +++ b/src/main/java/net/minecraft/server/PacketPlayInSettings.java -@@ -4,7 +4,7 @@ import java.io.IOException; - - public class PacketPlayInSettings implements Packet<PacketListenerPlayIn> { - -- public String locale; -+ public String locale; public String getLocale() { return this.locale; } // Paper - OBFHELPER - public int viewDistance; - private EnumChatVisibility c; - private boolean d; @@ -37,14 +37,17 @@ public class PacketPlayInSettings implements Packet<PacketListenerPlayIn> { packetlistenerplayin.a(this); } @@ -158,7 +149,7 @@ index dbc3552d50c4129e1844c8a379ab5ba396645f52..be97a0b01b3272e01ece90172f283e3f return this.e; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c3d84b1d53e835cf467c42c7adaeb774010366af..3951d3366b9450465391d5ecba993442cc7b88b8 100644 +index 0a265324877bb20d2d0aa3ceed076d7d0e772da2..f2d61a03c540ff10a6949e637b40a8057be2f1dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,8 @@ diff --git a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch b/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch index be16bad720..df5b38adac 100644 --- a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 574d9ef4f4f0e95a66252b0428ff84c72d5bc32c..ad92d6d30f0e3280c2e4cab6d0c96280d40ae2ef 100644 +index 574d9ef4f4f0e95a66252b0428ff84c72d5bc32c..ce823833a0b308aeb11902652157575eabf09e3b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1822,7 +1822,16 @@ public abstract class EntityLiving extends Entity { @@ -16,11 +16,11 @@ index 574d9ef4f4f0e95a66252b0428ff84c72d5bc32c..ad92d6d30f0e3280c2e4cab6d0c96280 + // Paper start - PlayerAttackEntityCooldownResetEvent + if (damagesource.getEntity() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) damagesource.getEntity(); -+ if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getCooledAttackStrength(0F)).callEvent()) { -+ player.resetCooldown(); ++ if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getAttackCooldown(0F)).callEvent()) { ++ player.resetAttackCooldown(); + } + } else { -+ ((EntityHuman) damagesource.getEntity()).resetCooldown(); ++ ((EntityHuman) damagesource.getEntity()).resetAttackCooldown(); + } + // Paper end } diff --git a/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch index 2dba7f5f77..6a81e9378b 100644 --- a/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch +++ b/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch @@ -37,7 +37,7 @@ index 13b89276feb76fcecaeefc166a1bc161d5931d9d..5af7e5c815752f2fd2b13c02a9057969 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index b65ae2d6919a67498d0646c5522735086fec00c1..7f508b9ef616071b1adeef7c00da7f4565ef4ddd 100644 +index 8346592e75e0d719cbec0e03bff0864990c0a47c..fb3b626a3dbeca14a2b89e2480f81e7b45a432d3 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -246,7 +246,51 @@ public class Chunk implements IChunkAccess { @@ -115,7 +115,7 @@ index 7e57a53ec614a2f7d2672edff9d7c0e0dca42377..c072f61e8c88eac8335acd660d8ff0e2 if (flag1) { ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 747657396a855d56a6746a9b827de69ad3710b3d..69b10093552fd3b84d355e216a3eb6bee3d486ef 100644 +index ca93c9f3ab6ae50eb7dbc825a70620325033ccad..e80133932c5fad52c7b42c45c2b84aff7d11f296 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -115,6 +115,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -128,7 +128,7 @@ index 747657396a855d56a6746a9b827de69ad3710b3d..69b10093552fd3b84d355e216a3eb6be super(worldserver, worldserver.getSpawn(), gameprofile); this.spawnDimension = World.OVERWORLD; diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index a68e4fc411ae84f12b1ca7443fa66f6325712af8..d24b5fa7e77bb18626459f6c3ab4aa20a7512712 100644 +index 73e5a1a11c90aeb31e29d79fca2fedcd52e7439a..b419f0e938b8406874ff7b3d0ee7a532e5990557 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -620,7 +620,8 @@ public final class MCUtil { @@ -235,7 +235,7 @@ index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698 public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 15a5c85cab5a5d9e74a577f648258e205fcb6251..ecab6d2309a7804c1ab4e7f7bcc519efb7f0a49f 100644 +index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f148ca9edcc 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -95,7 +95,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -245,7 +245,7 @@ index 15a5c85cab5a5d9e74a577f648258e205fcb6251..ecab6d2309a7804c1ab4e7f7bcc519ef - private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain; + final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain; // Paper - private -> package private public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER + public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; @@ -170,6 +170,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick @@ -598,7 +598,7 @@ index 2c0d9c52fa90639c6b3b542b626a8b55b82a0df1..382f334f82efefcfbd1781ac09e191cd while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 24047e02c0232217be6ced5708daef754d74e280..302b0eda863dcaf7eeea7b0e1820929a46f44c54 100644 +index 7342bdaa5f1cc0ae6a889149d45a97b6597a1e5b..d0e0fb0780e97102d0010f05902cd3218d4b7d3d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -508,8 +508,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -617,7 +617,7 @@ index 24047e02c0232217be6ced5708daef754d74e280..302b0eda863dcaf7eeea7b0e1820929a if ((i & 1) != 0) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b8bbc99d5d11cff21955f4b98f8673c6ad3580b7..b34269cd29fe15408e8811a8ab88b8d0fa43fcd3 100644 +index c57ccc003cf055c9e5dc704eaa07544881f32727..f9a5ec5cb34425e346e9a7cc24986ece9a4c44e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -2530,10 +2530,39 @@ public class CraftWorld implements World { @@ -662,7 +662,7 @@ index b8bbc99d5d11cff21955f4b98f8673c6ad3580b7..b34269cd29fe15408e8811a8ab88b8d0 private final Spigot spigot = new Spigot() { diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 5dcc1ba547db7cc53a08426a7ad119ae88690136..f78e44e05f7a97a7da190aa4b5aa6fb8340728ea 100644 +index 119a9c1e400ada270d0d97bea4170a8238d9c17d..37e930e0cb05cdb19c1b0dbd870313a14402181b 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -201,7 +201,7 @@ public class ActivationRange diff --git a/Spigot-Server-Patches/0483-Fix-Light-Command.patch b/Spigot-Server-Patches/0483-Fix-Light-Command.patch index d7fd8d334c..d4d8453264 100644 --- a/Spigot-Server-Patches/0483-Fix-Light-Command.patch +++ b/Spigot-Server-Patches/0483-Fix-Light-Command.patch @@ -7,7 +7,7 @@ This lets you run /paper fixlight <chunkRadius> (max 5) to automatically fix all light data in the chunks. diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 182b440ba4802d199b8e44f7779b3401ace495d5..cc3fc5200f75f80a60b4cbc260e3a0bc4bb3a869 100644 +index f7d98a5ba54d041eef10b04f821e0958ad898b0a..a12bc81933c15606b7cde46937f504eafc4ff030 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -20,6 +20,7 @@ import org.bukkit.command.Command; @@ -136,7 +136,7 @@ index 40347212ad1bcf857d5b8ddb0ee6a698e2568201..e5751adde516544722b95016f64b2a46 // Paper start - per player view distance // there can be potential desync with player's last mapped section and the view distance map, so use the diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index e4f81e93bfb305af7b2bfbccac3fbe981dbddf11..e4527f3f899ac194d629f39bfdb650667d2dab80 100644 +index f67a8b655d0d0a9397650f771bc68f148ca9edcc..3711914d59c61b652c6c675812ca5ecc29f95130 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -96,6 +96,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -150,7 +150,7 @@ index e4f81e93bfb305af7b2bfbccac3fbe981dbddf11..e4527f3f899ac194d629f39bfdb65066 + } + // Paper end public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER + public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; @@ -287,11 +293,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { Mailbox<Runnable> mailbox = Mailbox.a("main", iasynctaskhandler::a); diff --git a/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index 39ce143a46..6d16c39327 100644 --- a/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -78,10 +78,10 @@ index 49a594e5f345096cb3b9913b8ee2760795c5f012..bcb7ce2692c5bc1a6214c3a384949666 } diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 35b8a85d1280ba3be757b14b14388954ac1617d4..f47a6e0027de6886991aad5bcb98a04157aeb846 100644 +index f0e28f03074bc5e24e5fa64dca94c7573f952357..b7093f1682d152988a54ffc5e5579d2f0ce10ad4 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -@@ -108,6 +108,7 @@ public class ChunkCoordIntPair { +@@ -107,6 +107,7 @@ public class ChunkCoordIntPair { return "[" + this.x + ", " + this.z + "]"; } @@ -90,7 +90,7 @@ index 35b8a85d1280ba3be757b14b14388954ac1617d4..f47a6e0027de6886991aad5bcb98a041 return new BlockPosition(this.d(), 0, this.e()); } diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1abad58377 100644 +index c072f61e8c88eac8335acd660d8ff0e2f9db819e..705c6e3a47a76509268075078f95871d313f6b76 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -23,6 +23,7 @@ import java.util.concurrent.Executor; @@ -106,7 +106,7 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> j; private final Mailbox<ChunkTaskQueueSorter.b> k; - private final LongSet l = new LongOpenHashSet(); -+ private final LongSet l = new LongOpenHashSet(); LongSet getOnPlayerTicketAddQueue() { return l; } // Paper - OBFHELPER ++ private final LongSet l = new LongOpenHashSet(); public final LongSet getOnPlayerTicketAddQueue() { return l; } // Paper - OBFHELPER private final Executor m; private long currentTick; @@ -364,7 +364,7 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a }); }, i, true)); } -@@ -409,6 +571,102 @@ public abstract class ChunkMapDistance { +@@ -409,6 +571,101 @@ public abstract class ChunkMapDistance { } @@ -394,7 +394,7 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a + BlockPosition blockPos = chunkPos.asPosition(); + + boolean isFront = false; -+ BlockPosition.PooledBlockPosition pos = BlockPosition.PooledBlockPosition.acquire(); ++ BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(); + for (int index = 0, len = backingSet.length; index < len; ++index) { + if (!(backingSet[index] instanceof EntityPlayer)) { + continue; @@ -421,7 +421,6 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a + minDist = dist; + } + } -+ pos.close(); + if (minDist == Double.MAX_VALUE) { + minDist = 15; + } else { @@ -467,7 +466,7 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a @Override public void a() { super.a(); -@@ -440,6 +698,7 @@ public abstract class ChunkMapDistance { +@@ -440,6 +697,7 @@ public abstract class ChunkMapDistance { } @@ -475,7 +474,7 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a private boolean c(int i) { return i <= this.e - 2; } -@@ -456,6 +715,7 @@ public abstract class ChunkMapDistance { +@@ -456,6 +714,7 @@ public abstract class ChunkMapDistance { this.a.defaultReturnValue((byte) (i + 2)); } @@ -570,7 +569,7 @@ index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027b boolean flag1 = this.playerChunkMap.b(); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 69b10093552fd3b84d355e216a3eb6bee3d486ef..4550e3449b146d5d416ece620d036cb17547b30e 100644 +index e80133932c5fad52c7b42c45c2b84aff7d11f296..e5a81f831813209d224ffedbc03f6d8243721a25 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -55,6 +55,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -617,7 +616,7 @@ index 69b10093552fd3b84d355e216a3eb6bee3d486ef..4550e3449b146d5d416ece620d036cb1 for (int i = 0; i < this.inventory.getSize(); ++i) { ItemStack itemstack = this.inventory.getItem(i); diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index d24b5fa7e77bb18626459f6c3ab4aa20a7512712..e9cedbc8b62180134e774b119fb156c54f5767de 100644 +index b419f0e938b8406874ff7b3d0ee7a532e5990557..87810f007ad258935aa54c0f6a2e2d4325281623 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -655,6 +655,7 @@ public final class MCUtil { @@ -882,7 +881,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c136ba20aa 100644 +index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af203ecd60ca 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -51,6 +51,7 @@ import org.apache.commons.lang3.mutable.MutableBoolean; @@ -954,7 +953,7 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 this.playerViewDistanceNoTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets); this.playerViewDistanceBroadcastMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -@@ -416,6 +434,116 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -416,6 +434,115 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }); // Paper end - no-tick view distance } @@ -997,7 +996,7 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 + it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap priorities = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); + + int viewDistance = getEffectiveNoTickViewDistance(); -+ BlockPosition.PooledBlockPosition pos = BlockPosition.PooledBlockPosition.acquire(); ++ BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(); + + // Prioritize circular near + double playerChunkX = MathHelper.floor(player.locX()) >> 4; @@ -1053,7 +1052,6 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 + }); + } + -+ pos.close(); + if (priorities.isEmpty()) return; + chunkDistanceManager.delayDistanceManagerTick = true; + priorities.long2IntEntrySet().fastForEach(entry -> chunkDistanceManager.markHighPriority(new ChunkCoordIntPair(entry.getLongKey()), entry.getIntValue())); @@ -1071,7 +1069,7 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 public void updatePlayerMobTypeMap(Entity entity) { if (!this.world.paperConfig.perPlayerMobSpawns) { -@@ -545,6 +673,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -545,6 +672,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { List<CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>>> list = Lists.newArrayList(); int j = chunkcoordintpair.x; int k = chunkcoordintpair.z; @@ -1079,7 +1077,7 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 for (int l = -i; l <= i; ++l) { for (int i1 = -i; i1 <= i; ++i1) { -@@ -563,6 +692,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -563,6 +691,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ChunkStatus chunkstatus = (ChunkStatus) intfunction.apply(j1); CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = playerchunk.a(chunkstatus, this); @@ -1094,7 +1092,7 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 list.add(completablefuture); } -@@ -1030,14 +1167,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1030,14 +1166,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }; CompletableFuture<NBTTagCompound> chunkSaveFuture = this.world.asyncChunkTaskManager.getChunkSaveFuture(chunkcoordintpair.x, chunkcoordintpair.z); @@ -1122,7 +1120,7 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 return ret; // Paper end } -@@ -1174,7 +1319,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1174,7 +1318,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { long i = playerchunk.i().pair(); playerchunk.getClass(); @@ -1132,7 +1130,7 @@ index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c1 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 7fd991fd3994a18625c193aeb15ed521d3b6a447..6bb2b3520362d056d4d75c65764e4c8dbc1417f9 100644 +index 2223210b6ba0c4a1484bc76aec588fd35251f823..4bc5dfa83aa86275e226514db2d7e880b66e6567 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1302,6 +1302,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -1208,7 +1206,7 @@ index d7b9d9fd3a3b607278a3d72b0b306b0be2aa30ad..6fd852db6bcfbfbf84ec2acf6d23b08a public static <T> TicketType<T> a(String s, Comparator<T> comparator) { return new TicketType<>(s, comparator, 0L); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b34269cd29fe15408e8811a8ab88b8d0fa43fcd3..4210aa793b497889ca732a51b2eadea08d88bfac 100644 +index f9a5ec5cb34425e346e9a7cc24986ece9a4c44e8..cc7c6204b6dcce766a0d3834f2963304b26107c6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -2520,6 +2520,10 @@ public class CraftWorld implements World { @@ -1223,7 +1221,7 @@ index b34269cd29fe15408e8811a8ab88b8d0fa43fcd3..4210aa793b497889ca732a51b2eadea0 net.minecraft.server.Chunk chunk = (net.minecraft.server.Chunk) either.left().orElse(null); return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3951d3366b9450465391d5ecba993442cc7b88b8..72cd52fd7f0ba8df5be8989111d76e7180f033d7 100644 +index f2d61a03c540ff10a6949e637b40a8057be2f1dc..adf918fd757fe3147f897de3ade64a9adf1d3203 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -750,6 +750,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch b/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch index d73cded79d..ec57249421 100644 --- a/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch +++ b/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch @@ -54,10 +54,10 @@ index 04dea2c9fd9337631a6289c7242338e166d6bc1e..446c401b3139f8c6c0e70d883340f014 // Paper start - no-tick view distance public final Chunk getSendingChunk() { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 6b48c4e1d69f8de6ec32258c200be3c136ba20aa..fea219dcfd5a98fc0e48fd70dc7d0fd41b2fc970 100644 +index 3292bdcd143995d52f8c983a8984af203ecd60ca..a35b161035dd26e437f5c49fd650802281aa66a1 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -740,7 +740,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -739,7 +739,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return either.mapLeft((list) -> { return (Chunk) list.get(list.size() / 2); }); @@ -66,7 +66,7 @@ index 6b48c4e1d69f8de6ec32258c200be3c136ba20aa..fea219dcfd5a98fc0e48fd70dc7d0fd4 } @Nullable -@@ -1090,7 +1090,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1089,7 +1089,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { IChunkAccess ichunkaccess = (IChunkAccess) optional.get(); if (ichunkaccess.getChunkStatus().b(chunkstatus)) { @@ -75,7 +75,7 @@ index 6b48c4e1d69f8de6ec32258c200be3c136ba20aa..fea219dcfd5a98fc0e48fd70dc7d0fd4 if (chunkstatus == ChunkStatus.LIGHT) { completablefuture1 = this.b(playerchunk, chunkstatus); -@@ -1106,7 +1106,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1105,7 +1105,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return this.b(playerchunk, chunkstatus); } } @@ -84,7 +84,7 @@ index 6b48c4e1d69f8de6ec32258c200be3c136ba20aa..fea219dcfd5a98fc0e48fd70dc7d0fd4 } } -@@ -1227,6 +1227,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1226,6 +1226,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); }); }, (runnable) -> { diff --git a/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch b/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch index a2e0ec02c3..cd3a9824d5 100644 --- a/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch +++ b/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch @@ -7,10 +7,35 @@ Inline bit operations and reduce instruction count to make these hot operations faster diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 163a6c83a2e494e28981974ef9accd3255e562c2..8c2a4b57aba17b43517f7b09c4adf65ae5904b6d 100644 +index 0d3a57900dc0bf5bc9729a3661a32da4e7ea1f33..a2ee39b7efca0851bca8dc0ec1c13fe3cada6b3f 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -53,28 +53,29 @@ public class BlockPosition extends BaseBlockPosition { +@@ -24,14 +24,16 @@ public class BlockPosition extends BaseBlockPosition { + }).stable(); + private static final Logger LOGGER = LogManager.getLogger(); + public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); +- private static final int f = 1 + MathHelper.f(MathHelper.c(30000000)); +- private static final int g = BlockPosition.f; +- private static final int h = 64 - BlockPosition.f - BlockPosition.g; +- private static final long i = (1L << BlockPosition.f) - 1L; +- private static final long j = (1L << BlockPosition.h) - 1L; +- private static final long k = (1L << BlockPosition.g) - 1L; +- private static final int l = BlockPosition.h; +- private static final int m = BlockPosition.h + BlockPosition.g; ++ // Paper start - static constants ++ private static final int f = 26; ++ private static final int g = 26; ++ private static final int h = 12; ++ private static final long i = 67108863; ++ private static final long j = 4095; ++ private static final long k = 67108863; ++ private static final int l = 12; ++ private static final int m = 38; ++ // Paper end + + public BlockPosition(int i, int j, int k) { + super(i, j, k); +@@ -53,28 +55,29 @@ public class BlockPosition extends BaseBlockPosition { this(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); } @@ -45,7 +70,7 @@ index 163a6c83a2e494e28981974ef9accd3255e562c2..8c2a4b57aba17b43517f7b09c4adf65a } public long asLong() { -@@ -83,12 +84,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -83,12 +86,7 @@ public class BlockPosition extends BaseBlockPosition { public static long asLong(int x, int y, int z) { return a(x, y, z); } // Paper - OBFHELPER public static long a(int i, int j, int k) { diff --git a/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch b/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch index 68495f116d..1fa4baa6ae 100644 --- a/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch +++ b/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch @@ -1342,7 +1342,7 @@ index 446c401b3139f8c6c0e70d883340f0140d94b752..c14cdb60243e16810ad711d204678d51 if (getCurrentPriority() != priority) { this.v.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index fea219dcfd5a98fc0e48fd70dc7d0fd41b2fc970..0c70689f525ccfd069f14ea8ef156aa2fa8a854e 100644 +index a35b161035dd26e437f5c49fd650802281aa66a1..5c5ee28f2349ea4cdb90bdca947a736483c43b2b 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -306,7 +306,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -1362,7 +1362,7 @@ index fea219dcfd5a98fc0e48fd70dc7d0fd41b2fc970..0c70689f525ccfd069f14ea8ef156aa2 this.p = new ChunkTaskQueueSorter(ImmutableList.of(threadedmailbox, mailbox, threadedmailbox1), executor, Integer.MAX_VALUE); this.mailboxWorldGen = this.p.a(threadedmailbox, false); -@@ -653,6 +661,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -652,6 +660,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper end } @@ -1371,7 +1371,7 @@ index fea219dcfd5a98fc0e48fd70dc7d0fd41b2fc970..0c70689f525ccfd069f14ea8ef156aa2 return () -> { PlayerChunk playerchunk = this.getVisibleChunk(i); diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java -index 35f4d2d9591e625ab0bbeab7b606761e74965eec..698d82dd736529a8cbfad5c6bed70ab97f0064bb 100644 +index 35f4d2d9591e625ab0bbeab7b606761e74965eec..cd30215dc098068ae034117c409cb295ebca58c1 100644 --- a/src/main/java/net/minecraft/server/ThreadedMailbox.java +++ b/src/main/java/net/minecraft/server/ThreadedMailbox.java @@ -109,7 +109,8 @@ public class ThreadedMailbox<T> implements Mailbox<T>, AutoCloseable, Runnable { @@ -1380,7 +1380,7 @@ index 35f4d2d9591e625ab0bbeab7b606761e74965eec..698d82dd736529a8cbfad5c6bed70ab9 - @Override + -+ public void queue(T t0) { a(t0); } @Override // Paper - OBFHELPER ++ public final void queue(T t0) { a(t0); } @Override // Paper - OBFHELPER public void a(T t0) { this.a.a(t0); this.f(); diff --git a/Spigot-Server-Patches/0515-Expose-Arrow-getItemStack.patch b/Spigot-Server-Patches/0515-Expose-Arrow-getItemStack.patch index 36652f2519..6e89c259a7 100644 --- a/Spigot-Server-Patches/0515-Expose-Arrow-getItemStack.patch +++ b/Spigot-Server-Patches/0515-Expose-Arrow-getItemStack.patch @@ -5,15 +5,14 @@ Subject: [PATCH] Expose Arrow getItemStack diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index c552962a9a2c8dac6794ef6698943c7d91ea45c4..6195a45e30d9a9d76e24fbc2493020917a8b87b9 100644 +index c552962a9a2c8dac6794ef6698943c7d91ea45c4..f8772a853ea9b5ca45c78a2fd8bd3f1fa6abf5d2 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -520,6 +520,8 @@ public abstract class EntityArrow extends IProjectile { +@@ -520,6 +520,7 @@ public abstract class EntityArrow extends IProjectile { } } -+ public ItemStack getOriginalItemStack() { return getItemStack(); } // Paper - OBFHelper -+ ++ public final ItemStack getOriginalItemStack() { return getItemStack(); } // Paper - OBFHELPER - exists purely due to overrides all as protected and dont want to change them all protected abstract ItemStack getItemStack(); @Override diff --git a/Spigot-Server-Patches/0533-Add-entity-liquid-API.patch b/Spigot-Server-Patches/0533-Add-entity-liquid-API.patch index a13b0a6a39..13ec6d1177 100644 --- a/Spigot-Server-Patches/0533-Add-entity-liquid-API.patch +++ b/Spigot-Server-Patches/0533-Add-entity-liquid-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add entity liquid API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index fcb3d3adae52fd70e856344a727a344cf78cfce3..9c4b02d776f8b99c6703c8dfc5d9fac0702bbe80 100644 +index 9b5cad1f1137cb6c73f423dada1ae027218086ca..5a8bcd91dc5d030be531124106005ddf513e627f 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1117,12 +1117,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -19,7 +19,7 @@ index fcb3d3adae52fd70e856344a727a344cf78cfce3..9c4b02d776f8b99c6703c8dfc5d9fac0 return this.world.isRainingAt(blockposition) || this.world.isRainingAt(blockposition.a(0.0D, (double) this.size.height, 0.0D)); } -+ public boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER ++ public final boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER private boolean k() { return this.world.getType(this.getChunkCoordinates()).a(Blocks.BUBBLE_COLUMN); } @@ -27,7 +27,7 @@ index fcb3d3adae52fd70e856344a727a344cf78cfce3..9c4b02d776f8b99c6703c8dfc5d9fac0 return this.isInWater() || this.isInRain() || this.k(); } -+ public boolean isInWaterOrBubbleColumn() { return aD(); } // Paper - OBFHELPER ++ public final boolean isInWaterOrBubbleColumn() { return aD(); } // Paper - OBFHELPER public boolean aD() { return this.isInWater() || this.k(); } @@ -35,7 +35,7 @@ index fcb3d3adae52fd70e856344a727a344cf78cfce3..9c4b02d776f8b99c6703c8dfc5d9fac0 this.inLava = true; } -+ public boolean isInLava() { return aN(); } // Paper - OBFHELPER ++ public final boolean isInLava() { return aN(); } // Paper - OBFHELPER public boolean aN() { return this.inLava; } diff --git a/Spigot-Server-Patches/0536-Add-PrepareResultEvent.patch b/Spigot-Server-Patches/0536-Add-PrepareResultEvent.patch index fbb086034a..358e7bb8f8 100644 --- a/Spigot-Server-Patches/0536-Add-PrepareResultEvent.patch +++ b/Spigot-Server-Patches/0536-Add-PrepareResultEvent.patch @@ -8,14 +8,14 @@ Adds a new event for all crafting stations that generate a result slot item Anvil, Grindstone and Smithing now extend this event diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java -index 4effcc860f9b1cf9f13f4c6ae02a6b16df459259..268bedd042b651514aa94b735876de9c40bae56f 100644 +index 4effcc860f9b1cf9f13f4c6ae02a6b16df459259..44db4851e2e6901e816b34c2037d00948c0a2008 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -126,6 +126,7 @@ public abstract class Container { return nonnulllist; } -+ public void notifyListeners() { this.c(); } // Paper - OBFHELPER ++ public final void notifyListeners() { this.c(); } // Paper - OBFHELPER public void c() { int i; @@ -106,7 +106,7 @@ index 270bf7f3e6ca15891419f1ce3e88d9aff094bee6..a235f6406dc06ceafea6fbe429bf595d private void a(IInventory iinventory, ItemStack itemstack) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f84d045fe951e482c10a6ad16c41076bf8808168..ddb58c1d502b6eaaee146eaa61d97cf5740d3990 100644 +index d3ad06c853338d1de7e3e49910dd06b127451d73..0af6fd88d3a151c74353ba29e97d63560b2fe990 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1549,19 +1549,44 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0542-Fix-arrows-never-despawning-MC-125757.patch b/Spigot-Server-Patches/0542-Fix-arrows-never-despawning-MC-125757.patch index a5b1ae0cea..a65fde01f4 100644 --- a/Spigot-Server-Patches/0542-Fix-arrows-never-despawning-MC-125757.patch +++ b/Spigot-Server-Patches/0542-Fix-arrows-never-despawning-MC-125757.patch @@ -9,7 +9,7 @@ instead of getting stuck in a never despawn state (bubble columns, etc). diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 6195a45e30d9a9d76e24fbc2493020917a8b87b9..1865f7a62307eb89d702f4824b090e050aa7afe7 100644 +index f8772a853ea9b5ca45c78a2fd8bd3f1fa6abf5d2..0d43eb8e1712d1b98888db7579bc343ccb1e8989 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -133,6 +133,7 @@ public abstract class EntityArrow extends IProjectile { @@ -24,7 +24,7 @@ index 6195a45e30d9a9d76e24fbc2493020917a8b87b9..1865f7a62307eb89d702f4824b090e05 } -+ protected void tickDespawnCounter() { this.h(); } // Paper - OBFHELPER ++ protected final void tickDespawnCounter() { this.h(); } // Paper - OBFHELPER protected void h() { ++this.despawnCounter; if (this.despawnCounter >= (fromPlayer == PickupStatus.CREATIVE_ONLY ? world.paperConfig.creativeArrowDespawnRate : (fromPlayer == PickupStatus.DISALLOWED ? world.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof EntityThrownTrident) ? world.spigotConfig.tridentDespawnRate : world.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init? |