From 524ebe97d7bf947e540019baf0eb68777449db0a Mon Sep 17 00:00:00 2001 From: stonar96 Date: Thu, 5 Oct 2017 14:38:21 +0100 Subject: [PATCH] Anti Xray v2 (#858) --- Spigot-Server-Patches/0003-MC-Dev-fixes.patch | 28 +- Spigot-Server-Patches/0005-MC-Utils.patch | 28 +- .../0169-Optimise-NetworkManager.patch | 88 - ....patch => 0169-Optimise-removeQueue.patch} | 6 +- ...-Allow-Reloading-of-Command-Aliases.patch} | 4 +- ...-Add-source-to-PlayerExpChangeEvent.patch} | 4 +- ...mize-World.isLoaded-BlockPosition-Z.patch} | 6 +- ...Speedup-BlockPos-by-fixing-inlining.patch} | 8 +- ...-Don-t-let-fishinghooks-use-portals.patch} | 8 +- ... => 0175-Add-ProjectileCollideEvent.patch} | 6 +- ...-Vanished-players-don-t-have-rights.patch} | 4 +- ...ent-Pathfinding-out-of-World-Border.patch} | 8 +- ...Bound-Treasure-Maps-to-World-Border.patch} | 8 +- ...igurable-Cartographer-Treasure-Maps.patch} | 8 +- ... => 0180-Optimize-ItemStack.isEmpty.patch} | 6 +- ...o-control-if-armour-stands-can-move.patch} | 8 +- ...-armor-stands-from-doing-entity-loo.patch} | 6 +- ...option-to-remove-invalid-statistics.patch} | 8 +- ...nt.patch => 0184-IllegalPacketEvent.patch} | 6 +- ...5-Properly-fix-item-duplication-bug.patch} | 6 +- ...=> 0186-String-based-Action-Bar-API.patch} | 4 +- ... 0187-Activation-Range-Improvements.patch} | 16 +- ...-API-s.patch => 0188-Firework-API-s.patch} | 12 +- ... 0189-PlayerTeleportEndGatewayEvent.patch} | 6 +- ... => 0190-ShulkerBox-Dupe-Prevention.patch} | 6 +- ...ovide-E-TE-Chunk-count-stat-methods.patch} | 6 +- ...h => 0192-Enforce-Sync-Player-Saves.patch} | 6 +- ... => 0193-Enforce-Sync-Chunk-Unloads.patch} | 6 +- ...low-entities-to-ride-themselves-572.patch} | 6 +- ...atch => 0195-Fix-block-break-desync.patch} | 6 +- ...ign-the-World-in-WorldGenStronghold.patch} | 6 +- ...-fromBottle-flag-to-Experience-Orbs.patch} | 10 +- ...-Remove-the-Vanilla-Method-Profiler.patch} | 4 +- ...patch => 0199-Cap-Entity-Collisions.patch} | 6 +- ...ow-a-zero-max-height-in-BiomeJungle.patch} | 8 +- ...-CraftScheduler-Async-Task-Debugger.patch} | 6 +- ...g.patch => 0202-Shame-on-you-Mojang.patch} | 6 +- ...ore-aggressive-in-the-chunk-unload-.patch} | 6 +- ...> 0204-Do-not-let-armorstands-drown.patch} | 6 +- ...-attempting-to-read-EMPTY-ItemStack.patch} | 6 +- ...e-async-calls-to-restart-the-server.patch} | 6 +- ...roperty-to-disable-book-size-limits.patch} | 6 +- ...e-parrots-stay-on-shoulders-despite.patch} | 6 +- ...-option-to-prevent-player-names-fro.patch} | 4 +- ...leAppender-for-console-improvements.patch} | 4 +- ...rable-option-to-disable-creeper-lin.patch} | 4 +- ....patch => 0212-Item-canEntityPickup.patch} | 4 +- ...layerPickupItemEvent-setFlyAtPlayer.patch} | 4 +- ...> 0214-PlayerAttemptPickupItemEvent.patch} | 6 +- ...tch => 0215-Add-UnknownCommandEvent.patch} | 4 +- ... 0216-Shoulder-Entities-Release-API.patch} | 8 +- ...patch => 0217-Profile-Lookup-Events.patch} | 6 +- ...layer-logins-during-server-shutdown.patch} | 4 +- ...patch => 0219-Entity-fromMobSpawner.patch} | 6 +- ...0220-Fix-Anvil-Level-sync-to-client.patch} | 8 +- ...ages-for-getTileEntity-in-order-to-.patch} | 4 +- ...-Player-Sample-in-ServerListPingEve.patch} | 4 +- ...3-Improve-the-Saddle-API-for-Horses.patch} | 4 +- ...plement-ensureServerConversions-API.patch} | 4 +- ...> 0225-Implement-getI18NDisplayName.patch} | 4 +- ...ving-disabled-before-unloading-all-.patch} | 4 +- ...=> 0227-ProfileWhitelistVerifyEvent.patch} | 4 +- ...ch => 0228-Fix-this-stupid-bullshit.patch} | 6 +- ...wns-should-honor-nametags-and-leash.patch} | 6 +- ...mer-when-spawner-event-is-cancelled.patch} | 4 +- ...x-dragon-egg-falling-in-lazy-chunks.patch} | 6 +- ...2-Fix-MC-117075-TE-Unload-Lag-Spike.patch} | 4 +- ...a-custom-authentication-servers-dow.patch} | 8 +- ...atch => 0234-LivingEntity-setKiller.patch} | 4 +- ...E-during-CraftBlockEntityState-load.patch} | 4 +- Spigot-Server-Patches/0236-Anti-Xray.patch | 1583 +++++++++++++++++ scripts/importmcdev.sh | 3 + 72 files changed, 1835 insertions(+), 293 deletions(-) delete mode 100644 Spigot-Server-Patches/0169-Optimise-NetworkManager.patch rename Spigot-Server-Patches/{0170-Optimise-removeQueue.patch => 0169-Optimise-removeQueue.patch} (95%) rename Spigot-Server-Patches/{0171-Allow-Reloading-of-Command-Aliases.patch => 0170-Allow-Reloading-of-Command-Aliases.patch} (94%) rename Spigot-Server-Patches/{0172-Add-source-to-PlayerExpChangeEvent.patch => 0171-Add-source-to-PlayerExpChangeEvent.patch} (97%) rename Spigot-Server-Patches/{0173-Optimize-World.isLoaded-BlockPosition-Z.patch => 0172-Optimize-World.isLoaded-BlockPosition-Z.patch} (87%) rename Spigot-Server-Patches/{0174-Speedup-BlockPos-by-fixing-inlining.patch => 0173-Speedup-BlockPos-by-fixing-inlining.patch} (98%) rename Spigot-Server-Patches/{0175-Don-t-let-fishinghooks-use-portals.patch => 0174-Don-t-let-fishinghooks-use-portals.patch} (90%) rename Spigot-Server-Patches/{0176-Add-ProjectileCollideEvent.patch => 0175-Add-ProjectileCollideEvent.patch} (98%) rename Spigot-Server-Patches/{0177-Vanished-players-don-t-have-rights.patch => 0176-Vanished-players-don-t-have-rights.patch} (98%) rename Spigot-Server-Patches/{0178-Prevent-Pathfinding-out-of-World-Border.patch => 0177-Prevent-Pathfinding-out-of-World-Border.patch} (93%) rename Spigot-Server-Patches/{0179-Bound-Treasure-Maps-to-World-Border.patch => 0178-Bound-Treasure-Maps-to-World-Border.patch} (94%) rename Spigot-Server-Patches/{0180-Configurable-Cartographer-Treasure-Maps.patch => 0179-Configurable-Cartographer-Treasure-Maps.patch} (94%) rename Spigot-Server-Patches/{0181-Optimize-ItemStack.isEmpty.patch => 0180-Optimize-ItemStack.isEmpty.patch} (91%) rename Spigot-Server-Patches/{0182-Add-API-methods-to-control-if-armour-stands-can-move.patch => 0181-Add-API-methods-to-control-if-armour-stands-can-move.patch} (92%) rename Spigot-Server-Patches/{0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch => 0182-Option-to-prevent-armor-stands-from-doing-entity-loo.patch} (92%) rename Spigot-Server-Patches/{0184-Add-option-to-remove-invalid-statistics.patch => 0183-Add-option-to-remove-invalid-statistics.patch} (94%) rename Spigot-Server-Patches/{0185-IllegalPacketEvent.patch => 0184-IllegalPacketEvent.patch} (97%) rename Spigot-Server-Patches/{0186-Properly-fix-item-duplication-bug.patch => 0185-Properly-fix-item-duplication-bug.patch} (93%) rename Spigot-Server-Patches/{0187-String-based-Action-Bar-API.patch => 0186-String-based-Action-Bar-API.patch} (97%) rename Spigot-Server-Patches/{0188-Activation-Range-Improvements.patch => 0187-Activation-Range-Improvements.patch} (95%) rename Spigot-Server-Patches/{0189-Firework-API-s.patch => 0188-Firework-API-s.patch} (96%) rename Spigot-Server-Patches/{0190-PlayerTeleportEndGatewayEvent.patch => 0189-PlayerTeleportEndGatewayEvent.patch} (92%) rename Spigot-Server-Patches/{0191-ShulkerBox-Dupe-Prevention.patch => 0190-ShulkerBox-Dupe-Prevention.patch} (89%) rename Spigot-Server-Patches/{0192-Provide-E-TE-Chunk-count-stat-methods.patch => 0191-Provide-E-TE-Chunk-count-stat-methods.patch} (93%) rename Spigot-Server-Patches/{0193-Enforce-Sync-Player-Saves.patch => 0192-Enforce-Sync-Player-Saves.patch} (90%) rename Spigot-Server-Patches/{0194-Enforce-Sync-Chunk-Unloads.patch => 0193-Enforce-Sync-Chunk-Unloads.patch} (91%) rename Spigot-Server-Patches/{0195-Don-t-allow-entities-to-ride-themselves-572.patch => 0194-Don-t-allow-entities-to-ride-themselves-572.patch} (87%) rename Spigot-Server-Patches/{0196-Fix-block-break-desync.patch => 0195-Fix-block-break-desync.patch} (88%) rename Spigot-Server-Patches/{0197-Assign-the-World-in-WorldGenStronghold.patch => 0196-Assign-the-World-in-WorldGenStronghold.patch} (86%) rename Spigot-Server-Patches/{0198-Add-fromBottle-flag-to-Experience-Orbs.patch => 0197-Add-fromBottle-flag-to-Experience-Orbs.patch} (93%) rename Spigot-Server-Patches/{0199-Remove-the-Vanilla-Method-Profiler.patch => 0198-Remove-the-Vanilla-Method-Profiler.patch} (97%) rename Spigot-Server-Patches/{0200-Cap-Entity-Collisions.patch => 0199-Cap-Entity-Collisions.patch} (96%) rename Spigot-Server-Patches/{0201-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch => 0200-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch} (92%) rename Spigot-Server-Patches/{0202-Remove-CraftScheduler-Async-Task-Debugger.patch => 0201-Remove-CraftScheduler-Async-Task-Debugger.patch} (96%) rename Spigot-Server-Patches/{0203-Shame-on-you-Mojang.patch => 0202-Shame-on-you-Mojang.patch} (95%) rename Spigot-Server-Patches/{0204-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch => 0203-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch} (90%) rename Spigot-Server-Patches/{0205-Do-not-let-armorstands-drown.patch => 0204-Do-not-let-armorstands-drown.patch} (94%) rename Spigot-Server-Patches/{0206-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch => 0205-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch} (89%) rename Spigot-Server-Patches/{0207-Properly-handle-async-calls-to-restart-the-server.patch => 0206-Properly-handle-async-calls-to-restart-the-server.patch} (99%) rename Spigot-Server-Patches/{0208-Add-system-property-to-disable-book-size-limits.patch => 0207-Add-system-property-to-disable-book-size-limits.patch} (96%) rename Spigot-Server-Patches/{0209-Add-option-to-make-parrots-stay-on-shoulders-despite.patch => 0208-Add-option-to-make-parrots-stay-on-shoulders-despite.patch} (96%) rename Spigot-Server-Patches/{0210-Add-configuration-option-to-prevent-player-names-fro.patch => 0209-Add-configuration-option-to-prevent-player-names-fro.patch} (94%) rename Spigot-Server-Patches/{0211-Use-TerminalConsoleAppender-for-console-improvements.patch => 0210-Use-TerminalConsoleAppender-for-console-improvements.patch} (99%) rename Spigot-Server-Patches/{0212-provide-a-configurable-option-to-disable-creeper-lin.patch => 0211-provide-a-configurable-option-to-disable-creeper-lin.patch} (95%) rename Spigot-Server-Patches/{0213-Item-canEntityPickup.patch => 0212-Item-canEntityPickup.patch} (97%) rename Spigot-Server-Patches/{0214-PlayerPickupItemEvent-setFlyAtPlayer.patch => 0213-PlayerPickupItemEvent-setFlyAtPlayer.patch} (96%) rename Spigot-Server-Patches/{0215-PlayerAttemptPickupItemEvent.patch => 0214-PlayerAttemptPickupItemEvent.patch} (93%) rename Spigot-Server-Patches/{0216-Add-UnknownCommandEvent.patch => 0215-Add-UnknownCommandEvent.patch} (95%) rename Spigot-Server-Patches/{0217-Shoulder-Entities-Release-API.patch => 0216-Shoulder-Entities-Release-API.patch} (96%) rename Spigot-Server-Patches/{0218-Profile-Lookup-Events.patch => 0217-Profile-Lookup-Events.patch} (92%) rename Spigot-Server-Patches/{0219-Block-player-logins-during-server-shutdown.patch => 0218-Block-player-logins-during-server-shutdown.patch} (93%) rename Spigot-Server-Patches/{0220-Entity-fromMobSpawner.patch => 0219-Entity-fromMobSpawner.patch} (96%) rename Spigot-Server-Patches/{0221-Fix-Anvil-Level-sync-to-client.patch => 0220-Fix-Anvil-Level-sync-to-client.patch} (93%) rename Spigot-Server-Patches/{0222-Add-missing-coverages-for-getTileEntity-in-order-to-.patch => 0221-Add-missing-coverages-for-getTileEntity-in-order-to-.patch} (93%) rename Spigot-Server-Patches/{0223-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch => 0222-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch} (97%) rename Spigot-Server-Patches/{0224-Improve-the-Saddle-API-for-Horses.patch => 0223-Improve-the-Saddle-API-for-Horses.patch} (97%) rename Spigot-Server-Patches/{0225-Implement-ensureServerConversions-API.patch => 0224-Implement-ensureServerConversions-API.patch} (92%) rename Spigot-Server-Patches/{0226-Implement-getI18NDisplayName.patch => 0225-Implement-getI18NDisplayName.patch} (94%) rename Spigot-Server-Patches/{0227-GH-806-Respect-saving-disabled-before-unloading-all-.patch => 0226-GH-806-Respect-saving-disabled-before-unloading-all-.patch} (92%) rename Spigot-Server-Patches/{0228-ProfileWhitelistVerifyEvent.patch => 0227-ProfileWhitelistVerifyEvent.patch} (97%) rename Spigot-Server-Patches/{0229-Fix-this-stupid-bullshit.patch => 0228-Fix-this-stupid-bullshit.patch} (93%) rename Spigot-Server-Patches/{0230-Ocelot-despawns-should-honor-nametags-and-leash.patch => 0229-Ocelot-despawns-should-honor-nametags-and-leash.patch} (88%) rename Spigot-Server-Patches/{0231-Reset-spawner-timer-when-spawner-event-is-cancelled.patch => 0230-Reset-spawner-timer-when-spawner-event-is-cancelled.patch} (94%) rename Spigot-Server-Patches/{0232-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch => 0231-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch} (89%) rename Spigot-Server-Patches/{0233-Fix-MC-117075-TE-Unload-Lag-Spike.patch => 0232-Fix-MC-117075-TE-Unload-Lag-Spike.patch} (96%) rename Spigot-Server-Patches/{0234-Allow-specifying-a-custom-authentication-servers-dow.patch => 0233-Allow-specifying-a-custom-authentication-servers-dow.patch} (94%) rename Spigot-Server-Patches/{0235-LivingEntity-setKiller.patch => 0234-LivingEntity-setKiller.patch} (93%) rename Spigot-Server-Patches/{0236-Avoid-NPE-during-CraftBlockEntityState-load.patch => 0235-Avoid-NPE-during-CraftBlockEntityState-load.patch} (95%) create mode 100644 Spigot-Server-Patches/0236-Anti-Xray.patch diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index 6af59ab027..faa78f0620 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -1,4 +1,4 @@ -From d96016cb6d0bc3a710cf6e081872d2f4117e1dda Mon Sep 17 00:00:00 2001 +From f44918d9a3c234a2be57605bd9752b9908e12784 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 19:36:20 -0400 Subject: [PATCH] MC Dev fixes @@ -44,7 +44,7 @@ index 71524f2cd..288c52c55 100644 } diff --git a/src/main/java/net/minecraft/server/CommandAbstract.java b/src/main/java/net/minecraft/server/CommandAbstract.java -index 14a7b9c92..8b703db42 100644 +index 76501e299..67cadecbb 100644 --- a/src/main/java/net/minecraft/server/CommandAbstract.java +++ b/src/main/java/net/minecraft/server/CommandAbstract.java @@ -231,7 +231,7 @@ public abstract class CommandAbstract implements ICommand { @@ -83,6 +83,28 @@ index 14a7b9c92..8b703db42 100644 return this.a((ICommand) object); } +diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java +index 58f47d0de..8860a0129 100644 +--- a/src/main/java/net/minecraft/server/RegistryBlockID.java ++++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +@@ -8,7 +8,7 @@ import java.util.Iterator; + import java.util.List; + import javax.annotation.Nullable; + +-public class RegistryBlockID implements Registry { ++public class RegistryBlockID implements Registry { // Paper - Fix decompile error + + private final IdentityHashMap a; + private final List b; +@@ -26,7 +26,7 @@ public class RegistryBlockID implements Registry { + this.a.put(t0, Integer.valueOf(i)); + + while (this.b.size() <= i) { +- this.b.add((Object) null); ++ this.b.add(null); // Paper - Fix decompile error + } + + this.b.set(i, t0); diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java index f5bcbdbe1..3190cadfc 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemFactoryTest.java @@ -97,5 +119,5 @@ index f5bcbdbe1..3190cadfc 100644 for (ZipEntry clazzEntry; (clazzEntry = nmsZipStream.getNextEntry()) != null; ) { final String entryName = clazzEntry.getName(); -- -2.13.0 +2.14.2 diff --git a/Spigot-Server-Patches/0005-MC-Utils.patch b/Spigot-Server-Patches/0005-MC-Utils.patch index 19409f2bb7..6cde1ce2fd 100644 --- a/Spigot-Server-Patches/0005-MC-Utils.patch +++ b/Spigot-Server-Patches/0005-MC-Utils.patch @@ -1,13 +1,22 @@ -From 2ff1a095a26d78e4e5de5a878259f8094cbb0d90 Mon Sep 17 00:00:00 2001 +From 6b1f6a4395784e4baa167d1552735368f74404a2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:55:47 -0400 Subject: [PATCH] MC Utils diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 38d69b944..7fee74d80 100644 +index 4bbebb25a..c4d9344a7 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -20,7 +20,7 @@ import org.bukkit.Server; // CraftBukkit + public class Chunk { + + private static final Logger e = LogManager.getLogger(); +- public static final ChunkSection a = null; ++ public static final ChunkSection a = null; public static final ChunkSection EMPTY_CHUNK_SECTION = Chunk.a; // Paper - OBFHELPER + private final ChunkSection[] sections; + private final byte[] g; + private final int[] h; @@ -675,6 +675,7 @@ public class Chunk { return !block.isTileEntity() ? null : ((ITileEntity) block).a(this.world, iblockdata.getBlock().toLegacyData(iblockdata)); } @@ -16,6 +25,19 @@ index 38d69b944..7fee74d80 100644 @Nullable public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { // CraftBukkit start +diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java +index 1f2fe87b6..2cb462b8e 100644 +--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java ++++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java +@@ -5,7 +5,7 @@ import javax.annotation.Nullable; + public class DataPaletteBlock implements DataPaletteExpandable { + + private static final DataPalette d = new DataPaletteGlobal(); +- protected static final IBlockData a = Blocks.AIR.getBlockData(); ++ protected static final IBlockData a = Blocks.AIR.getBlockData(); public static final IBlockData DEFAULT_BLOCK_DATA = DataPaletteBlock.a; // Paper - OBFHELPER + protected DataBits b; + protected DataPalette c; + private int e; diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 index 000000000..1159eea1a @@ -252,5 +274,5 @@ index e0cb6aa6e..bc6383669 100644 public NBTTagList() {} -- -2.13.0 +2.14.2 diff --git a/Spigot-Server-Patches/0169-Optimise-NetworkManager.patch b/Spigot-Server-Patches/0169-Optimise-NetworkManager.patch deleted file mode 100644 index 0e6539e36d..0000000000 --- a/Spigot-Server-Patches/0169-Optimise-NetworkManager.patch +++ /dev/null @@ -1,88 +0,0 @@ -From fa201a9b717a5ae06c7572fcaa0811eb210d8a00 Mon Sep 17 00:00:00 2001 -From: Alfie Cleveland -Date: Fri, 25 Nov 2016 20:35:05 +0000 -Subject: [PATCH] Optimise NetworkManager - - -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index d583cced..89743d2b 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -62,8 +62,8 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - } - }; - private final EnumProtocolDirection h; -- private final Queue i = Queues.newConcurrentLinkedQueue(); -- private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); -+ // private final Queue i = Queues.newConcurrentLinkedQueue(); // Paper -+ // private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); // Paper - public Channel channel; - // Spigot Start // PAIL - public SocketAddress l; -@@ -141,32 +141,14 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - if (this.isConnected()) { - this.m(); - this.a(packet, (GenericFutureListener[]) null); -- } else { -- this.j.writeLock().lock(); -- -- try { -- this.i.add(new NetworkManager.QueuedPacket(packet, new GenericFutureListener[0])); -- } finally { -- this.j.writeLock().unlock(); -- } - } -- - } - - public void sendPacket(Packet packet, GenericFutureListener> genericfuturelistener, GenericFutureListener>... agenericfuturelistener) { - if (this.isConnected()) { - this.m(); - this.a(packet, (GenericFutureListener[]) ArrayUtils.add(agenericfuturelistener, 0, genericfuturelistener)); -- } else { -- this.j.writeLock().lock(); -- -- try { -- this.i.add(new NetworkManager.QueuedPacket(packet, (GenericFutureListener[]) ArrayUtils.add(agenericfuturelistener, 0, genericfuturelistener))); -- } finally { -- this.j.writeLock().unlock(); -- } - } -- - } - - private void a(final Packet packet, @Nullable final GenericFutureListener>[] agenericfuturelistener) { -@@ -211,20 +193,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - } - - private void m() { -- if (this.channel != null && this.channel.isOpen()) { -- this.j.readLock().lock(); -- -- try { -- while (!this.i.isEmpty()) { -- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.i.poll(); -- -- this.a(networkmanager_queuedpacket.a, networkmanager_queuedpacket.b); -- } -- } finally { -- this.j.readLock().unlock(); -- } -- -- } -+ // Paper - Contents removed - } - - public void a() { -@@ -320,7 +289,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - } else if (this.i() != null) { - this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0])); - } -- this.i.clear(); // Free up packet queue. -+ // this.i.clear(); // Free up packet queue. // Paper - remove unneeded packet queue - } - - } --- -2.13.1.windows.2 - diff --git a/Spigot-Server-Patches/0170-Optimise-removeQueue.patch b/Spigot-Server-Patches/0169-Optimise-removeQueue.patch similarity index 95% rename from Spigot-Server-Patches/0170-Optimise-removeQueue.patch rename to Spigot-Server-Patches/0169-Optimise-removeQueue.patch index 439844c4c8..a6b40d27c6 100644 --- a/Spigot-Server-Patches/0170-Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/0169-Optimise-removeQueue.patch @@ -1,11 +1,11 @@ -From 40a8cfaaa06855558e2bde433738ee629bcce1a6 Mon Sep 17 00:00:00 2001 +From 7afee50d20f36a17db863aef658144e885105110 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Fri, 25 Nov 2016 13:22:40 +0000 Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 8fb569be..df2e607d 100644 +index e8b78b51a..53147c6e2 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -3,8 +3,10 @@ package net.minecraft.server; @@ -61,5 +61,5 @@ index 8fb569be..df2e607d 100644 this.cv = entityplayer.cv; this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0171-Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/0170-Allow-Reloading-of-Command-Aliases.patch similarity index 94% rename from Spigot-Server-Patches/0171-Allow-Reloading-of-Command-Aliases.patch rename to Spigot-Server-Patches/0170-Allow-Reloading-of-Command-Aliases.patch index b337fc97b0..bac6b8f06b 100644 --- a/Spigot-Server-Patches/0171-Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/0170-Allow-Reloading-of-Command-Aliases.patch @@ -1,4 +1,4 @@ -From 27326fc9080806c4213bd311c9f8faad37abd804 Mon Sep 17 00:00:00 2001 +From 0d2536e60ec8f1c70ca0fe5df04dcb65e123f3c4 Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 28 Nov 2016 10:21:52 -0500 Subject: [PATCH] Allow Reloading of Command Aliases @@ -35,5 +35,5 @@ index d40b13c6e..5bbb09c9d 100644 // Paper end } -- -2.14.1.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0172-Add-source-to-PlayerExpChangeEvent.patch b/Spigot-Server-Patches/0171-Add-source-to-PlayerExpChangeEvent.patch similarity index 97% rename from Spigot-Server-Patches/0172-Add-source-to-PlayerExpChangeEvent.patch rename to Spigot-Server-Patches/0171-Add-source-to-PlayerExpChangeEvent.patch index a696e9b403..a7ddca6077 100644 --- a/Spigot-Server-Patches/0172-Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-Server-Patches/0171-Add-source-to-PlayerExpChangeEvent.patch @@ -1,4 +1,4 @@ -From a0f07e693a7588b712572531456ce10d93fc2284 Mon Sep 17 00:00:00 2001 +From b9cf0c402f2c29fa10934108747fc075759462eb Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Thu, 8 Sep 2016 08:48:33 -0700 Subject: [PATCH] Add source to PlayerExpChangeEvent @@ -48,5 +48,5 @@ index bdeeac36f..7422a91f0 100644 Block block = world.getWorld().getBlockAt(x, y, z); CraftBlockState state = (CraftBlockState) block.getState(); -- -2.13.2 +2.14.2 diff --git a/Spigot-Server-Patches/0173-Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/0172-Optimize-World.isLoaded-BlockPosition-Z.patch similarity index 87% rename from Spigot-Server-Patches/0173-Optimize-World.isLoaded-BlockPosition-Z.patch rename to Spigot-Server-Patches/0172-Optimize-World.isLoaded-BlockPosition-Z.patch index 87848e808f..7ec6a43ef5 100644 --- a/Spigot-Server-Patches/0173-Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/Spigot-Server-Patches/0172-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -1,4 +1,4 @@ -From b495a4c3b32ad02d02084cba9b399321fbb0ad5f Mon Sep 17 00:00:00 2001 +From 828a1726d978ac9d0588a4228e4b9de9c2c15dca Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 2 Dec 2016 00:11:43 -0500 Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6b368216e..de11ef617 100644 +index a2b5926a1..445936c7b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -290,7 +290,7 @@ public abstract class World implements IBlockAccess { @@ -19,5 +19,5 @@ index 6b368216e..de11ef617 100644 public boolean a(BlockPosition blockposition, boolean flag) { -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0174-Speedup-BlockPos-by-fixing-inlining.patch b/Spigot-Server-Patches/0173-Speedup-BlockPos-by-fixing-inlining.patch similarity index 98% rename from Spigot-Server-Patches/0174-Speedup-BlockPos-by-fixing-inlining.patch rename to Spigot-Server-Patches/0173-Speedup-BlockPos-by-fixing-inlining.patch index 8651536329..2a9b1b0e93 100644 --- a/Spigot-Server-Patches/0174-Speedup-BlockPos-by-fixing-inlining.patch +++ b/Spigot-Server-Patches/0173-Speedup-BlockPos-by-fixing-inlining.patch @@ -1,4 +1,4 @@ -From 9532738f11a4563b57e61ebf94c2109b3c2ef211 Mon Sep 17 00:00:00 2001 +From d66ad0e6ed1fa7d6cd87caee8b0591020c96d362 Mon Sep 17 00:00:00 2001 From: Techcable Date: Wed, 30 Nov 2016 20:56:58 -0600 Subject: [PATCH] Speedup BlockPos by fixing inlining @@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt They had 'callq' (invoke) instead of 'mov' (get from memory) instructions. diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 679d5504..8e737718 100644 +index 679d5504e..8e737718e 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -7,11 +7,12 @@ import javax.annotation.concurrent.Immutable; @@ -66,7 +66,7 @@ index 679d5504..8e737718 100644 public BaseBlockPosition d(BaseBlockPosition baseblockposition) { return new BaseBlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX()); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index b3c1f550..6a0b3a62 100644 +index b3c1f550c..6a0b3a62d 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -211,19 +211,21 @@ public class BlockPosition extends BaseBlockPosition { @@ -177,5 +177,5 @@ index b3c1f550..6a0b3a62 100644 public BlockPosition h() { -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0175-Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/0174-Don-t-let-fishinghooks-use-portals.patch similarity index 90% rename from Spigot-Server-Patches/0175-Don-t-let-fishinghooks-use-portals.patch rename to Spigot-Server-Patches/0174-Don-t-let-fishinghooks-use-portals.patch index dadf88011e..125e045ee4 100644 --- a/Spigot-Server-Patches/0175-Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/0174-Don-t-let-fishinghooks-use-portals.patch @@ -1,11 +1,11 @@ -From 77dc690ea1c5f9cc188ef8cab6a4c0c4c5105369 Mon Sep 17 00:00:00 2001 +From c6d1d4e466c703108bebad80f9715753077ead19 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 16 Dec 2016 16:03:19 -0600 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 0a8d8a1a..e6b469a0 100644 +index ffd4d836b..a042c37c7 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -144,7 +144,7 @@ public abstract class Entity implements ICommandListener { @@ -18,7 +18,7 @@ index 0a8d8a1a..e6b469a0 100644 public int dimension; protected BlockPosition an; diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 339d1f1b..7f011aef 100644 +index 339d1f1b1..7f011aef8 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -185,6 +185,12 @@ public class EntityFishingHook extends Entity { @@ -35,5 +35,5 @@ index 339d1f1b..7f011aef 100644 } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0176-Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/0175-Add-ProjectileCollideEvent.patch similarity index 98% rename from Spigot-Server-Patches/0176-Add-ProjectileCollideEvent.patch rename to Spigot-Server-Patches/0175-Add-ProjectileCollideEvent.patch index 55b3dfc00c..0798dcdd21 100644 --- a/Spigot-Server-Patches/0176-Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/0175-Add-ProjectileCollideEvent.patch @@ -1,4 +1,4 @@ -From 4cda6abfb75a1e47090cf7c87aac477a69da019a Mon Sep 17 00:00:00 2001 +From 7c179086ea4e84afc3bcfb4f28513a0ce33bba44 Mon Sep 17 00:00:00 2001 From: Techcable Date: Fri, 16 Dec 2016 21:25:39 -0600 Subject: [PATCH] Add ProjectileCollideEvent @@ -66,7 +66,7 @@ index 7f011aef8..6ac89d1e3 100644 vec3d1 = new Vec3D(movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z); } diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 3d3c1f5f9..0415c521d 100644 +index cfcaf3832..01c7fcc8b 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -160,6 +160,15 @@ public abstract class EntityProjectile extends Entity implements IProjectile { @@ -107,5 +107,5 @@ index 7422a91f0..16f6410b2 100644 Projectile bukkitEntity = (Projectile) entity.getBukkitEntity(); ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity); -- -2.13.2 +2.14.2 diff --git a/Spigot-Server-Patches/0177-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0176-Vanished-players-don-t-have-rights.patch similarity index 98% rename from Spigot-Server-Patches/0177-Vanished-players-don-t-have-rights.patch rename to Spigot-Server-Patches/0176-Vanished-players-don-t-have-rights.patch index c0215bb5f3..e70ba0a71b 100644 --- a/Spigot-Server-Patches/0177-Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0176-Vanished-players-don-t-have-rights.patch @@ -1,4 +1,4 @@ -From 0f2721ccf07d4698f377874093f70525616612ce Mon Sep 17 00:00:00 2001 +From 1cc4d5c4bd56750665addda72b522ae03480e5db Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 16 Dec 2016 22:10:35 -0600 Subject: [PATCH] Vanished players don't have rights @@ -96,5 +96,5 @@ index 16f6410b2..883ef489f 100644 return event; } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0178-Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/0177-Prevent-Pathfinding-out-of-World-Border.patch similarity index 93% rename from Spigot-Server-Patches/0178-Prevent-Pathfinding-out-of-World-Border.patch rename to Spigot-Server-Patches/0177-Prevent-Pathfinding-out-of-World-Border.patch index bad8840d86..2a97f9b77a 100644 --- a/Spigot-Server-Patches/0178-Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/0177-Prevent-Pathfinding-out-of-World-Border.patch @@ -1,4 +1,4 @@ -From 9a65260de4bb5ebafdd7f927be87a0766f11bfab Mon Sep 17 00:00:00 2001 +From cbabd72bb30424273efa4f0e1208c71a18867ca3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 19 Dec 2016 23:07:42 -0500 Subject: [PATCH] Prevent Pathfinding out of World Border @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent Pathfinding out of World Border This prevents Entities from trying to run outside of the World Border diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 3ac6f84d..935b2e81 100644 +index 3ac6f84d3..935b2e81e 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -69,6 +69,7 @@ public abstract class NavigationAbstract { @@ -26,7 +26,7 @@ index 3ac6f84d..935b2e81 100644 if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { return this.c; diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 9038d52e..632eb1c9 100644 +index 9038d52eb..632eb1c9d 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -29,7 +29,7 @@ public class WorldBorder { @@ -39,5 +39,5 @@ index 9038d52e..632eb1c9 100644 } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0179-Bound-Treasure-Maps-to-World-Border.patch b/Spigot-Server-Patches/0178-Bound-Treasure-Maps-to-World-Border.patch similarity index 94% rename from Spigot-Server-Patches/0179-Bound-Treasure-Maps-to-World-Border.patch rename to Spigot-Server-Patches/0178-Bound-Treasure-Maps-to-World-Border.patch index f6032273d2..f82c176408 100644 --- a/Spigot-Server-Patches/0179-Bound-Treasure-Maps-to-World-Border.patch +++ b/Spigot-Server-Patches/0178-Bound-Treasure-Maps-to-World-Border.patch @@ -1,4 +1,4 @@ -From 62903803744076053bb0aa8bcba062aac2a83342 Mon Sep 17 00:00:00 2001 +From dc1d7a66413d919af3fcbdb4825553e27ef47087 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:15:11 -0500 Subject: [PATCH] Bound Treasure Maps to World Border @@ -11,7 +11,7 @@ that is outside happens to be closer, but unreachable, yet another reachable one is in border that would of been missed. diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 078957aa..7b635d3f 100644 +index 078957aac..7b635d3fa 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java @@ -236,6 +236,9 @@ public abstract class StructureGenerator extends WorldGenBase { @@ -25,7 +25,7 @@ index 078957aa..7b635d3f 100644 if (!flag1 || !world.b(l2, i3)) { return new BlockPosition((l2 << 4) + 8, 64, (i3 << 4) + 8); diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 632eb1c9..1bb172bb 100644 +index 632eb1c9d..1bb172bbf 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -33,6 +33,18 @@ public class WorldBorder { @@ -48,5 +48,5 @@ index 632eb1c9..1bb172bb 100644 return (double) chunkcoordintpair.e() > this.b() && (double) chunkcoordintpair.c() < this.d() && (double) chunkcoordintpair.f() > this.c() && (double) chunkcoordintpair.d() < this.e(); } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0180-Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/0179-Configurable-Cartographer-Treasure-Maps.patch similarity index 94% rename from Spigot-Server-Patches/0180-Configurable-Cartographer-Treasure-Maps.patch rename to Spigot-Server-Patches/0179-Configurable-Cartographer-Treasure-Maps.patch index db9f5aa688..3f4a528ad0 100644 --- a/Spigot-Server-Patches/0180-Configurable-Cartographer-Treasure-Maps.patch +++ b/Spigot-Server-Patches/0179-Configurable-Cartographer-Treasure-Maps.patch @@ -1,4 +1,4 @@ -From f4a1622b086019d10c6fe4694ebec9cd9c4b5e91 Mon Sep 17 00:00:00 2001 +From 7d2695a42ff73a0761934735c1e8c081aad4c778 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:26:27 -0500 Subject: [PATCH] Configurable Cartographer Treasure Maps @@ -9,7 +9,7 @@ Also allow turning off treasure maps all together as they can eat up Map ID's which are limited in quantity. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a80d8b2a..32ca0a40 100644 +index a80d8b2ac..32ca0a40e 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -395,4 +395,14 @@ public class PaperWorldConfig { @@ -28,7 +28,7 @@ index a80d8b2a..32ca0a40 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index ae68f07a..35221dec 100644 +index ae68f07ab..35221decf 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -767,7 +767,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -41,5 +41,5 @@ index ae68f07a..35221dec 100644 if (blockposition != null) { ItemStack itemstack = ItemWorldMap.a(world, (double) blockposition.getX(), (double) blockposition.getZ(), (byte) 2, true, true); -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0181-Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/0180-Optimize-ItemStack.isEmpty.patch similarity index 91% rename from Spigot-Server-Patches/0181-Optimize-ItemStack.isEmpty.patch rename to Spigot-Server-Patches/0180-Optimize-ItemStack.isEmpty.patch index e21602ed19..0fcf2691d9 100644 --- a/Spigot-Server-Patches/0181-Optimize-ItemStack.isEmpty.patch +++ b/Spigot-Server-Patches/0180-Optimize-ItemStack.isEmpty.patch @@ -1,4 +1,4 @@ -From e5dde989e3b6bf034318d920ed8ed37da169b2d9 Mon Sep 17 00:00:00 2001 +From 26b973aadf97eaaa7083ac46b35ae44ad3737f9b Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 21 Dec 2016 03:48:29 -0500 Subject: [PATCH] Optimize ItemStack.isEmpty() @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize ItemStack.isEmpty() Remove hashMap lookup every check, simplify code to remove ternary diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 0dcea61d..3aefb023 100644 +index 0dcea61d2..3aefb023e 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -126,9 +126,15 @@ public final class ItemStack { @@ -27,5 +27,5 @@ index 0dcea61d..3aefb023 100644 public static void a(DataConverterManager dataconvertermanager) { dataconvertermanager.a(DataConverterTypes.ITEM_INSTANCE, (DataInspector) (new DataInspectorBlockEntity())); -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0182-Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-Server-Patches/0181-Add-API-methods-to-control-if-armour-stands-can-move.patch similarity index 92% rename from Spigot-Server-Patches/0182-Add-API-methods-to-control-if-armour-stands-can-move.patch rename to Spigot-Server-Patches/0181-Add-API-methods-to-control-if-armour-stands-can-move.patch index fc98371304..f35f66f647 100644 --- a/Spigot-Server-Patches/0182-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-Server-Patches/0181-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -1,11 +1,11 @@ -From 1deed3fc3cac67faa2ae6a5e5eff15e322ad50fd Mon Sep 17 00:00:00 2001 +From 478aa5503a8330df7b3f266a55185ef1477116d6 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 21 Dec 2016 11:47:25 -0600 Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index b0324509..036498c0 100644 +index 5603a3746..fcbfcd6a9 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -50,6 +50,7 @@ public class EntityArmorStand extends EntityLiving { @@ -31,7 +31,7 @@ index b0324509..036498c0 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 2b66a08a..8a06cb16 100644 +index 2b66a08ad..8a06cb165 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -211,4 +211,14 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { @@ -50,5 +50,5 @@ index 2b66a08a..8a06cb16 100644 + } } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0182-Option-to-prevent-armor-stands-from-doing-entity-loo.patch similarity index 92% rename from Spigot-Server-Patches/0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch rename to Spigot-Server-Patches/0182-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 72ca5e5d46..836ed0f850 100644 --- a/Spigot-Server-Patches/0183-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0182-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -1,4 +1,4 @@ -From db77a614e7f10100de64a1cc512a5d6a479bbb4d Mon Sep 17 00:00:00 2001 +From e8c8ed97ba71d78ae174cda9add33a9b3c491b03 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 21 Dec 2016 11:52:04 -0600 Subject: [PATCH] Option to prevent armor stands from doing entity lookups @@ -19,7 +19,7 @@ index 32ca0a40e..70af657f5 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5bd721814..12938b9f8 100644 +index 843c944ab..30cf4a251 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1337,6 +1337,7 @@ public abstract class World implements IBlockAccess { @@ -31,5 +31,5 @@ index 5bd721814..12938b9f8 100644 for (int i = 0; i < list.size(); ++i) { -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0184-Add-option-to-remove-invalid-statistics.patch b/Spigot-Server-Patches/0183-Add-option-to-remove-invalid-statistics.patch similarity index 94% rename from Spigot-Server-Patches/0184-Add-option-to-remove-invalid-statistics.patch rename to Spigot-Server-Patches/0183-Add-option-to-remove-invalid-statistics.patch index 2cc825f6a3..cacf098cbd 100644 --- a/Spigot-Server-Patches/0184-Add-option-to-remove-invalid-statistics.patch +++ b/Spigot-Server-Patches/0183-Add-option-to-remove-invalid-statistics.patch @@ -1,11 +1,11 @@ -From 0669deb7227d69ad367ebeb8909d38276c5f26a3 Mon Sep 17 00:00:00 2001 +From b65841d8a709abafd2d9718ab97832770ab49ac2 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 20 Dec 2016 23:09:21 -0600 Subject: [PATCH] Add option to remove invalid statistics diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index da0984a3..28917f63 100644 +index da0984a35..28917f63d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -256,4 +256,13 @@ public class PaperConfig { @@ -23,7 +23,7 @@ index da0984a3..28917f63 100644 + } } diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java -index 14af226f..e3d2c0ff 100644 +index 14af226f3..e3d2c0ff7 100644 --- a/src/main/java/net/minecraft/server/ServerStatisticManager.java +++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java @@ -86,6 +86,7 @@ public class ServerStatisticManager extends StatisticManager { @@ -53,5 +53,5 @@ index 14af226f..e3d2c0ff 100644 } } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0185-IllegalPacketEvent.patch b/Spigot-Server-Patches/0184-IllegalPacketEvent.patch similarity index 97% rename from Spigot-Server-Patches/0185-IllegalPacketEvent.patch rename to Spigot-Server-Patches/0184-IllegalPacketEvent.patch index 750086930d..d454a2eeaf 100644 --- a/Spigot-Server-Patches/0185-IllegalPacketEvent.patch +++ b/Spigot-Server-Patches/0184-IllegalPacketEvent.patch @@ -1,4 +1,4 @@ -From 5bea86c4a8652cb0ced1c338dae4141495bd9370 Mon Sep 17 00:00:00 2001 +From ff2be849ba11f9a48cf7c1f157cf31114231cb6f Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 23 Jun 2016 23:33:57 -0400 Subject: [PATCH] IllegalPacketEvent @@ -6,7 +6,7 @@ Subject: [PATCH] IllegalPacketEvent Fired for invalid data from players that represents hacking attempts diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 98a63dc0e..f82a81178 100644 +index 02b5e3cad..52e8458ab 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -56,6 +56,7 @@ import org.bukkit.inventory.CraftingInventory; @@ -68,5 +68,5 @@ index 98a63dc0e..f82a81178 100644 } // CraftBukkit start -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0186-Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/0185-Properly-fix-item-duplication-bug.patch similarity index 93% rename from Spigot-Server-Patches/0186-Properly-fix-item-duplication-bug.patch rename to Spigot-Server-Patches/0185-Properly-fix-item-duplication-bug.patch index 75fdf9f55e..30f0f06255 100644 --- a/Spigot-Server-Patches/0186-Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/0185-Properly-fix-item-duplication-bug.patch @@ -1,4 +1,4 @@ -From 708d31da9dd0f79c0e0148ad106156691041b08a Mon Sep 17 00:00:00 2001 +From 2b98398add2b76cd4ee71f4f4733cf3fa8efdefa Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Tue, 27 Dec 2016 01:57:57 +0000 Subject: [PATCH] Properly fix item duplication bug @@ -19,7 +19,7 @@ index 53147c6e2..5fbb99b7e 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f82a81178..1dc9ddbb5 100644 +index 52e8458ab..bcc6c9707 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2626,6 +2626,6 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -31,5 +31,5 @@ index f82a81178..1dc9ddbb5 100644 } } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0187-String-based-Action-Bar-API.patch b/Spigot-Server-Patches/0186-String-based-Action-Bar-API.patch similarity index 97% rename from Spigot-Server-Patches/0187-String-based-Action-Bar-API.patch rename to Spigot-Server-Patches/0186-String-based-Action-Bar-API.patch index a200cfe085..64454b88c1 100644 --- a/Spigot-Server-Patches/0187-String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/0186-String-based-Action-Bar-API.patch @@ -1,4 +1,4 @@ -From 7a7a70f17bef67e3a2ef1aee652d0328cc38e8c8 Mon Sep 17 00:00:00 2001 +From 2a73ea267a6aa2b91a27fc0974decf7c14cca8e8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Dec 2016 15:02:42 -0500 Subject: [PATCH] String based Action Bar API @@ -85,5 +85,5 @@ index 41330c2a2..f30613672 100644 public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) { PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter(); -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0188-Activation-Range-Improvements.patch b/Spigot-Server-Patches/0187-Activation-Range-Improvements.patch similarity index 95% rename from Spigot-Server-Patches/0188-Activation-Range-Improvements.patch rename to Spigot-Server-Patches/0187-Activation-Range-Improvements.patch index f5c7b2957e..f8ce9525ed 100644 --- a/Spigot-Server-Patches/0188-Activation-Range-Improvements.patch +++ b/Spigot-Server-Patches/0187-Activation-Range-Improvements.patch @@ -1,4 +1,4 @@ -From 4f17df129d8d0f4f28ad092c8ca18517424aed37 Mon Sep 17 00:00:00 2001 +From 33f96c9d29daf8d704163555175bceb3bddb6d69 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Dec 2016 22:38:06 -0500 Subject: [PATCH] Activation Range Improvements @@ -6,7 +6,7 @@ Subject: [PATCH] Activation Range Improvements Fixes and adds new Immunities to improve gameplay behavior diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index 0c82c6f5..9659a45e 100644 +index 0c82c6f5b..9659a45ef 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -10,6 +10,7 @@ public abstract class EntityCreature extends EntityInsentient { @@ -18,7 +18,7 @@ index 0c82c6f5..9659a45e 100644 private float b; private final float c; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index e50f7a3c..194d55c3 100644 +index 3086a36f9..b437ebf26 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -73,7 +73,7 @@ public abstract class EntityLiving extends Entity { @@ -31,7 +31,7 @@ index e50f7a3c..194d55c3 100644 protected int ticksFarFromPlayer; protected float aW; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index dbda68dd..af49b727 100644 +index dbda68dd0..af49b7273 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -363,6 +363,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn @@ -43,7 +43,7 @@ index dbda68dd..af49b727 100644 return this.bL != null; } diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java -index 83d9c43f..1cb6652c 100644 +index 83d9c43f3..1cb6652c2 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoal.java +++ b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -18,7 +18,10 @@ public abstract class PathfinderGoal { @@ -59,7 +59,7 @@ index 83d9c43f..1cb6652c 100644 public void e() {} diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java -index e5b5e988..e3781f3a 100644 +index e5b5e9887..e3781f3a8 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java @@ -2,12 +2,21 @@ package net.minecraft.server; @@ -96,7 +96,7 @@ index e5b5e988..e3781f3a 100644 } } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 47865c02..b0856461 100644 +index 47865c027..b08564618 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -20,6 +20,7 @@ import net.minecraft.server.EntityFireball; @@ -141,5 +141,5 @@ index 47865c02..b0856461 100644 { EntityAnimal animal = (EntityAnimal) entity; -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0189-Firework-API-s.patch b/Spigot-Server-Patches/0188-Firework-API-s.patch similarity index 96% rename from Spigot-Server-Patches/0189-Firework-API-s.patch rename to Spigot-Server-Patches/0188-Firework-API-s.patch index ddd7fe42c5..44206cbc60 100644 --- a/Spigot-Server-Patches/0189-Firework-API-s.patch +++ b/Spigot-Server-Patches/0188-Firework-API-s.patch @@ -1,11 +1,11 @@ -From eec9365973ae5e3fde4b9a61cd2ea3b188ab20f9 Mon Sep 17 00:00:00 2001 +From 7638c8a37799c5840c91bad10444e8227b3f7fba Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 28 Dec 2016 01:18:33 -0500 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 48cdef5d..bd0ec95f 100644 +index 48cdef5db..bd0ec95f2 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java @@ -2,6 +2,8 @@ package net.minecraft.server; @@ -53,7 +53,7 @@ index 48cdef5d..bd0ec95f 100644 public boolean bd() { diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java -index b0bb4aa2..44a99721 100644 +index b0bb4aa23..44a997215 100644 --- a/src/main/java/net/minecraft/server/ItemFireworks.java +++ b/src/main/java/net/minecraft/server/ItemFireworks.java @@ -9,6 +9,7 @@ public class ItemFireworks extends Item { @@ -73,7 +73,7 @@ index b0bb4aa2..44a99721 100644 if (!entityhuman.abilities.canInstantlyBuild) { itemstack.subtract(1); diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index e15c2336..82c2537b 100644 +index e15c23367..82c2537b3 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -106,7 +106,7 @@ public class NBTTagCompound extends NBTBase { @@ -86,7 +86,7 @@ index e15c2336..82c2537b 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -index 99746b3c..d4fbe31d 100644 +index 99746b3c2..d4fbe31d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java @@ -1,6 +1,7 @@ @@ -129,5 +129,5 @@ index 99746b3c..d4fbe31d 100644 + // Paper end } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0190-PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0189-PlayerTeleportEndGatewayEvent.patch similarity index 92% rename from Spigot-Server-Patches/0190-PlayerTeleportEndGatewayEvent.patch rename to Spigot-Server-Patches/0189-PlayerTeleportEndGatewayEvent.patch index 00ea1450fe..6f012a488b 100644 --- a/Spigot-Server-Patches/0190-PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0189-PlayerTeleportEndGatewayEvent.patch @@ -1,4 +1,4 @@ -From 611173542ccfe256db8c7c694f65756b3ce582e0 Mon Sep 17 00:00:00 2001 +From 8af94befc901f7231aff3ae231dc24edc1efb011 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 31 Dec 2016 21:44:50 -0500 Subject: [PATCH] PlayerTeleportEndGatewayEvent @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 9bde14d9..ab2cd176 100644 +index cfce9274a..ecbc48b0c 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java @@ -124,7 +124,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick @@ -19,5 +19,5 @@ index 9bde14d9..ab2cd176 100644 if (teleEvent.isCancelled()) { return; -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0191-ShulkerBox-Dupe-Prevention.patch b/Spigot-Server-Patches/0190-ShulkerBox-Dupe-Prevention.patch similarity index 89% rename from Spigot-Server-Patches/0191-ShulkerBox-Dupe-Prevention.patch rename to Spigot-Server-Patches/0190-ShulkerBox-Dupe-Prevention.patch index 2a609be8fe..98b9c45a9f 100644 --- a/Spigot-Server-Patches/0191-ShulkerBox-Dupe-Prevention.patch +++ b/Spigot-Server-Patches/0190-ShulkerBox-Dupe-Prevention.patch @@ -1,4 +1,4 @@ -From b5c690860be38f0bd135c1ee4d81b4cfee5470bd Mon Sep 17 00:00:00 2001 +From 26307196e5e2bd90c47e5bfaf53207645394b84d Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 2 Jan 2017 16:32:56 -0500 Subject: [PATCH] ShulkerBox Dupe Prevention @@ -7,7 +7,7 @@ This ensures that Shulker Boxes can never drop their contents twice, and that the inventory is cleared incase it some how also got saved to the world. diff --git a/src/main/java/net/minecraft/server/BlockShulkerBox.java b/src/main/java/net/minecraft/server/BlockShulkerBox.java -index 8811eb3e..74e2e448 100644 +index 8811eb3e3..74e2e448f 100644 --- a/src/main/java/net/minecraft/server/BlockShulkerBox.java +++ b/src/main/java/net/minecraft/server/BlockShulkerBox.java @@ -112,6 +112,7 @@ public class BlockShulkerBox extends BlockTileEntity { @@ -19,5 +19,5 @@ index 8811eb3e..74e2e448 100644 world.updateAdjacentComparators(blockposition, iblockdata.getBlock()); -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0192-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/0191-Provide-E-TE-Chunk-count-stat-methods.patch similarity index 93% rename from Spigot-Server-Patches/0192-Provide-E-TE-Chunk-count-stat-methods.patch rename to Spigot-Server-Patches/0191-Provide-E-TE-Chunk-count-stat-methods.patch index 2d52ea4b8c..2d802e7f3b 100644 --- a/Spigot-Server-Patches/0192-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/0191-Provide-E-TE-Chunk-count-stat-methods.patch @@ -1,4 +1,4 @@ -From 93739b3a2f79eea51937daf6631bb5b0760e7ea0 Mon Sep 17 00:00:00 2001 +From 966cd0280c47f9e6e0c4c587f0938e44002840e1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:24:46 -0500 Subject: [PATCH] Provide E/TE/Chunk count stat methods @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 416e86af..7ea64362 100644 +index 67cb2230b..00dd2976d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -78,6 +78,29 @@ public class CraftWorld implements World { @@ -41,5 +41,5 @@ index 416e86af..7ea64362 100644 public CraftWorld(WorldServer world, ChunkGenerator gen, Environment env) { -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0193-Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches/0192-Enforce-Sync-Player-Saves.patch similarity index 90% rename from Spigot-Server-Patches/0193-Enforce-Sync-Player-Saves.patch rename to Spigot-Server-Patches/0192-Enforce-Sync-Player-Saves.patch index 25b980da04..0e0eba4f3b 100644 --- a/Spigot-Server-Patches/0193-Enforce-Sync-Player-Saves.patch +++ b/Spigot-Server-Patches/0192-Enforce-Sync-Player-Saves.patch @@ -1,4 +1,4 @@ -From 7c95b7c974a7cb9cf8bee918dd8b0e371c65856f Mon Sep 17 00:00:00 2001 +From 28c6896e630016522ca9be45820241542d22d62d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:41:58 -0500 Subject: [PATCH] Enforce Sync Player Saves @@ -7,7 +7,7 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 73cf2e3d8..206068384 100644 +index 953e5f901..acec81a92 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1243,6 +1243,7 @@ public abstract class PlayerList { @@ -27,5 +27,5 @@ index 73cf2e3d8..206068384 100644 // Paper end -- -2.13.0 +2.14.2 diff --git a/Spigot-Server-Patches/0194-Enforce-Sync-Chunk-Unloads.patch b/Spigot-Server-Patches/0193-Enforce-Sync-Chunk-Unloads.patch similarity index 91% rename from Spigot-Server-Patches/0194-Enforce-Sync-Chunk-Unloads.patch rename to Spigot-Server-Patches/0193-Enforce-Sync-Chunk-Unloads.patch index 37d5e69d32..664ae35ce7 100644 --- a/Spigot-Server-Patches/0194-Enforce-Sync-Chunk-Unloads.patch +++ b/Spigot-Server-Patches/0193-Enforce-Sync-Chunk-Unloads.patch @@ -1,4 +1,4 @@ -From 6e0cd666f07889663c8580bb0a8e3e3a2276937e Mon Sep 17 00:00:00 2001 +From e0ec8707f50d33935695640662191784cd43b345 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 16:06:44 -0500 Subject: [PATCH] Enforce Sync Chunk Unloads @@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 7ea64362..a606f6ce 100644 +index 00dd2976d..1f37fa47e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -238,6 +238,7 @@ public class CraftWorld implements World { @@ -27,5 +27,5 @@ index 7ea64362..a606f6ce 100644 public boolean regenerateChunk(int x, int z) { -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0195-Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/0194-Don-t-allow-entities-to-ride-themselves-572.patch similarity index 87% rename from Spigot-Server-Patches/0195-Don-t-allow-entities-to-ride-themselves-572.patch rename to Spigot-Server-Patches/0194-Don-t-allow-entities-to-ride-themselves-572.patch index 80951773f7..28cc440d1a 100644 --- a/Spigot-Server-Patches/0195-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/0194-Don-t-allow-entities-to-ride-themselves-572.patch @@ -1,11 +1,11 @@ -From b2d462645494ca42d890cbf4d60a89e8112a33c7 Mon Sep 17 00:00:00 2001 +From 5871fd4ac3a324964d168dbd7803bb6370b9eda0 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Sun, 8 Jan 2017 04:31:36 +0000 Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 314d1df4..147f00fe 100644 +index e0ae1f7dd..b4318e4f7 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1932,6 +1932,7 @@ public abstract class Entity implements ICommandListener { @@ -17,5 +17,5 @@ index 314d1df4..147f00fe 100644 throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); } else { -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0196-Fix-block-break-desync.patch b/Spigot-Server-Patches/0195-Fix-block-break-desync.patch similarity index 88% rename from Spigot-Server-Patches/0196-Fix-block-break-desync.patch rename to Spigot-Server-Patches/0195-Fix-block-break-desync.patch index 70605b39d4..b3e693a6c0 100644 --- a/Spigot-Server-Patches/0196-Fix-block-break-desync.patch +++ b/Spigot-Server-Patches/0195-Fix-block-break-desync.patch @@ -1,11 +1,11 @@ -From cdcb9a66070a968b4d11d041b52e8f61c98e4f55 Mon Sep 17 00:00:00 2001 +From e681f1f46bb0f4af52cc431044b8c804f4b0d0b8 Mon Sep 17 00:00:00 2001 From: Michael Himing Date: Sun, 8 Jan 2017 18:50:35 +1100 Subject: [PATCH] Fix block break desync diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index dd6cbe947..65b69574e 100644 +index bcc6c9707..751989f5a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -868,6 +868,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -17,5 +17,5 @@ index dd6cbe947..65b69574e 100644 } else if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight()) { return; -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0197-Assign-the-World-in-WorldGenStronghold.patch b/Spigot-Server-Patches/0196-Assign-the-World-in-WorldGenStronghold.patch similarity index 86% rename from Spigot-Server-Patches/0197-Assign-the-World-in-WorldGenStronghold.patch rename to Spigot-Server-Patches/0196-Assign-the-World-in-WorldGenStronghold.patch index aa69c1a697..5931a0678f 100644 --- a/Spigot-Server-Patches/0197-Assign-the-World-in-WorldGenStronghold.patch +++ b/Spigot-Server-Patches/0196-Assign-the-World-in-WorldGenStronghold.patch @@ -1,11 +1,11 @@ -From a1fd6bc296e1ae98223d0883f63e7eec6b96f1a1 Mon Sep 17 00:00:00 2001 +From 45c79ce60fe2ee66ce42a53b6ec1a24bd014fdbb Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 14 Jan 2017 01:22:07 -0600 Subject: [PATCH] Assign the World in WorldGenStronghold diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java -index c9375470..a3b958e0 100644 +index c93754704..a3b958e01 100644 --- a/src/main/java/net/minecraft/server/WorldGenStronghold.java +++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java @@ -56,6 +56,7 @@ public class WorldGenStronghold extends StructureGenerator { @@ -17,5 +17,5 @@ index c9375470..a3b958e0 100644 this.c(); this.b = true; -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0198-Add-fromBottle-flag-to-Experience-Orbs.patch b/Spigot-Server-Patches/0197-Add-fromBottle-flag-to-Experience-Orbs.patch similarity index 93% rename from Spigot-Server-Patches/0198-Add-fromBottle-flag-to-Experience-Orbs.patch rename to Spigot-Server-Patches/0197-Add-fromBottle-flag-to-Experience-Orbs.patch index f35f68e55e..f0b3e7bf82 100644 --- a/Spigot-Server-Patches/0198-Add-fromBottle-flag-to-Experience-Orbs.patch +++ b/Spigot-Server-Patches/0197-Add-fromBottle-flag-to-Experience-Orbs.patch @@ -1,11 +1,11 @@ -From 6bf0e558c5ce085401ad4b9fcfc09bcfb56ccd8f Mon Sep 17 00:00:00 2001 +From d6c8edab0e147098d8db6ac15bebbce4d9ef5b9f Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 14 Jan 2017 16:15:26 -0600 Subject: [PATCH] Add fromBottle flag to Experience Orbs diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index ec23eb98..dab33b25 100644 +index ec23eb98c..dab33b25a 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -15,6 +15,14 @@ public class EntityExperienceOrb extends Entity { @@ -37,7 +37,7 @@ index ec23eb98..dab33b25 100644 return false; } diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -index 0255986f..28931295 100644 +index 0255986fd..289312950 100644 --- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java +++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java @@ -40,7 +40,7 @@ public class EntityThrownExpBottle extends EntityProjectile { @@ -50,7 +50,7 @@ index 0255986f..28931295 100644 this.die(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java -index 3a09cab3..61e3c6c3 100644 +index 3a09cab3d..61e3c6c3e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java @@ -18,6 +18,13 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb { @@ -68,5 +68,5 @@ index 3a09cab3..61e3c6c3 100644 public EntityExperienceOrb getHandle() { return (EntityExperienceOrb) entity; -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0199-Remove-the-Vanilla-Method-Profiler.patch b/Spigot-Server-Patches/0198-Remove-the-Vanilla-Method-Profiler.patch similarity index 97% rename from Spigot-Server-Patches/0199-Remove-the-Vanilla-Method-Profiler.patch rename to Spigot-Server-Patches/0198-Remove-the-Vanilla-Method-Profiler.patch index 3f92c3304c..b8bb90915e 100644 --- a/Spigot-Server-Patches/0199-Remove-the-Vanilla-Method-Profiler.patch +++ b/Spigot-Server-Patches/0198-Remove-the-Vanilla-Method-Profiler.patch @@ -1,4 +1,4 @@ -From d0662dcab7314b3aa396ed533d59460ce144b153 Mon Sep 17 00:00:00 2001 +From 81ef5b2b4cecb9b4bbfe5bd8fa2fe473dfc9ab65 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jan 2017 08:00:33 +0100 Subject: [PATCH] Remove the Vanilla Method Profiler @@ -84,5 +84,5 @@ index 480e2ca97..a76d50723 100644 public static final class ProfilerInfo implements Comparable { -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0200-Cap-Entity-Collisions.patch b/Spigot-Server-Patches/0199-Cap-Entity-Collisions.patch similarity index 96% rename from Spigot-Server-Patches/0200-Cap-Entity-Collisions.patch rename to Spigot-Server-Patches/0199-Cap-Entity-Collisions.patch index 5ae1117388..d420b3cf02 100644 --- a/Spigot-Server-Patches/0200-Cap-Entity-Collisions.patch +++ b/Spigot-Server-Patches/0199-Cap-Entity-Collisions.patch @@ -1,4 +1,4 @@ -From 766b36dd128cf649b95adc019f16fad3fd2aa761 Mon Sep 17 00:00:00 2001 +From e94fb300d55b5e6c5fc12301b1d9833c1251a593 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 22 Jan 2017 18:07:56 -0500 Subject: [PATCH] Cap Entity Collisions @@ -27,7 +27,7 @@ index 70af657f5..af953dda4 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 147f00fe8..d34ec4ff1 100644 +index b4318e4f7..d744477c9 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -169,6 +169,7 @@ public abstract class Entity implements ICommandListener { @@ -56,5 +56,5 @@ index b437ebf26..35e473a26 100644 this.C(entity); } -- -2.13.0 +2.14.2 diff --git a/Spigot-Server-Patches/0201-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch b/Spigot-Server-Patches/0200-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch similarity index 92% rename from Spigot-Server-Patches/0201-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch rename to Spigot-Server-Patches/0200-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch index e04bd896d6..7d80457890 100644 --- a/Spigot-Server-Patches/0201-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch +++ b/Spigot-Server-Patches/0200-Do-not-allow-a-zero-max-height-in-BiomeJungle.patch @@ -1,11 +1,11 @@ -From 06e123778923dc16e27dd8d42f8a61f785f0dd7d Mon Sep 17 00:00:00 2001 +From 30fb8444934c9efb139a23e54c57dd0d05d5bf36 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 23 Jan 2017 15:10:25 -0600 Subject: [PATCH] Do not allow a zero max height in BiomeJungle diff --git a/src/main/java/net/minecraft/server/BiomeJungle.java b/src/main/java/net/minecraft/server/BiomeJungle.java -index 8f67cb36..8dc0b623 100644 +index 8f67cb36c..8dc0b6238 100644 --- a/src/main/java/net/minecraft/server/BiomeJungle.java +++ b/src/main/java/net/minecraft/server/BiomeJungle.java @@ -40,7 +40,11 @@ public class BiomeJungle extends BiomeBase { @@ -22,7 +22,7 @@ index 8f67cb36..8dc0b623 100644 (new WorldGenMelon()).generate(world, random, blockposition.a(i, k, j)); WorldGenVines worldgenvines = new WorldGenVines(); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 6a0b3a62..38a7af58 100644 +index 6a0b3a62d..38a7af58c 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -42,6 +42,7 @@ public class BlockPosition extends BaseBlockPosition { @@ -34,5 +34,5 @@ index 6a0b3a62..38a7af58 100644 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); } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0202-Remove-CraftScheduler-Async-Task-Debugger.patch b/Spigot-Server-Patches/0201-Remove-CraftScheduler-Async-Task-Debugger.patch similarity index 96% rename from Spigot-Server-Patches/0202-Remove-CraftScheduler-Async-Task-Debugger.patch rename to Spigot-Server-Patches/0201-Remove-CraftScheduler-Async-Task-Debugger.patch index acc1af7baf..2956c14a93 100644 --- a/Spigot-Server-Patches/0202-Remove-CraftScheduler-Async-Task-Debugger.patch +++ b/Spigot-Server-Patches/0201-Remove-CraftScheduler-Async-Task-Debugger.patch @@ -1,4 +1,4 @@ -From cf5f4d4909b05dd56c4e280828fd7990663998b3 Mon Sep 17 00:00:00 2001 +From 5c2cdd99564a0e4894ca0b76e97c09307c683567 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 5 Feb 2017 00:04:04 -0500 Subject: [PATCH] Remove CraftScheduler Async Task Debugger @@ -9,7 +9,7 @@ One report of a suspected memory leak with the system. This adds additional overhead to asynchronous task dispatching diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index e30cfb7b..448c27cc 100644 +index bce411288..e47f4cca2 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -80,8 +80,8 @@ public class CraftScheduler implements BukkitScheduler { @@ -58,5 +58,5 @@ index e30cfb7b..448c27cc 100644 @Deprecated -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0203-Shame-on-you-Mojang.patch b/Spigot-Server-Patches/0202-Shame-on-you-Mojang.patch similarity index 95% rename from Spigot-Server-Patches/0203-Shame-on-you-Mojang.patch rename to Spigot-Server-Patches/0202-Shame-on-you-Mojang.patch index 712f464312..e0a3d1cab2 100644 --- a/Spigot-Server-Patches/0203-Shame-on-you-Mojang.patch +++ b/Spigot-Server-Patches/0202-Shame-on-you-Mojang.patch @@ -1,4 +1,4 @@ -From e6a0df56837d0047e48cdafe151bca094d389977 Mon Sep 17 00:00:00 2001 +From 8d0e4a252d430491007507e7c2dfe885d2d8024a Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 5 Feb 2017 19:17:28 -0500 Subject: [PATCH] Shame on you Mojang @@ -12,7 +12,7 @@ This then triggers async chunk loads! What in the hell were you thinking? diff --git a/src/main/java/net/minecraft/server/BlockBeacon.java b/src/main/java/net/minecraft/server/BlockBeacon.java -index f07ac018..21075974 100644 +index f07ac0186..21075974d 100644 --- a/src/main/java/net/minecraft/server/BlockBeacon.java +++ b/src/main/java/net/minecraft/server/BlockBeacon.java @@ -62,8 +62,8 @@ public class BlockBeacon extends BlockTileEntity { @@ -55,5 +55,5 @@ index f07ac018..21075974 100644 } } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0204-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/Spigot-Server-Patches/0203-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch similarity index 90% rename from Spigot-Server-Patches/0204-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch rename to Spigot-Server-Patches/0203-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch index ea0e2d2053..0cdc688cd6 100644 --- a/Spigot-Server-Patches/0204-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch +++ b/Spigot-Server-Patches/0203-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -1,11 +1,11 @@ -From 1605c8bc9c100986681de86c616968c0e689420e Mon Sep 17 00:00:00 2001 +From c210b1334ffc2e6972558b906a3ae7ef194dc5a4 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 7 Feb 2017 16:55:35 -0600 Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 9159ed02..e54f4f47 100644 +index 73554a518..2558ba8c3 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -325,7 +325,7 @@ public class ChunkProviderServer implements IChunkProvider { @@ -18,5 +18,5 @@ index 9159ed02..e54f4f47 100644 Iterator iterator = this.unloadQueue.iterator(); -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0205-Do-not-let-armorstands-drown.patch b/Spigot-Server-Patches/0204-Do-not-let-armorstands-drown.patch similarity index 94% rename from Spigot-Server-Patches/0205-Do-not-let-armorstands-drown.patch rename to Spigot-Server-Patches/0204-Do-not-let-armorstands-drown.patch index 12cca8e8fd..673cf2ae0d 100644 --- a/Spigot-Server-Patches/0205-Do-not-let-armorstands-drown.patch +++ b/Spigot-Server-Patches/0204-Do-not-let-armorstands-drown.patch @@ -1,11 +1,11 @@ -From 292babe90273d8107d09d1c0a3b331b616c67f58 Mon Sep 17 00:00:00 2001 +From ebcc56e4fd745a5aababc0303aebd049be413790 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 18 Feb 2017 19:29:58 -0600 Subject: [PATCH] Do not let armorstands drown diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 036498c09..f25ee9061 100644 +index fcbfcd6a9..7899324ed 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -772,5 +772,10 @@ public class EntityArmorStand extends EntityLiving { @@ -41,5 +41,5 @@ index 35e473a26..66b82bbfb 100644 if (this.getAirTicks() == -20) { this.setAirTicks(0); -- -2.13.0 +2.14.2 diff --git a/Spigot-Server-Patches/0206-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch b/Spigot-Server-Patches/0205-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch similarity index 89% rename from Spigot-Server-Patches/0206-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch rename to Spigot-Server-Patches/0205-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch index 17152eef29..998f73b9b1 100644 --- a/Spigot-Server-Patches/0206-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch +++ b/Spigot-Server-Patches/0205-Fix-NFE-when-attempting-to-read-EMPTY-ItemStack.patch @@ -1,4 +1,4 @@ -From 8098d5fd980f97cb31ea4f8e4d30c0524a7b73cb Mon Sep 17 00:00:00 2001 +From ecf214d5296e6e15188e49b0511d750fd4f6c433 Mon Sep 17 00:00:00 2001 From: kashike Date: Sun, 9 Apr 2017 23:50:15 -0700 Subject: [PATCH] Fix NFE when attempting to read EMPTY ItemStack @@ -6,7 +6,7 @@ Subject: [PATCH] Fix NFE when attempting to read EMPTY ItemStack Thanks @gabizou diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 3aefb023..8c7f57bc 100644 +index 3aefb023e..8c7f57bc7 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -103,7 +103,7 @@ public final class ItemStack { @@ -19,5 +19,5 @@ index 3aefb023..8c7f57bc 100644 // CraftBukkit start - Route through setData for filtering // this.damage = Math.max(0, nbttagcompound.getShort("Damage")); -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0207-Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/0206-Properly-handle-async-calls-to-restart-the-server.patch similarity index 99% rename from Spigot-Server-Patches/0207-Properly-handle-async-calls-to-restart-the-server.patch rename to Spigot-Server-Patches/0206-Properly-handle-async-calls-to-restart-the-server.patch index 1b0a561235..38ee55247d 100644 --- a/Spigot-Server-Patches/0207-Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/0206-Properly-handle-async-calls-to-restart-the-server.patch @@ -1,4 +1,4 @@ -From d57850c1c1fc99b04ae06c6720c10ec168bfbd67 Mon Sep 17 00:00:00 2001 +From c2307fa2a3c4d95037b7f4aba680079842fb6913 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 12 May 2017 23:34:11 -0500 Subject: [PATCH] Properly handle async calls to restart the server @@ -30,7 +30,7 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 005e3449f..a4f44b39b 100644 +index 13c6b5ccd..908a5d273 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -71,6 +71,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs @@ -306,5 +306,5 @@ index 49768734d..d51636c8e 100644 } } -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0208-Add-system-property-to-disable-book-size-limits.patch b/Spigot-Server-Patches/0207-Add-system-property-to-disable-book-size-limits.patch similarity index 96% rename from Spigot-Server-Patches/0208-Add-system-property-to-disable-book-size-limits.patch rename to Spigot-Server-Patches/0207-Add-system-property-to-disable-book-size-limits.patch index 8248cb3435..db09bc0447 100644 --- a/Spigot-Server-Patches/0208-Add-system-property-to-disable-book-size-limits.patch +++ b/Spigot-Server-Patches/0207-Add-system-property-to-disable-book-size-limits.patch @@ -1,4 +1,4 @@ -From 73e0094ad1cd41089d16ffa3976d5aa1c71acc4e Mon Sep 17 00:00:00 2001 +From 7f9d61d370211a778162cdd1826cf0dc54c3437f Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 13 May 2017 20:11:21 -0500 Subject: [PATCH] Add system property to disable book size limits @@ -11,7 +11,7 @@ to make books with as much data as they want. Do not use this without limiting incoming data from packets in some other way. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index 5d971f07..6a7d1034 100644 +index 5d971f07b..6a7d10344 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -37,6 +37,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { @@ -57,5 +57,5 @@ index 5d971f07..6a7d1034 100644 } -- -2.13.1.windows.2 +2.14.2 diff --git a/Spigot-Server-Patches/0209-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/Spigot-Server-Patches/0208-Add-option-to-make-parrots-stay-on-shoulders-despite.patch similarity index 96% rename from Spigot-Server-Patches/0209-Add-option-to-make-parrots-stay-on-shoulders-despite.patch rename to Spigot-Server-Patches/0208-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 2cd1dc188b..eae53d3f0b 100644 --- a/Spigot-Server-Patches/0209-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/Spigot-Server-Patches/0208-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -1,4 +1,4 @@ -From 87361eb607a71e11f1ae423d1848b24cb2d1a29a Mon Sep 17 00:00:00 2001 +From 7355a71bfae09f95306314f6191a65c0be0a71d0 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 16 May 2017 21:29:08 -0500 Subject: [PATCH] Add option to make parrots stay on shoulders despite movement @@ -39,7 +39,7 @@ index 3cc13bdc4..a8f5117bc 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 65b69574e..5c8cd73ea 100644 +index 751989f5a..2b11f68f4 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1509,6 +1509,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -57,5 +57,5 @@ index 65b69574e..5c8cd73ea 100644 case STOP_SNEAKING: -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0210-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/0209-Add-configuration-option-to-prevent-player-names-fro.patch similarity index 94% rename from Spigot-Server-Patches/0210-Add-configuration-option-to-prevent-player-names-fro.patch rename to Spigot-Server-Patches/0209-Add-configuration-option-to-prevent-player-names-fro.patch index c1f1e3ae7a..d1768628c9 100644 --- a/Spigot-Server-Patches/0210-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/0209-Add-configuration-option-to-prevent-player-names-fro.patch @@ -1,4 +1,4 @@ -From b4f7fd881033978a4cf32a6d1c1f6170840ebdf7 Mon Sep 17 00:00:00 2001 +From 7562e2d3ed8337b1719e1657bc3aa47cb59fa525 Mon Sep 17 00:00:00 2001 From: kashike Date: Fri, 9 Jun 2017 07:24:34 -0700 Subject: [PATCH] Add configuration option to prevent player names from being @@ -35,5 +35,5 @@ index 5bbb09c9d..5c36e7373 100644 // Paper end } -- -2.14.1.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0211-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0210-Use-TerminalConsoleAppender-for-console-improvements.patch similarity index 99% rename from Spigot-Server-Patches/0211-Use-TerminalConsoleAppender-for-console-improvements.patch rename to Spigot-Server-Patches/0210-Use-TerminalConsoleAppender-for-console-improvements.patch index eb5137a572..eed46fc4c4 100644 --- a/Spigot-Server-Patches/0211-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/0210-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -1,4 +1,4 @@ -From 357c051b89138fb3d7ef74a0397852830ca9b69c Mon Sep 17 00:00:00 2001 +From 2d1ed0e054f43fe5f47c44baac200f17df5dc8c2 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 9 Jun 2017 19:03:43 +0200 Subject: [PATCH] Use TerminalConsoleAppender for console improvements @@ -633,5 +633,5 @@ index 5cee8f00e..08b6bb7f9 100644 -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0212-provide-a-configurable-option-to-disable-creeper-lin.patch b/Spigot-Server-Patches/0211-provide-a-configurable-option-to-disable-creeper-lin.patch similarity index 95% rename from Spigot-Server-Patches/0212-provide-a-configurable-option-to-disable-creeper-lin.patch rename to Spigot-Server-Patches/0211-provide-a-configurable-option-to-disable-creeper-lin.patch index ea4a9059c9..91448d3f01 100644 --- a/Spigot-Server-Patches/0212-provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/Spigot-Server-Patches/0211-provide-a-configurable-option-to-disable-creeper-lin.patch @@ -1,4 +1,4 @@ -From 7c3ffd3a5824fbccf2b98e41e73adfbb1d460b45 Mon Sep 17 00:00:00 2001 +From 5912a185958696e4222a37ad45e05a3b147f2f08 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 11 Jun 2017 21:01:18 +0100 Subject: [PATCH] provide a configurable option to disable creeper lingering @@ -34,5 +34,5 @@ index 01e9ddc3d..b9580c65c 100644 entityareaeffectcloud.setSource(this); // CraftBukkit -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0213-Item-canEntityPickup.patch b/Spigot-Server-Patches/0212-Item-canEntityPickup.patch similarity index 97% rename from Spigot-Server-Patches/0213-Item-canEntityPickup.patch rename to Spigot-Server-Patches/0212-Item-canEntityPickup.patch index 5ae5d2af00..d10b1c76d6 100644 --- a/Spigot-Server-Patches/0213-Item-canEntityPickup.patch +++ b/Spigot-Server-Patches/0212-Item-canEntityPickup.patch @@ -1,4 +1,4 @@ -From 5af685a537a19865a59f78d62ce01c506f806ccd Mon Sep 17 00:00:00 2001 +From 3a72b4686dad77f25cc5390c94fc4610f571aad0 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 5 May 2017 03:57:17 -0500 Subject: [PATCH] Item#canEntityPickup @@ -55,5 +55,5 @@ index a17a537d6..1df17f09b 100644 public String toString() { return "CraftItem"; -- -2.13.3 +2.14.2 diff --git a/Spigot-Server-Patches/0214-PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-Server-Patches/0213-PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 96% rename from Spigot-Server-Patches/0214-PlayerPickupItemEvent-setFlyAtPlayer.patch rename to Spigot-Server-Patches/0213-PlayerPickupItemEvent-setFlyAtPlayer.patch index a546136e39..04c89d9669 100644 --- a/Spigot-Server-Patches/0214-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-Server-Patches/0213-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -1,4 +1,4 @@ -From 2f3f52a7ba8b8783d8d2e034b431cde5c3da87bb Mon Sep 17 00:00:00 2001 +From a110b0d8c776f31fcb06e03269cb7cf5cb2b89b5 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 May 2017 06:26:09 -0500 Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer @@ -44,5 +44,5 @@ index 99dbb1393..ae4910b4b 100644 this.die(); itemstack.setCount(i); -- -2.13.3 +2.14.2 diff --git a/Spigot-Server-Patches/0215-PlayerAttemptPickupItemEvent.patch b/Spigot-Server-Patches/0214-PlayerAttemptPickupItemEvent.patch similarity index 93% rename from Spigot-Server-Patches/0215-PlayerAttemptPickupItemEvent.patch rename to Spigot-Server-Patches/0214-PlayerAttemptPickupItemEvent.patch index ce8ac32b63..dbdf21a374 100644 --- a/Spigot-Server-Patches/0215-PlayerAttemptPickupItemEvent.patch +++ b/Spigot-Server-Patches/0214-PlayerAttemptPickupItemEvent.patch @@ -1,11 +1,11 @@ -From acb8885cb0b64c6a23c1a280e3c3273f59f94410 Mon Sep 17 00:00:00 2001 +From 5259d5af8c2d7a9357333588950b955ed4312eca Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 11 Jun 2017 16:30:30 -0500 Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index fed1f4ab2..a580a5866 100644 +index ae4910b4b..b56d1a35e 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -8,6 +8,7 @@ import org.apache.logging.log4j.Logger; @@ -30,5 +30,5 @@ index fed1f4ab2..a580a5866 100644 int canHold = entityhuman.inventory.canHold(itemstack); int remaining = i - canHold; -- -2.13.3 +2.14.2 diff --git a/Spigot-Server-Patches/0216-Add-UnknownCommandEvent.patch b/Spigot-Server-Patches/0215-Add-UnknownCommandEvent.patch similarity index 95% rename from Spigot-Server-Patches/0216-Add-UnknownCommandEvent.patch rename to Spigot-Server-Patches/0215-Add-UnknownCommandEvent.patch index 55994aa28f..8b3cf528d2 100644 --- a/Spigot-Server-Patches/0216-Add-UnknownCommandEvent.patch +++ b/Spigot-Server-Patches/0215-Add-UnknownCommandEvent.patch @@ -1,4 +1,4 @@ -From 5d9e9c3c88db23fc1a46b0310f0ebf29901d8970 Mon Sep 17 00:00:00 2001 +From 5b2ed90994ae4807e6bebb72d1743bc11004989c Mon Sep 17 00:00:00 2001 From: Sweepyoface Date: Sat, 17 Jun 2017 18:48:21 -0400 Subject: [PATCH] Add UnknownCommandEvent @@ -32,5 +32,5 @@ index cb4b78e0e..b42f4e9ee 100644 // Spigot end -- -2.14.1.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0217-Shoulder-Entities-Release-API.patch b/Spigot-Server-Patches/0216-Shoulder-Entities-Release-API.patch similarity index 96% rename from Spigot-Server-Patches/0217-Shoulder-Entities-Release-API.patch rename to Spigot-Server-Patches/0216-Shoulder-Entities-Release-API.patch index 6c7222b9cd..4322a009b5 100644 --- a/Spigot-Server-Patches/0217-Shoulder-Entities-Release-API.patch +++ b/Spigot-Server-Patches/0216-Shoulder-Entities-Release-API.patch @@ -1,11 +1,11 @@ -From d233de90c6ccc3eefdc19e94caf44cffd8abd3a9 Mon Sep 17 00:00:00 2001 +From fd50e8c234f34928d2926eb6f8afb399d8846b27 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Jun 2017 15:18:30 -0400 Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index f5e25e63d..c74095554 100644 +index a8f5117bc..e9f48ecad 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -1717,21 +1717,48 @@ public abstract class EntityHuman extends EntityLiving { @@ -62,7 +62,7 @@ index f5e25e63d..c74095554 100644 public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 25e1e5a3f..463dddc98 100644 +index 90df0ae1c..4cce0920e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -441,6 +441,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -99,5 +99,5 @@ index 25e1e5a3f..463dddc98 100644 public org.bukkit.entity.Entity getShoulderEntityLeft() { if (!getHandle().getShoulderEntityLeft().isEmpty()) { -- -2.13.3 +2.14.2 diff --git a/Spigot-Server-Patches/0218-Profile-Lookup-Events.patch b/Spigot-Server-Patches/0217-Profile-Lookup-Events.patch similarity index 92% rename from Spigot-Server-Patches/0218-Profile-Lookup-Events.patch rename to Spigot-Server-Patches/0217-Profile-Lookup-Events.patch index 5cd10836f0..ac0ac01b37 100644 --- a/Spigot-Server-Patches/0218-Profile-Lookup-Events.patch +++ b/Spigot-Server-Patches/0217-Profile-Lookup-Events.patch @@ -1,4 +1,4 @@ -From a39ef5463e9991e0d4517352d0563ae6598e06d5 Mon Sep 17 00:00:00 2001 +From 56b9c394da0c9082dc598ea18fa2b9edf59e5e96 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Jun 2017 17:00:32 -0400 Subject: [PATCH] Profile Lookup Events @@ -7,7 +7,7 @@ Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in p profiles that had to be looked up. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ea2c57137..a2acf1b3e 100644 +index e8bddc171..0e255861d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1021,6 +1021,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs @@ -19,5 +19,5 @@ index ea2c57137..a2acf1b3e 100644 final DedicatedServer dedicatedserver = new DedicatedServer(options, DataConverterRegistry.a(), yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache); -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0219-Block-player-logins-during-server-shutdown.patch b/Spigot-Server-Patches/0218-Block-player-logins-during-server-shutdown.patch similarity index 93% rename from Spigot-Server-Patches/0219-Block-player-logins-during-server-shutdown.patch rename to Spigot-Server-Patches/0218-Block-player-logins-during-server-shutdown.patch index b1f48c8e51..0807e7e6c5 100644 --- a/Spigot-Server-Patches/0219-Block-player-logins-during-server-shutdown.patch +++ b/Spigot-Server-Patches/0218-Block-player-logins-during-server-shutdown.patch @@ -1,4 +1,4 @@ -From 22113031e03ae1a537f3b925401468157bde485c Mon Sep 17 00:00:00 2001 +From 8d44a70aa504dc035b022cef4c4866ae7c04a687 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 2 Jul 2017 21:35:56 -0500 Subject: [PATCH] Block player logins during server shutdown @@ -22,5 +22,5 @@ index 2158fcd32..c5434e6ba 100644 this.b(); } else if (this.g == LoginListener.EnumProtocolState.DELAY_ACCEPT) { -- -2.13.3 +2.14.2 diff --git a/Spigot-Server-Patches/0220-Entity-fromMobSpawner.patch b/Spigot-Server-Patches/0219-Entity-fromMobSpawner.patch similarity index 96% rename from Spigot-Server-Patches/0220-Entity-fromMobSpawner.patch rename to Spigot-Server-Patches/0219-Entity-fromMobSpawner.patch index 44837660f0..2ebf8a05e2 100644 --- a/Spigot-Server-Patches/0220-Entity-fromMobSpawner.patch +++ b/Spigot-Server-Patches/0219-Entity-fromMobSpawner.patch @@ -1,4 +1,4 @@ -From bc215bb3bae449d668c2a37c5739d6595919ec25 Mon Sep 17 00:00:00 2001 +From f18fa9055375d8a2c362a4a0f41ac414fe424279 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 18 Jun 2017 18:17:05 -0500 Subject: [PATCH] Entity#fromMobSpawner() @@ -49,7 +49,7 @@ index 0562c6e34..06b064a78 100644 if ( entity.world.spigotConfig.nerfSpawnerMobs ) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 437c3da11..0ada29f4f 100644 +index 9429ae1ab..248477661 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -788,5 +788,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -64,5 +64,5 @@ index 437c3da11..0ada29f4f 100644 // Paper end } -- -2.13.4 +2.14.2 diff --git a/Spigot-Server-Patches/0221-Fix-Anvil-Level-sync-to-client.patch b/Spigot-Server-Patches/0220-Fix-Anvil-Level-sync-to-client.patch similarity index 93% rename from Spigot-Server-Patches/0221-Fix-Anvil-Level-sync-to-client.patch rename to Spigot-Server-Patches/0220-Fix-Anvil-Level-sync-to-client.patch index fd691ce5a5..c9cd183816 100644 --- a/Spigot-Server-Patches/0221-Fix-Anvil-Level-sync-to-client.patch +++ b/Spigot-Server-Patches/0220-Fix-Anvil-Level-sync-to-client.patch @@ -1,4 +1,4 @@ -From 284a9f0f38f2941e51414c9f3cbf537f340f4256 Mon Sep 17 00:00:00 2001 +From fb399ba3c219d0d63174c445afce0cbd4da3475c Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 11 Jul 2017 23:17:57 -0400 Subject: [PATCH] Fix Anvil Level sync to client @@ -10,7 +10,7 @@ Was done incorrectly and is now causing level desyncs to client. Always send current level to the client, and instead make setWindowProperty set the level. diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index 04f117ace..e3897a3f7 100644 +index 175753c5a..16ec67569 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -376,9 +376,9 @@ public class ContainerAnvil extends Container { @@ -26,7 +26,7 @@ index 04f117ace..e3897a3f7 100644 this.lastLevelCost = this.levelCost; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 005c8a00b..c9a707e7e 100644 +index f30613672..6642001e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1282,6 +1282,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -42,5 +42,5 @@ index 005c8a00b..c9a707e7e 100644 return true; } -- -2.13.3 +2.14.2 diff --git a/Spigot-Server-Patches/0222-Add-missing-coverages-for-getTileEntity-in-order-to-.patch b/Spigot-Server-Patches/0221-Add-missing-coverages-for-getTileEntity-in-order-to-.patch similarity index 93% rename from Spigot-Server-Patches/0222-Add-missing-coverages-for-getTileEntity-in-order-to-.patch rename to Spigot-Server-Patches/0221-Add-missing-coverages-for-getTileEntity-in-order-to-.patch index 3cb3451036..58dd851987 100644 --- a/Spigot-Server-Patches/0222-Add-missing-coverages-for-getTileEntity-in-order-to-.patch +++ b/Spigot-Server-Patches/0221-Add-missing-coverages-for-getTileEntity-in-order-to-.patch @@ -1,4 +1,4 @@ -From 8b8ad3cdb51aaf4ba1ddaabbcc2042cb0a417857 Mon Sep 17 00:00:00 2001 +From bda3776e61c8f1859ad361f2a7a89d75c7971bff Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 22 Jul 2017 15:22:59 +0100 Subject: [PATCH] Add missing coverages for getTileEntity in order to attempt @@ -24,5 +24,5 @@ index 2ac5caaa4..c03be509f 100644 return result; } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0223-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch b/Spigot-Server-Patches/0222-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch similarity index 97% rename from Spigot-Server-Patches/0223-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch rename to Spigot-Server-Patches/0222-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch index 2c61ac3afb..eb93f8c9d6 100644 --- a/Spigot-Server-Patches/0223-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch +++ b/Spigot-Server-Patches/0222-Allow-Changing-of-Player-Sample-in-ServerListPingEve.patch @@ -1,4 +1,4 @@ -From 307a2e3cc7e023f101c020a6e9b74df70083e1bf Mon Sep 17 00:00:00 2001 +From 732782932a72f308e7271c035eaaf4a03ecdf9ce Mon Sep 17 00:00:00 2001 From: willies952002 Date: Fri, 5 May 2017 18:59:22 -0400 Subject: [PATCH] Allow Changing of Player Sample in ServerListPingEvent @@ -64,5 +64,5 @@ index 313bb0007..45d6984f7 100644 playerSample.a(profiles.toArray(new GameProfile[profiles.size()])); -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0224-Improve-the-Saddle-API-for-Horses.patch b/Spigot-Server-Patches/0223-Improve-the-Saddle-API-for-Horses.patch similarity index 97% rename from Spigot-Server-Patches/0224-Improve-the-Saddle-API-for-Horses.patch rename to Spigot-Server-Patches/0223-Improve-the-Saddle-API-for-Horses.patch index 09d9f10aa9..e6164cbf02 100644 --- a/Spigot-Server-Patches/0224-Improve-the-Saddle-API-for-Horses.patch +++ b/Spigot-Server-Patches/0223-Improve-the-Saddle-API-for-Horses.patch @@ -1,4 +1,4 @@ -From d34fe4dbcbd8a661092351c2be434cbacd70e10e Mon Sep 17 00:00:00 2001 +From c4086c2d68e3524a7ab63dc946740925ac58ca3c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 10 Dec 2016 16:24:06 -0500 Subject: [PATCH] Improve the Saddle API for Horses @@ -83,5 +83,5 @@ index 000000000..615010c40 + } +} -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0225-Implement-ensureServerConversions-API.patch b/Spigot-Server-Patches/0224-Implement-ensureServerConversions-API.patch similarity index 92% rename from Spigot-Server-Patches/0225-Implement-ensureServerConversions-API.patch rename to Spigot-Server-Patches/0224-Implement-ensureServerConversions-API.patch index bc89b726ce..0a79d84f43 100644 --- a/Spigot-Server-Patches/0225-Implement-ensureServerConversions-API.patch +++ b/Spigot-Server-Patches/0224-Implement-ensureServerConversions-API.patch @@ -1,4 +1,4 @@ -From 70c9c339ad2d62a199d09706abb17f42e5f51a3c Mon Sep 17 00:00:00 2001 +From 7e748e9639b070df6acfe66f76e2b72dab3a4baf Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 22:43:12 -0400 Subject: [PATCH] Implement ensureServerConversions API @@ -23,5 +23,5 @@ index 49ebad22e..eb6987338 100644 + // Paper end } -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0226-Implement-getI18NDisplayName.patch b/Spigot-Server-Patches/0225-Implement-getI18NDisplayName.patch similarity index 94% rename from Spigot-Server-Patches/0226-Implement-getI18NDisplayName.patch rename to Spigot-Server-Patches/0225-Implement-getI18NDisplayName.patch index 872a7bf78d..457c2284c2 100644 --- a/Spigot-Server-Patches/0226-Implement-getI18NDisplayName.patch +++ b/Spigot-Server-Patches/0225-Implement-getI18NDisplayName.patch @@ -1,4 +1,4 @@ -From 11d553a3a2d83a47dc49929978682109d43ecd97 Mon Sep 17 00:00:00 2001 +From 1039d73509176ddbdf74e2a946c27b175680fb9d Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 23:59:38 -0400 Subject: [PATCH] Implement getI18NDisplayName @@ -31,5 +31,5 @@ index eb6987338..c2f26577c 100644 // Paper end } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0227-GH-806-Respect-saving-disabled-before-unloading-all-.patch b/Spigot-Server-Patches/0226-GH-806-Respect-saving-disabled-before-unloading-all-.patch similarity index 92% rename from Spigot-Server-Patches/0227-GH-806-Respect-saving-disabled-before-unloading-all-.patch rename to Spigot-Server-Patches/0226-GH-806-Respect-saving-disabled-before-unloading-all-.patch index 23933ac2fb..ae817f5432 100644 --- a/Spigot-Server-Patches/0227-GH-806-Respect-saving-disabled-before-unloading-all-.patch +++ b/Spigot-Server-Patches/0226-GH-806-Respect-saving-disabled-before-unloading-all-.patch @@ -1,4 +1,4 @@ -From f67bc29fc988afd5221a35203c1ed6553b076ae9 Mon Sep 17 00:00:00 2001 +From f1b3a04ee35000049ad11a2c3cb107914f7582dd Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 27 Jul 2017 00:06:43 -0400 Subject: [PATCH] GH-806: Respect saving disabled before unloading all chunks @@ -22,5 +22,5 @@ index 14ea89c91..08e0cdf6d 100644 } } // Paper timing -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0228-ProfileWhitelistVerifyEvent.patch b/Spigot-Server-Patches/0227-ProfileWhitelistVerifyEvent.patch similarity index 97% rename from Spigot-Server-Patches/0228-ProfileWhitelistVerifyEvent.patch rename to Spigot-Server-Patches/0227-ProfileWhitelistVerifyEvent.patch index 7fef37921f..f209e0580f 100644 --- a/Spigot-Server-Patches/0228-ProfileWhitelistVerifyEvent.patch +++ b/Spigot-Server-Patches/0227-ProfileWhitelistVerifyEvent.patch @@ -1,4 +1,4 @@ -From a45c6794444636e4c22d8aceabfc5131e49ab47a Mon Sep 17 00:00:00 2001 +From c78055b6f2994460aed039ab17c23a53df4ba435 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 3 Jul 2017 18:11:10 -0500 Subject: [PATCH] ProfileWhitelistVerifyEvent @@ -48,5 +48,5 @@ index ebca377e5..c201e9cec 100644 public boolean isOp(GameProfile gameprofile) { return this.operators.d(gameprofile) || this.server.R() && this.server.worlds.get(0).getWorldData().u() && this.server.Q().equalsIgnoreCase(gameprofile.getName()) || this.u; // CraftBukkit -- -2.13.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0229-Fix-this-stupid-bullshit.patch b/Spigot-Server-Patches/0228-Fix-this-stupid-bullshit.patch similarity index 93% rename from Spigot-Server-Patches/0229-Fix-this-stupid-bullshit.patch rename to Spigot-Server-Patches/0228-Fix-this-stupid-bullshit.patch index 1abf0ac5d9..3937e4f1f6 100644 --- a/Spigot-Server-Patches/0229-Fix-this-stupid-bullshit.patch +++ b/Spigot-Server-Patches/0228-Fix-this-stupid-bullshit.patch @@ -1,4 +1,4 @@ -From e5c42e6ed2f35ac31c40b422cd7a6a6b0ee8c999 Mon Sep 17 00:00:00 2001 +From f8e0a762773502754c1994b44909beccbfd1b4db Mon Sep 17 00:00:00 2001 From: DemonWav Date: Sun, 6 Aug 2017 17:17:53 -0500 Subject: [PATCH] Fix this stupid bullshit @@ -9,7 +9,7 @@ modified in order to prevent merge conflicts when Spigot changes/disables the wa and to provide some level of hint without being disruptive. diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index c9e8a8737..ae2c51f5d 100644 +index d3d848f8c..21628e196 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -209,10 +209,12 @@ public class Main { @@ -29,5 +29,5 @@ index c9e8a8737..ae2c51f5d 100644 } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0230-Ocelot-despawns-should-honor-nametags-and-leash.patch b/Spigot-Server-Patches/0229-Ocelot-despawns-should-honor-nametags-and-leash.patch similarity index 88% rename from Spigot-Server-Patches/0230-Ocelot-despawns-should-honor-nametags-and-leash.patch rename to Spigot-Server-Patches/0229-Ocelot-despawns-should-honor-nametags-and-leash.patch index 102626f32f..a453447f3d 100644 --- a/Spigot-Server-Patches/0230-Ocelot-despawns-should-honor-nametags-and-leash.patch +++ b/Spigot-Server-Patches/0229-Ocelot-despawns-should-honor-nametags-and-leash.patch @@ -1,11 +1,11 @@ -From fff9aa7f3454f4c830481b7c206ec73af4ccf3d9 Mon Sep 17 00:00:00 2001 +From 7b1d1554b8d650b899c7a7ce9b9034644b611858 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:54:40 -0500 Subject: [PATCH] Ocelot despawns should honor nametags and leash diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 5a76821e..858bbef5 100644 +index 5a76821ea..858bbef5b 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -58,7 +58,7 @@ public class EntityOcelot extends EntityTameableAnimal { @@ -18,5 +18,5 @@ index 5a76821e..858bbef5 100644 protected void initAttributes() { -- -2.11.0 +2.14.2 diff --git a/Spigot-Server-Patches/0231-Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/Spigot-Server-Patches/0230-Reset-spawner-timer-when-spawner-event-is-cancelled.patch similarity index 94% rename from Spigot-Server-Patches/0231-Reset-spawner-timer-when-spawner-event-is-cancelled.patch rename to Spigot-Server-Patches/0230-Reset-spawner-timer-when-spawner-event-is-cancelled.patch index 80990547b5..e9ba0c934c 100644 --- a/Spigot-Server-Patches/0231-Reset-spawner-timer-when-spawner-event-is-cancelled.patch +++ b/Spigot-Server-Patches/0230-Reset-spawner-timer-when-spawner-event-is-cancelled.patch @@ -1,4 +1,4 @@ -From cf0ed1a251680f2dfc1a50bc98978a395dc910d8 Mon Sep 17 00:00:00 2001 +From 886463be7f9b8db11b507becc9620e75dbc520d4 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:45:19 -0500 Subject: [PATCH] Reset spawner timer when spawner event is cancelled @@ -28,5 +28,5 @@ index 06b064a78..c29df55fa 100644 } -- -2.13.4 +2.14.2 diff --git a/Spigot-Server-Patches/0232-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch b/Spigot-Server-Patches/0231-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch similarity index 89% rename from Spigot-Server-Patches/0232-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch rename to Spigot-Server-Patches/0231-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch index c5a94e591b..f2b3083108 100644 --- a/Spigot-Server-Patches/0232-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch +++ b/Spigot-Server-Patches/0231-MC-94186-Fix-dragon-egg-falling-in-lazy-chunks.patch @@ -1,4 +1,4 @@ -From 508f6e194029ca5a47d116688528c827c83dc8c7 Mon Sep 17 00:00:00 2001 +From 7d55175c4ac7f56aaf7118b64270dc86b7b75ba3 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Fri, 11 Aug 2017 03:29:26 +0200 Subject: [PATCH] MC-94186 Fix dragon egg falling in lazy chunks @@ -8,7 +8,7 @@ Fixes falling dragon eggs in lazy chunks fall to the block below the last empty See also https://bugs.mojang.com/browse/MC-94186 diff --git a/src/main/java/net/minecraft/server/BlockDragonEgg.java b/src/main/java/net/minecraft/server/BlockDragonEgg.java -index ce186f8..291342c 100644 +index ce186f825..291342c90 100644 --- a/src/main/java/net/minecraft/server/BlockDragonEgg.java +++ b/src/main/java/net/minecraft/server/BlockDragonEgg.java @@ -44,7 +44,7 @@ public class BlockDragonEgg extends Block { @@ -21,5 +21,5 @@ index ce186f8..291342c 100644 } -- -2.7.3.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0233-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/0232-Fix-MC-117075-TE-Unload-Lag-Spike.patch similarity index 96% rename from Spigot-Server-Patches/0233-Fix-MC-117075-TE-Unload-Lag-Spike.patch rename to Spigot-Server-Patches/0232-Fix-MC-117075-TE-Unload-Lag-Spike.patch index c60c36a6c5..3c009f0379 100644 --- a/Spigot-Server-Patches/0233-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/0232-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -1,4 +1,4 @@ -From cf26274e3d4eebb66781babe9364e228d1751371 Mon Sep 17 00:00:00 2001 +From 635b62974365f6ae0b039790b1725092c4508043 Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 9 Aug 2017 17:51:22 -0500 Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike @@ -34,5 +34,5 @@ index 30cf4a251..f690aaa10 100644 this.tileEntityListUnload.clear(); } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0234-Allow-specifying-a-custom-authentication-servers-dow.patch b/Spigot-Server-Patches/0233-Allow-specifying-a-custom-authentication-servers-dow.patch similarity index 94% rename from Spigot-Server-Patches/0234-Allow-specifying-a-custom-authentication-servers-dow.patch rename to Spigot-Server-Patches/0233-Allow-specifying-a-custom-authentication-servers-dow.patch index b9523e3c43..f0f19006f1 100644 --- a/Spigot-Server-Patches/0234-Allow-specifying-a-custom-authentication-servers-dow.patch +++ b/Spigot-Server-Patches/0233-Allow-specifying-a-custom-authentication-servers-dow.patch @@ -1,4 +1,4 @@ -From 6a2d8a485c793db1a77da15bb41fc961568cd0ce Mon Sep 17 00:00:00 2001 +From e6cb0d297e7d941474c2bcc879adedbd5f5786ee Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 17 Aug 2017 16:08:20 -0700 Subject: [PATCH] Allow specifying a custom "authentication servers down" kick @@ -6,7 +6,7 @@ Subject: [PATCH] Allow specifying a custom "authentication servers down" kick diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index f4b23703..f5cb9799 100644 +index f4b237034..f5cb9799b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -1,5 +1,6 @@ @@ -27,7 +27,7 @@ index f4b23703..f5cb9799 100644 + } } diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index c5434e6b..75df9283 100644 +index c5434e6ba..75df92836 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -250,6 +250,10 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -42,5 +42,5 @@ index c5434e6b..75df9283 100644 LoginListener.c.error("Couldn\'t verify username because servers are unavailable"); } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0235-LivingEntity-setKiller.patch b/Spigot-Server-Patches/0234-LivingEntity-setKiller.patch similarity index 93% rename from Spigot-Server-Patches/0235-LivingEntity-setKiller.patch rename to Spigot-Server-Patches/0234-LivingEntity-setKiller.patch index 3ad4c73332..ec6df3f57c 100644 --- a/Spigot-Server-Patches/0235-LivingEntity-setKiller.patch +++ b/Spigot-Server-Patches/0234-LivingEntity-setKiller.patch @@ -1,4 +1,4 @@ -From 2b31d6190696de739cbbf6f5450d4fb2d3cc4117 Mon Sep 17 00:00:00 2001 +From e1494a3b11e1ee5bf25e227cb8a7118234101ffd Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:49:48 -0500 Subject: [PATCH] LivingEntity#setKiller @@ -26,5 +26,5 @@ index 1eafdecb4..f81622a34 100644 return addPotionEffect(effect, false); } -- -2.14.1.windows.1 +2.14.2 diff --git a/Spigot-Server-Patches/0236-Avoid-NPE-during-CraftBlockEntityState-load.patch b/Spigot-Server-Patches/0235-Avoid-NPE-during-CraftBlockEntityState-load.patch similarity index 95% rename from Spigot-Server-Patches/0236-Avoid-NPE-during-CraftBlockEntityState-load.patch rename to Spigot-Server-Patches/0235-Avoid-NPE-during-CraftBlockEntityState-load.patch index 843cea6bd9..f0f2b33bc3 100644 --- a/Spigot-Server-Patches/0236-Avoid-NPE-during-CraftBlockEntityState-load.patch +++ b/Spigot-Server-Patches/0235-Avoid-NPE-during-CraftBlockEntityState-load.patch @@ -1,4 +1,4 @@ -From 220e3ea760acbe9b80893c45b55012089f55cc60 Mon Sep 17 00:00:00 2001 +From 4172ca19330956828839f51a3fb94d2e7c8ddcef Mon Sep 17 00:00:00 2001 From: kashike Date: Mon, 18 Sep 2017 13:38:40 -0700 Subject: [PATCH] Avoid NPE during CraftBlockEntityState load @@ -38,5 +38,5 @@ index 266f87d7f..22dcaea72 100644 } -- -2.14.1 +2.14.2 diff --git a/Spigot-Server-Patches/0236-Anti-Xray.patch b/Spigot-Server-Patches/0236-Anti-Xray.patch new file mode 100644 index 0000000000..539a3ca1d4 --- /dev/null +++ b/Spigot-Server-Patches/0236-Anti-Xray.patch @@ -0,0 +1,1583 @@ +From 12b129d5b07628e21299a3ed82829426c2c34c92 Mon Sep 17 00:00:00 2001 +From: stonar96 +Date: Thu, 21 Sep 2017 00:38:47 +0200 +Subject: [PATCH] Anti-Xray + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index 54d081fd..14f652d4 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -1,7 +1,10 @@ + package com.destroystokyo.paper; + ++import java.util.Arrays; + import java.util.List; + ++import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray.ChunkEdgeMode; ++import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray.EngineMode; + import net.minecraft.server.MinecraftServer; + import org.bukkit.Bukkit; + import org.bukkit.configuration.file.YamlConfiguration; +@@ -428,4 +431,25 @@ public class PaperWorldConfig { + disableCreeperLingeringEffect = getBoolean("disable-creeper-lingering-effect", false); + log("Creeper lingering effect: " + disableCreeperLingeringEffect); + } ++ ++ public boolean antiXray; ++ public boolean asynchronous; ++ public EngineMode engineMode; ++ public ChunkEdgeMode chunkEdgeMode; ++ public int maxChunkSectionIndex; ++ public List hiddenBlocks; ++ public List replacementBlocks; ++ private void antiXray() { ++ antiXray = getBoolean("anti-xray.enabled", false); ++ asynchronous = true; ++ engineMode = EngineMode.getById(getInt("anti-xray.engine-mode", EngineMode.HIDE.getId())); ++ engineMode = engineMode == null ? EngineMode.HIDE : engineMode; ++ chunkEdgeMode = ChunkEdgeMode.getById(getInt("anti-xray.chunk-edge-mode", ChunkEdgeMode.DEFAULT.getId())); ++ chunkEdgeMode = chunkEdgeMode == null ? ChunkEdgeMode.DEFAULT : chunkEdgeMode; ++ maxChunkSectionIndex = getInt("anti-xray.max-chunk-section-index", 3); ++ maxChunkSectionIndex = maxChunkSectionIndex > 15 ? 15 : maxChunkSectionIndex; ++ hiddenBlocks = getList("anti-xray.hidden-blocks", Arrays.asList((Object) "gold_ore", "iron_ore", "coal_ore", "lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "redstone_ore", "lit_redstone_ore", "clay", "emerald_ore", "ender_chest")); ++ replacementBlocks = getList("anti-xray.replacement-blocks", Arrays.asList((Object) "stone", "planks")); ++ log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Chunk Edge Mode: " + chunkEdgeMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks"); ++ } + } +diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java +new file mode 100644 +index 00000000..6833cfad +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java +@@ -0,0 +1,36 @@ ++package com.destroystokyo.paper.antixray; ++ ++import net.minecraft.server.BlockPosition; ++import net.minecraft.server.Chunk; ++import net.minecraft.server.IBlockData; ++import net.minecraft.server.PacketPlayOutMapChunk; ++import net.minecraft.server.World; ++ ++public class ChunkPacketBlockController { ++ ++ public static final ChunkPacketBlockController NO_OPERATION_INSTANCE = new ChunkPacketBlockController(); ++ ++ protected ChunkPacketBlockController() { ++ ++ } ++ ++ public IBlockData[] getPredefinedBlockData(Chunk chunk, int chunkSectionIndex) { ++ return null; ++ } ++ ++ public boolean onChunkPacketCreate(Chunk chunk, int chunkSectionSelector, boolean force) { ++ return true; ++ } ++ ++ public PacketPlayOutMapChunkInfo getPacketPlayOutMapChunkInfo(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector) { ++ return null; ++ } ++ ++ public void modifyBlocks(PacketPlayOutMapChunk packetPlayOutMapChunk, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo) { ++ packetPlayOutMapChunk.setReady(true); ++ } ++ ++ public void updateNearbyBlocks(World world, BlockPosition blockPosition) { ++ ++ } ++} +diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +new file mode 100644 +index 00000000..91fa945f +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +@@ -0,0 +1,627 @@ ++package com.destroystokyo.paper.antixray; ++ ++import java.util.HashSet; ++import java.util.Set; ++import java.util.concurrent.Executors; ++import java.util.concurrent.ExecutorService; ++ ++import com.destroystokyo.paper.PaperWorldConfig; ++ ++import net.minecraft.server.Block; ++import net.minecraft.server.BlockPosition; ++import net.minecraft.server.Blocks; ++import net.minecraft.server.Chunk; ++import net.minecraft.server.ChunkSection; ++import net.minecraft.server.DataPalette; ++import net.minecraft.server.DataPaletteBlock; ++import net.minecraft.server.DataPaletteGlobal; ++import net.minecraft.server.IBlockData; ++import net.minecraft.server.PacketPlayOutMapChunk; ++import net.minecraft.server.World; ++ ++import org.bukkit.World.Environment; ++ ++public class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockController { ++ ++ private static ExecutorService executorServiceInstance = null; ++ private final ExecutorService executorService; ++ private final boolean asynchronous; ++ private final EngineMode engineMode; ++ private final ChunkEdgeMode chunkEdgeMode; ++ private final int maxChunkSectionIndex; ++ private final IBlockData[] predefinedBlockData; ++ private final IBlockData[] predefinedBlockDataStone; ++ private final IBlockData[] predefinedBlockDataNetherrack; ++ private final IBlockData[] predefinedBlockDataEndStone; ++ private final int[] predefinedBlockDataBits; ++ private final int[] predefinedBlockDataBitsGlobal; ++ private final int[] predefinedBlockDataBitsStoneGlobal; ++ private final int[] predefinedBlockDataBitsNetherrackGlobal; ++ private final int[] predefinedBlockDataBitsEndStoneGlobal; ++ private final boolean[] solidGlobal = new boolean[Block.REGISTRY_ID.size()]; ++ private final boolean[] obfuscateGlobal = new boolean[Block.REGISTRY_ID.size()]; ++ private final ChunkSection[] emptyNearbyChunkSections = {Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION}; ++ ++ public ChunkPacketBlockControllerAntiXray(PaperWorldConfig paperWorldConfig) { ++ asynchronous = paperWorldConfig.asynchronous; ++ engineMode = paperWorldConfig.engineMode; ++ chunkEdgeMode = paperWorldConfig.chunkEdgeMode; ++ maxChunkSectionIndex = paperWorldConfig.maxChunkSectionIndex; ++ ++ if (asynchronous) { ++ executorService = getExecutorServiceInstance(); ++ } else { ++ executorService = null; ++ } ++ ++ if (engineMode == EngineMode.HIDE) { ++ predefinedBlockData = null; ++ predefinedBlockDataStone = new IBlockData[] {Blocks.STONE.getBlockData()}; ++ predefinedBlockDataNetherrack = new IBlockData[] {Blocks.NETHERRACK.getBlockData()}; ++ predefinedBlockDataEndStone = new IBlockData[] {Blocks.END_STONE.getBlockData()}; ++ predefinedBlockDataBits = new int[] {1}; ++ predefinedBlockDataBitsGlobal = null; ++ predefinedBlockDataBitsStoneGlobal = new int[] {Block.REGISTRY_ID.getId(Blocks.STONE.getBlockData())}; ++ predefinedBlockDataBitsNetherrackGlobal = new int[] {Block.REGISTRY_ID.getId(Blocks.NETHERRACK.getBlockData())}; ++ predefinedBlockDataBitsEndStoneGlobal = new int[] {Block.REGISTRY_ID.getId(Blocks.END_STONE.getBlockData())}; ++ } else { ++ Set predefinedBlockDataSet = new HashSet(); ++ ++ for (Object id : paperWorldConfig.hiddenBlocks) { ++ Block block = Block.getByName(String.valueOf(id)); ++ ++ if (block != null && !block.isTileEntity()) { ++ predefinedBlockDataSet.add(block.getBlockData()); ++ } ++ } ++ ++ predefinedBlockData = predefinedBlockDataSet.size() == 0 ? new IBlockData[] {Blocks.DIAMOND_ORE.getBlockData()} : predefinedBlockDataSet.toArray(new IBlockData[predefinedBlockDataSet.size()]); ++ predefinedBlockDataStone = null; ++ predefinedBlockDataNetherrack = null; ++ predefinedBlockDataEndStone = null; ++ predefinedBlockDataBits = new int[predefinedBlockData.length]; ++ predefinedBlockDataBitsGlobal = new int[predefinedBlockData.length]; ++ boolean containsDefaultBlockData = false; ++ ++ for (int i = 0; i < predefinedBlockData.length; i++) { ++ predefinedBlockDataBits[i] = containsDefaultBlockData ? i : (containsDefaultBlockData = predefinedBlockData[i] == DataPaletteBlock.DEFAULT_BLOCK_DATA) ? 0 : i + 1; ++ predefinedBlockDataBitsGlobal[i] = Block.REGISTRY_ID.getId(predefinedBlockData[i]); ++ } ++ ++ predefinedBlockDataBitsStoneGlobal = null; ++ predefinedBlockDataBitsNetherrackGlobal = null; ++ predefinedBlockDataBitsEndStoneGlobal = null; ++ } ++ ++ for (Object id : (engineMode == EngineMode.HIDE) ? paperWorldConfig.hiddenBlocks : paperWorldConfig.replacementBlocks) { ++ Block block = Block.getByName(String.valueOf(id)); ++ ++ if (block != null) { ++ obfuscateGlobal[Block.REGISTRY_ID.getId(block.getBlockData())] = true; ++ } ++ } ++ ++ for (int i = 0; i < solidGlobal.length; i++) { ++ IBlockData blockData = Block.REGISTRY_ID.fromId(i); ++ ++ if (blockData != null) { ++ solidGlobal[i] = blockData.getBlock().isOccluding(blockData) && blockData.getBlock() != Blocks.MOB_SPAWNER && blockData.getBlock() != Blocks.BARRIER; ++ } ++ } ++ } ++ ++ private static ExecutorService getExecutorServiceInstance() { ++ if (executorServiceInstance == null) { ++ executorServiceInstance = Executors.newSingleThreadExecutor(); ++ } ++ ++ return executorServiceInstance; ++ } ++ ++ @Override ++ public IBlockData[] getPredefinedBlockData(Chunk chunk, int chunkSectionIndex) { ++ //Return the block data which should be added to the data palettes so that they can be used for the obfuscation ++ if (chunkSectionIndex <= maxChunkSectionIndex) { ++ switch (engineMode) { ++ case HIDE: ++ switch (chunk.world.getWorld().getEnvironment()) { ++ case NETHER: ++ return predefinedBlockDataNetherrack; ++ case THE_END: ++ return predefinedBlockDataEndStone; ++ default: ++ return predefinedBlockDataStone; ++ } ++ default: ++ return predefinedBlockData; ++ } ++ } ++ ++ return null; ++ } ++ ++ @Override ++ public boolean onChunkPacketCreate(Chunk chunk, int chunkSectionSelector, boolean force) { ++ //Load nearby chunks if necessary ++ if (chunkEdgeMode == ChunkEdgeMode.WAIT && !force) { ++ if (chunk.world.getChunkIfLoaded(chunk.locX - 1, chunk.locZ) == null || chunk.world.getChunkIfLoaded(chunk.locX + 1, chunk.locZ) == null || chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ - 1) == null || chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ + 1) == null) { ++ //Don't create the chunk packet now, wait until nearby chunks are loaded and create it later ++ return false; ++ } ++ } else if (chunkEdgeMode == ChunkEdgeMode.LOAD || chunkEdgeMode == ChunkEdgeMode.WAIT) { ++ chunk.world.getChunkAt(chunk.locX - 1, chunk.locZ); ++ chunk.world.getChunkAt(chunk.locX + 1, chunk.locZ); ++ chunk.world.getChunkAt(chunk.locX, chunk.locZ - 1); ++ chunk.world.getChunkAt(chunk.locX, chunk.locZ + 1); ++ } ++ ++ //Create the chunk packet now ++ return true; ++ } ++ ++ @Override ++ public PacketPlayOutMapChunkInfoAntiXray getPacketPlayOutMapChunkInfo(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector) { ++ //Return a new instance to collect data and objects in the right state while creating the chunk packet for thread safe access later ++ PacketPlayOutMapChunkInfoAntiXray packetPlayOutMapChunkInfoAntiXray = new PacketPlayOutMapChunkInfoAntiXray(packetPlayOutMapChunk, chunk, chunkSectionSelector, this); ++ packetPlayOutMapChunkInfoAntiXray.setNearbyChunks(chunk.world.getChunkIfLoaded(chunk.locX - 1, chunk.locZ), chunk.world.getChunkIfLoaded(chunk.locX + 1, chunk.locZ), chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ - 1), chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ + 1)); ++ return packetPlayOutMapChunkInfoAntiXray; ++ } ++ ++ @Override ++ public void modifyBlocks(PacketPlayOutMapChunk packetPlayOutMapChunk, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo) { ++ if (asynchronous) { ++ executorService.submit((PacketPlayOutMapChunkInfoAntiXray) packetPlayOutMapChunkInfo); ++ } else { ++ obfuscate((PacketPlayOutMapChunkInfoAntiXray) packetPlayOutMapChunkInfo); ++ } ++ } ++ ++ //Actually these fields should be variables inside the obfuscate method but in sync mode or with SingleThreadExecutor in async mode it's okay ++ private final boolean[] solid = new boolean[Block.REGISTRY_ID.size()]; ++ private final boolean[] obfuscate = new boolean[Block.REGISTRY_ID.size()]; ++ //These boolean arrays represent chunk layers, true means don't obfuscate, false means obfuscate ++ private boolean[][] current = new boolean[16][16]; ++ private boolean[][] next = new boolean[16][16]; ++ private boolean[][] nextNext = new boolean[16][16]; ++ private final DataBitsReader dataBitsReader = new DataBitsReader(); ++ private final DataBitsWriter dataBitsWriter = new DataBitsWriter(); ++ private final ChunkSection[] nearbyChunkSections = new ChunkSection[4]; ++ ++ public void obfuscate(PacketPlayOutMapChunkInfoAntiXray packetPlayOutMapChunkInfoAntiXray) { ++ boolean[] solidTemp = null; ++ boolean[] obfuscateTemp = null; ++ dataBitsReader.setDataBits(packetPlayOutMapChunkInfoAntiXray.getData()); ++ dataBitsWriter.setDataBits(packetPlayOutMapChunkInfoAntiXray.getData()); ++ int counter = 0; ++ ++ for (int chunkSectionIndex = 0; chunkSectionIndex <= maxChunkSectionIndex; chunkSectionIndex++) { ++ if (packetPlayOutMapChunkInfoAntiXray.isWritten(chunkSectionIndex) && packetPlayOutMapChunkInfoAntiXray.getPredefinedBlockData(chunkSectionIndex) != null) { ++ int[] predefinedBlockDataBitsTemp = packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex) instanceof DataPaletteGlobal ? engineMode == EngineMode.HIDE ? packetPlayOutMapChunkInfoAntiXray.getChunk().world.getWorld().getEnvironment() == Environment.NETHER ? predefinedBlockDataBitsNetherrackGlobal : packetPlayOutMapChunkInfoAntiXray.getChunk().world.getWorld().getEnvironment() == Environment.THE_END ? predefinedBlockDataBitsEndStoneGlobal : predefinedBlockDataBitsStoneGlobal : predefinedBlockDataBitsGlobal : predefinedBlockDataBits; ++ dataBitsWriter.setIndex(packetPlayOutMapChunkInfoAntiXray.getDataBitsIndex(chunkSectionIndex)); ++ ++ //Check if the chunk section below was not obfuscated ++ if (chunkSectionIndex == 0 || !packetPlayOutMapChunkInfoAntiXray.isWritten(chunkSectionIndex - 1) || packetPlayOutMapChunkInfoAntiXray.getPredefinedBlockData(chunkSectionIndex - 1) == null) { ++ //If so, initialize some stuff ++ dataBitsReader.setBitsPerValue(packetPlayOutMapChunkInfoAntiXray.getBitsPerValue(chunkSectionIndex)); ++ dataBitsReader.setIndex(packetPlayOutMapChunkInfoAntiXray.getDataBitsIndex(chunkSectionIndex)); ++ solidTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex), solid, solidGlobal); ++ obfuscateTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex), obfuscate, obfuscateGlobal); ++ //Read the blocks of the upper layer of the chunk section below if it exists ++ ChunkSection belowChunkSection = null; ++ boolean skipFirstLayer = chunkSectionIndex == 0 || (belowChunkSection = packetPlayOutMapChunkInfoAntiXray.getChunk().getSections()[chunkSectionIndex - 1]) == Chunk.EMPTY_CHUNK_SECTION; ++ ++ for (int z = 0; z < 16; z++) { ++ for (int x = 0; x < 16; x++) { ++ current[z][x] = true; ++ next[z][x] = skipFirstLayer || !solidGlobal[Block.REGISTRY_ID.getId(belowChunkSection.getType(x, 15, z))]; ++ } ++ } ++ ++ //Abuse the obfuscateLayer method to read the blocks of the first layer of the current chunk section ++ dataBitsWriter.setBitsPerValue(0); ++ obfuscateLayer(-1, dataBitsReader, dataBitsWriter, solidTemp, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, emptyNearbyChunkSections, counter); ++ } ++ ++ dataBitsWriter.setBitsPerValue(packetPlayOutMapChunkInfoAntiXray.getBitsPerValue(chunkSectionIndex)); ++ nearbyChunkSections[0] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[0] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[0].getSections()[chunkSectionIndex]; ++ nearbyChunkSections[1] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[1] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[1].getSections()[chunkSectionIndex]; ++ nearbyChunkSections[2] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[2] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[2].getSections()[chunkSectionIndex]; ++ nearbyChunkSections[3] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[3] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[3].getSections()[chunkSectionIndex]; ++ ++ //Obfuscate all layers of the current chunk section except the upper one ++ for (int y = 0; y < 15; y++) { ++ boolean[][] temp = current; ++ current = next; ++ next = nextNext; ++ nextNext = temp; ++ counter = obfuscateLayer(y, dataBitsReader, dataBitsWriter, solidTemp, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, nearbyChunkSections, counter); ++ } ++ ++ //Check if the chunk section above doesn't need obfuscation ++ if (chunkSectionIndex == maxChunkSectionIndex || !packetPlayOutMapChunkInfoAntiXray.isWritten(chunkSectionIndex + 1) || packetPlayOutMapChunkInfoAntiXray.getPredefinedBlockData(chunkSectionIndex + 1) == null) { ++ //If so, obfuscate the upper layer of the current chunk section by reading blocks of the first layer from the chunk section above if it exists ++ ChunkSection aboveChunkSection; ++ ++ if (chunkSectionIndex != 15 && (aboveChunkSection = packetPlayOutMapChunkInfoAntiXray.getChunk().getSections()[chunkSectionIndex + 1]) != Chunk.EMPTY_CHUNK_SECTION) { ++ boolean[][] temp = current; ++ current = next; ++ next = nextNext; ++ nextNext = temp; ++ ++ for (int z = 0; z < 16; z++) { ++ for (int x = 0; x < 16; x++) { ++ if (!solidGlobal[Block.REGISTRY_ID.getId(aboveChunkSection.getType(x, 0, z))]) { ++ current[z][x] = true; ++ } ++ } ++ } ++ ++ //There is nothing to read anymore ++ dataBitsReader.setBitsPerValue(0); ++ solid[0] = true; ++ counter = obfuscateLayer(15, dataBitsReader, dataBitsWriter, solid, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, nearbyChunkSections, counter); ++ } ++ } else { ++ //If not, initialize the reader and other stuff for the chunk section above to obfuscate the upper layer of the current chunk section ++ dataBitsReader.setBitsPerValue(packetPlayOutMapChunkInfoAntiXray.getBitsPerValue(chunkSectionIndex + 1)); ++ dataBitsReader.setIndex(packetPlayOutMapChunkInfoAntiXray.getDataBitsIndex(chunkSectionIndex + 1)); ++ solidTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex + 1), solid, solidGlobal); ++ obfuscateTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex + 1), obfuscate, obfuscateGlobal); ++ boolean[][] temp = current; ++ current = next; ++ next = nextNext; ++ nextNext = temp; ++ counter = obfuscateLayer(15, dataBitsReader, dataBitsWriter, solidTemp, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, nearbyChunkSections, counter); ++ } ++ ++ dataBitsWriter.finish(); ++ } ++ } ++ ++ packetPlayOutMapChunkInfoAntiXray.getPacketPlayOutMapChunk().setReady(true); ++ } ++ ++ private int obfuscateLayer(int y, DataBitsReader dataBitsReader, DataBitsWriter dataBitsWriter, boolean[] solid, boolean[] obfuscate, int[] predefinedBlockDataBits, boolean[][] current, boolean[][] next, boolean[][] nextNext, ChunkSection[] nearbyChunkSections, int counter) { ++ //First block of first line ++ int dataBits = dataBitsReader.read(); ++ ++ if (nextNext[0][0] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[0][1] = true; ++ next[1][0] = true; ++ } else { ++ if (nearbyChunkSections[2] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[2].getType(0, y, 15))] || nearbyChunkSections[0] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[0].getType(15, y, 0))] || current[0][0]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[0][0] = true; ++ } ++ ++ //First line ++ for (int x = 1; x < 15; x++) { ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[0][x] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[0][x - 1] = true; ++ next[0][x + 1] = true; ++ next[1][x] = true; ++ } else { ++ if (nearbyChunkSections[2] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[2].getType(x, y, 15))] || current[0][x]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[0][x] = true; ++ } ++ } ++ ++ //Last block of first line ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[0][15] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[0][14] = true; ++ next[1][15] = true; ++ } else { ++ if (nearbyChunkSections[2] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[2].getType(15, y, 15))] || nearbyChunkSections[1] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[1].getType(0, y, 0))] || current[0][15]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[0][15] = true; ++ } ++ ++ //All inner lines ++ for (int z = 1; z < 15; z++) { ++ //First block ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[z][0] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[z][1] = true; ++ next[z - 1][0] = true; ++ next[z + 1][0] = true; ++ } else { ++ if (nearbyChunkSections[0] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[0].getType(15, y, z))] || current[z][0]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[z][0] = true; ++ } ++ ++ //All inner blocks ++ for (int x = 1; x < 15; x++) { ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[z][x] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[z][x - 1] = true; ++ next[z][x + 1] = true; ++ next[z - 1][x] = true; ++ next[z + 1][x] = true; ++ } else { ++ if (current[z][x]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[z][x] = true; ++ } ++ } ++ ++ //Last block ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[z][15] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[z][14] = true; ++ next[z - 1][15] = true; ++ next[z + 1][15] = true; ++ } else { ++ if (nearbyChunkSections[1] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[1].getType(0, y, z))] || current[z][15]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[z][15] = true; ++ } ++ } ++ ++ //First block of last line ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[15][0] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[15][1] = true; ++ next[14][0] = true; ++ } else { ++ if (nearbyChunkSections[3] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[3].getType(0, y, 0))] || nearbyChunkSections[0] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[0].getType(15, y, 15))] || current[15][0]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[15][0] = true; ++ } ++ ++ //Last line ++ for (int x = 1; x < 15; x++) { ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[15][x] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[15][x - 1] = true; ++ next[15][x + 1] = true; ++ next[14][x] = true; ++ } else { ++ if (nearbyChunkSections[3] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[3].getType(x, y, 0))] || current[15][x]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[15][x] = true; ++ } ++ } ++ ++ //Last block of last line ++ dataBits = dataBitsReader.read(); ++ ++ if (nextNext[15][15] = !solid[dataBits]) { ++ dataBitsWriter.skip(); ++ next[15][14] = true; ++ next[14][15] = true; ++ } else { ++ if (nearbyChunkSections[3] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[3].getType(15, y, 0))] || nearbyChunkSections[1] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[1].getType(0, y, 15))] || current[15][15]) { ++ dataBitsWriter.skip(); ++ } else { ++ if (counter >= predefinedBlockDataBits.length) { ++ counter = 0; ++ } ++ ++ dataBitsWriter.write(predefinedBlockDataBits[counter++]); ++ } ++ } ++ ++ if (!obfuscate[dataBits]) { ++ next[15][15] = true; ++ } ++ ++ return counter; ++ } ++ ++ private boolean[] readDataPalette(DataPalette dataPalette, boolean[] temp, boolean[] global) { ++ if (dataPalette instanceof DataPaletteGlobal) { ++ return global; ++ } ++ ++ IBlockData blockData; ++ ++ for (int i = 0; (blockData = dataPalette.getBlockData(i)) != null; i++) { ++ temp[i] = global[Block.REGISTRY_ID.getId(blockData)]; ++ } ++ ++ return temp; ++ } ++ ++ @Override ++ public void updateNearbyBlocks(World world, BlockPosition blockPosition) { ++ BlockPosition temp = blockPosition.west(); ++ updateBlock(world, temp); ++ updateBlock(world, temp.west()); ++ updateBlock(world, temp.down()); ++ updateBlock(world, temp.up()); ++ updateBlock(world, temp.north()); ++ updateBlock(world, temp.south()); ++ updateBlock(world, temp = blockPosition.east()); ++ updateBlock(world, temp.east()); ++ updateBlock(world, temp.down()); ++ updateBlock(world, temp.up()); ++ updateBlock(world, temp.north()); ++ updateBlock(world, temp.south()); ++ updateBlock(world, temp = blockPosition.down()); ++ updateBlock(world, temp.down()); ++ updateBlock(world, temp.north()); ++ updateBlock(world, temp.south()); ++ updateBlock(world, temp = blockPosition.up()); ++ updateBlock(world, temp.up()); ++ updateBlock(world, temp.north()); ++ updateBlock(world, temp.south()); ++ updateBlock(world, temp = blockPosition.north()); ++ updateBlock(world, temp.north()); ++ updateBlock(world, temp = blockPosition.south()); ++ updateBlock(world, temp.south()); ++ } ++ ++ private void updateBlock(World world, BlockPosition blockPosition) { ++ if (world.isLoaded(blockPosition)) { ++ IBlockData blockData = world.getType(blockPosition); ++ ++ if (obfuscateGlobal[Block.REGISTRY_ID.getId(blockData)]) { ++ world.notify(blockPosition, blockData, blockData, 3); ++ } ++ } ++ } ++ ++ public enum EngineMode { ++ ++ HIDE(1, "hide ores"), ++ OBFUSCATE(2, "obfuscate"); ++ ++ private final int id; ++ private final String description; ++ ++ EngineMode(int id, String description) { ++ this.id = id; ++ this.description = description; ++ } ++ ++ public static EngineMode getById(int id) { ++ for (EngineMode engineMode : values()) { ++ if (engineMode.id == id) { ++ return engineMode; ++ } ++ } ++ ++ return null; ++ } ++ ++ public int getId() { ++ return id; ++ } ++ ++ public String getDescription() { ++ return description; ++ } ++ } ++ ++ public enum ChunkEdgeMode { ++ ++ DEFAULT(1, "default"), ++ WAIT(2, "wait until nearby chunks are loaded"), ++ LOAD(3, "load nearby chunks"); ++ ++ private final int id; ++ private final String description; ++ ++ ChunkEdgeMode(int id, String description) { ++ this.id = id; ++ this.description = description; ++ } ++ ++ public static ChunkEdgeMode getById(int id) { ++ for (ChunkEdgeMode chunkEdgeMode : values()) { ++ if (chunkEdgeMode.id == id) { ++ return chunkEdgeMode; ++ } ++ } ++ ++ return null; ++ } ++ ++ public int getId() { ++ return id; ++ } ++ ++ public String getDescription() { ++ return description; ++ } ++ } ++} +diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java +new file mode 100644 +index 00000000..92399318 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java +@@ -0,0 +1,56 @@ ++package com.destroystokyo.paper.antixray; ++ ++public class DataBitsReader { ++ ++ private byte[] dataBits; ++ private int bitsPerValue; ++ private int mask; ++ private int longInDataBitsIndex; ++ private int bitInLongIndex; ++ private long current; ++ ++ public void setDataBits(byte[] dataBits) { ++ this.dataBits = dataBits; ++ } ++ ++ public void setBitsPerValue(int bitsPerValue) { ++ this.bitsPerValue = bitsPerValue; ++ mask = (1 << bitsPerValue) - 1; ++ } ++ ++ public void setIndex(int index) { ++ this.longInDataBitsIndex = index; ++ bitInLongIndex = 0; ++ init(); ++ } ++ ++ private void init() { ++ if (dataBits.length > longInDataBitsIndex + 7) { ++ current = ((((long) dataBits[longInDataBitsIndex]) << 56) ++ | (((long) dataBits[longInDataBitsIndex + 1] & 0xff) << 48) ++ | (((long) dataBits[longInDataBitsIndex + 2] & 0xff) << 40) ++ | (((long) dataBits[longInDataBitsIndex + 3] & 0xff) << 32) ++ | (((long) dataBits[longInDataBitsIndex + 4] & 0xff) << 24) ++ | (((long) dataBits[longInDataBitsIndex + 5] & 0xff) << 16) ++ | (((long) dataBits[longInDataBitsIndex + 6] & 0xff) << 8) ++ | (((long) dataBits[longInDataBitsIndex + 7] & 0xff))); ++ } ++ } ++ ++ public int read() { ++ int value = (int) (current >>> bitInLongIndex) & mask; ++ bitInLongIndex += bitsPerValue; ++ ++ if (bitInLongIndex > 63) { ++ bitInLongIndex -= 64; ++ longInDataBitsIndex += 8; ++ init(); ++ ++ if (bitInLongIndex > 0) { ++ value |= current << bitsPerValue - bitInLongIndex & mask; ++ } ++ } ++ ++ return value; ++ } ++} +diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java +new file mode 100644 +index 00000000..aca0b9d7 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java +@@ -0,0 +1,84 @@ ++package com.destroystokyo.paper.antixray; ++ ++public class DataBitsWriter { ++ ++ private byte[] dataBits; ++ private int bitsPerValue; ++ private long mask; ++ private int longInDataBitsIndex; ++ private int bitInLongIndex; ++ private long current; ++ private boolean dirty; ++ ++ public void setDataBits(byte[] dataBits) { ++ this.dataBits = dataBits; ++ } ++ ++ public void setBitsPerValue(int bitsPerValue) { ++ this.bitsPerValue = bitsPerValue; ++ mask = (1 << bitsPerValue) - 1; ++ } ++ ++ public void setIndex(int index) { ++ this.longInDataBitsIndex = index; ++ bitInLongIndex = 0; ++ init(); ++ } ++ ++ private void init() { ++ if (dataBits.length > longInDataBitsIndex + 7) { ++ current = ((((long) dataBits[longInDataBitsIndex]) << 56) ++ | (((long) dataBits[longInDataBitsIndex + 1] & 0xff) << 48) ++ | (((long) dataBits[longInDataBitsIndex + 2] & 0xff) << 40) ++ | (((long) dataBits[longInDataBitsIndex + 3] & 0xff) << 32) ++ | (((long) dataBits[longInDataBitsIndex + 4] & 0xff) << 24) ++ | (((long) dataBits[longInDataBitsIndex + 5] & 0xff) << 16) ++ | (((long) dataBits[longInDataBitsIndex + 6] & 0xff) << 8) ++ | (((long) dataBits[longInDataBitsIndex + 7] & 0xff))); ++ } ++ ++ dirty = false; ++ } ++ ++ public void finish() { ++ if (dirty && dataBits.length > longInDataBitsIndex + 7) { ++ dataBits[longInDataBitsIndex] = (byte) (current >> 56 & 0xff); ++ dataBits[longInDataBitsIndex + 1] = (byte) (current >> 48 & 0xff); ++ dataBits[longInDataBitsIndex + 2] = (byte) (current >> 40 & 0xff); ++ dataBits[longInDataBitsIndex + 3] = (byte) (current >> 32 & 0xff); ++ dataBits[longInDataBitsIndex + 4] = (byte) (current >> 24 & 0xff); ++ dataBits[longInDataBitsIndex + 5] = (byte) (current >> 16 & 0xff); ++ dataBits[longInDataBitsIndex + 6] = (byte) (current >> 8 & 0xff); ++ dataBits[longInDataBitsIndex + 7] = (byte) (current & 0xff); ++ } ++ } ++ ++ public void write(int value) { ++ current = current & ~(mask << bitInLongIndex) | (value & mask) << bitInLongIndex; ++ dirty = true; ++ bitInLongIndex += bitsPerValue; ++ ++ if (bitInLongIndex > 63) { ++ finish(); ++ bitInLongIndex -= 64; ++ longInDataBitsIndex += 8; ++ init(); ++ ++ if (bitInLongIndex > 0) { ++ current = current & ~(mask >>> bitsPerValue - bitInLongIndex) | (value & mask) >>> bitsPerValue - bitInLongIndex; ++ dirty = true; ++ } ++ } ++ } ++ ++ public void skip() { ++ bitInLongIndex += bitsPerValue; ++ ++ if (bitInLongIndex > 63) { ++ finish(); ++ bitInLongIndex -= 64; ++ longInDataBitsIndex += 8; ++ init(); ++ } ++ } ++} +diff --git a/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfo.java b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfo.java +new file mode 100644 +index 00000000..0bd269a0 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfo.java +@@ -0,0 +1,80 @@ ++package com.destroystokyo.paper.antixray; ++ ++import net.minecraft.server.Chunk; ++import net.minecraft.server.DataPalette; ++import net.minecraft.server.IBlockData; ++import net.minecraft.server.PacketPlayOutMapChunk; ++ ++public class PacketPlayOutMapChunkInfo { ++ ++ private final PacketPlayOutMapChunk packetPlayOutMapChunk; ++ private final Chunk chunk; ++ private final int chunkSectionSelector; ++ private byte[] data; ++ private final int[] bitsPerValue = new int[16]; ++ private final DataPalette[] dataPalettes = new DataPalette[16]; ++ private final int[] dataBitsIndexes = new int[16]; ++ private final IBlockData[][] predefinedBlockData = new IBlockData[16][]; ++ ++ public PacketPlayOutMapChunkInfo(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector) { ++ this.packetPlayOutMapChunk = packetPlayOutMapChunk; ++ this.chunk = chunk; ++ this.chunkSectionSelector = chunkSectionSelector; ++ } ++ ++ public PacketPlayOutMapChunk getPacketPlayOutMapChunk() { ++ return packetPlayOutMapChunk; ++ } ++ ++ public Chunk getChunk() { ++ return chunk; ++ } ++ ++ public int getChunkSectionSelector() { ++ return chunkSectionSelector; ++ } ++ ++ public byte[] getData() { ++ return data; ++ } ++ ++ public void setData(byte[] data) { ++ this.data = data; ++ } ++ ++ public int getBitsPerValue(int chunkSectionIndex) { ++ return bitsPerValue[chunkSectionIndex]; ++ } ++ ++ public void setBitsPerValue(int chunkSectionIndex, int bitsPerValue) { ++ this.bitsPerValue[chunkSectionIndex] = bitsPerValue; ++ } ++ ++ public DataPalette getDataPalette(int chunkSectionIndex) { ++ return dataPalettes[chunkSectionIndex]; ++ } ++ ++ public void setDataPalette(int chunkSectionIndex, DataPalette dataPalette) { ++ dataPalettes[chunkSectionIndex] = dataPalette; ++ } ++ ++ public int getDataBitsIndex(int chunkSectionIndex) { ++ return dataBitsIndexes[chunkSectionIndex]; ++ } ++ ++ public void setDataBitsIndex(int chunkSectionIndex, int dataBitsIndex) { ++ dataBitsIndexes[chunkSectionIndex] = dataBitsIndex; ++ } ++ ++ public IBlockData[] getPredefinedBlockData(int chunkSectionIndex) { ++ return predefinedBlockData[chunkSectionIndex]; ++ } ++ ++ public void setPredefinedBlockData(int chunkSectionIndex, IBlockData[] predefinedBlockData) { ++ this.predefinedBlockData[chunkSectionIndex] = predefinedBlockData; ++ } ++ ++ public boolean isWritten(int chunkSectionIndex) { ++ return bitsPerValue[chunkSectionIndex] != 0; ++ } ++} +diff --git a/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfoAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfoAntiXray.java +new file mode 100644 +index 00000000..8ea2beb5 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfoAntiXray.java +@@ -0,0 +1,28 @@ ++package com.destroystokyo.paper.antixray; ++ ++import net.minecraft.server.Chunk; ++import net.minecraft.server.PacketPlayOutMapChunk; ++ ++public class PacketPlayOutMapChunkInfoAntiXray extends PacketPlayOutMapChunkInfo implements Runnable { ++ ++ private Chunk[] nearbyChunks; ++ private final ChunkPacketBlockControllerAntiXray chunkPacketBlockControllerAntiXray; ++ ++ public PacketPlayOutMapChunkInfoAntiXray(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector, ChunkPacketBlockControllerAntiXray chunkPacketBlockControllerAntiXray) { ++ super(packetPlayOutMapChunk, chunk, chunkSectionSelector); ++ this.chunkPacketBlockControllerAntiXray = chunkPacketBlockControllerAntiXray; ++ } ++ ++ public Chunk[] getNearbyChunks() { ++ return nearbyChunks; ++ } ++ ++ public void setNearbyChunks(Chunk... nearbyChunks) { ++ this.nearbyChunks = nearbyChunks; ++ } ++ ++ @Override ++ public void run() { ++ chunkPacketBlockControllerAntiXray.obfuscate(this); ++ } ++} +diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java +index e6e54965..33018fa3 100644 +--- a/src/main/java/net/minecraft/server/Chunk.java ++++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -129,7 +129,7 @@ public class Chunk { + int j1 = i1 >> 4; + + if (this.sections[j1] == Chunk.a) { +- this.sections[j1] = new ChunkSection(j1 << 4, flag1); ++ this.sections[j1] = new ChunkSection(j1 << 4, flag1, world.chunkPacketBlockController.getPredefinedBlockData(this, j1)); // Paper - Anti-Xray - Add predefined block data + } + + this.sections[j1].setType(k, i1 & 15, l, iblockdata); +@@ -496,7 +496,7 @@ public class Chunk { + return null; + } + +- chunksection = new ChunkSection(j >> 4 << 4, this.world.worldProvider.m()); ++ chunksection = new ChunkSection(j >> 4 << 4, this.world.worldProvider.m(), this.world.chunkPacketBlockController.getPredefinedBlockData(this, j >> 4)); // Paper - Anti-Xray - Add predefined block data + this.sections[j >> 4] = chunksection; + flag = j >= i1; + } +@@ -581,7 +581,7 @@ public class Chunk { + ChunkSection chunksection = this.sections[k >> 4]; + + if (chunksection == Chunk.a) { +- chunksection = new ChunkSection(k >> 4 << 4, this.world.worldProvider.m()); ++ chunksection = new ChunkSection(k >> 4 << 4, this.world.worldProvider.m(), this.world.chunkPacketBlockController.getPredefinedBlockData(this, k >> 4)); // Paper - Anti-Xray - Add predefined block data + this.sections[k >> 4] = chunksection; + this.initLighting(); + } +diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +index 14f88e91..bcce5e8b 100644 +--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +@@ -416,7 +416,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + for (int k = 0; k < nbttaglist.size(); ++k) { + NBTTagCompound nbttagcompound1 = nbttaglist.get(k); + byte b0 = nbttagcompound1.getByte("Y"); +- ChunkSection chunksection = new ChunkSection(b0 << 4, flag1); ++ ChunkSection chunksection = new ChunkSection(b0 << 4, flag1, world.chunkPacketBlockController.getPredefinedBlockData(chunk, b0)); // Paper - Anti-Xray - Add predefined block data + byte[] abyte = nbttagcompound1.getByteArray("Blocks"); + NibbleArray nibblearray = new NibbleArray(nbttagcompound1.getByteArray("Data")); + NibbleArray nibblearray1 = nbttagcompound1.hasKeyOfType("Add", 7) ? new NibbleArray(nbttagcompound1.getByteArray("Add")) : null; +diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java +index afdc4a77..aae227fd 100644 +--- a/src/main/java/net/minecraft/server/ChunkSection.java ++++ b/src/main/java/net/minecraft/server/ChunkSection.java +@@ -9,9 +9,15 @@ public class ChunkSection { + private NibbleArray emittedLight; + private NibbleArray skyLight; + ++ // Paper start - Anti-Xray - Support default constructor + public ChunkSection(int i, boolean flag) { ++ this(i, flag, (IBlockData[]) null); ++ } ++ // Paper end ++ ++ public ChunkSection(int i, boolean flag, IBlockData[] predefinedBlockData) { // Paper - Anti-Xray - Add predefined block data + this.yPos = i; +- this.blockIds = new DataPaletteBlock(); ++ this.blockIds = new DataPaletteBlock(predefinedBlockData); // Paper - Anti-Xray - Add predefined block data + this.emittedLight = new NibbleArray(); + if (flag) { + this.skyLight = new NibbleArray(); +@@ -19,10 +25,16 @@ public class ChunkSection { + + } + +- // CraftBukkit start ++ // Paper start - Anti-Xray - Support default constructor + public ChunkSection(int y, boolean flag, char[] blockIds) { ++ this(y, flag, blockIds, null); ++ } ++ // Paper end ++ ++ // CraftBukkit start ++ public ChunkSection(int y, boolean flag, char[] blockIds, IBlockData[] predefinedBlockData) { // Paper - Anti-Xray - Add predefined block data + this.yPos = y; +- this.blockIds = new DataPaletteBlock(); ++ this.blockIds = new DataPaletteBlock(predefinedBlockData); // Paper - Anti-Xray - Add predefined block data + for (int i = 0; i < blockIds.length; i++) { + int xx = i & 15; + int yy = (i >> 8) & 15; +diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java +index fa0fd8a9..401dc7cd 100644 +--- a/src/main/java/net/minecraft/server/DataBits.java ++++ b/src/main/java/net/minecraft/server/DataBits.java +@@ -51,6 +51,7 @@ public class DataBits { + } + } + ++ public long[] getDataBits() { return this.a(); } // Paper - Anti-Xray - OBFHELPER + public long[] a() { + return this.a; + } +diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java +index 5765b258..d522611e 100644 +--- a/src/main/java/net/minecraft/server/DataPalette.java ++++ b/src/main/java/net/minecraft/server/DataPalette.java +@@ -4,8 +4,10 @@ import javax.annotation.Nullable; + + public interface DataPalette { + ++ default int getDataBits(IBlockData blockData) { return this.a(blockData); } // Paper - Anti-Xray - OBFHELPER + int a(IBlockData iblockdata); + ++ @Nullable default IBlockData getBlockData(int dataBits) { return this.a(dataBits); } // Paper - Anti-Xray - OBFHELPER + @Nullable + IBlockData a(int i); + +diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java +index 2cb462b8..67784b4a 100644 +--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java ++++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java +@@ -2,22 +2,55 @@ package net.minecraft.server; + + import javax.annotation.Nullable; + ++// Paper start ++import com.destroystokyo.paper.antixray.PacketPlayOutMapChunkInfo; // Anti-Xray ++// Paper end ++ + public class DataPaletteBlock implements DataPaletteExpandable { + + private static final DataPalette d = new DataPaletteGlobal(); + protected static final IBlockData a = Blocks.AIR.getBlockData(); public static final IBlockData DEFAULT_BLOCK_DATA = DataPaletteBlock.a; // Paper - OBFHELPER +- protected DataBits b; +- protected DataPalette c; +- private int e; ++ protected DataBits b; protected DataBits getDataBits() { return this.b; } // Paper - Anti-Xray - OBFHELPER ++ protected DataPalette c; protected DataPalette getDataPalette() { return this.c; } // Paper - Anti-Xray - OBFHELPER ++ private int e; private int getBitsPerValue() { return this.e; } // Paper - Anti-Xray - OBFHELPER ++ private final IBlockData[] predefinedBlockData; // Paper - Anti-Xray - Add predefined block data + ++ // Paper start - Anti-Xray - Support default constructor + public DataPaletteBlock() { +- this.b(4); ++ this(null); + } ++ // Paper end ++ ++ // Paper start - Anti-Xray - Add predefined block data ++ public DataPaletteBlock(IBlockData[] predefinedBlockData) { ++ this.predefinedBlockData = predefinedBlockData; ++ ++ if (predefinedBlockData == null) { ++ // Default constructor ++ this.setBitsPerValue(4); ++ } else { ++ // Count the bits of the maximum array index to initialize a data palette with enough space from the beginning ++ // The length of the array is used because air is also added to the data palette from the beginning ++ // Start with at least 4 ++ int maxIndex = predefinedBlockData.length >> 4; ++ int bitCount = 4; ++ ++ while (maxIndex != 0) { ++ maxIndex >>= 1; ++ bitCount++; ++ } ++ ++ // Initialize with at least 15 free indixes ++ this.setBitsPerValue((1 << bitCount) - predefinedBlockData.length < 16 ? bitCount + 1 : bitCount); ++ } ++ } ++ // Paper end + + private static int b(int i, int j, int k) { + return j << 8 | k << 4 | i; + } + ++ private void setBitsPerValue(int bitsPerValue) { this.b(bitsPerValue); } // Paper - Anti-Xray - OBFHELPER + private void b(int i) { + if (i != this.e) { + this.e = i; +@@ -32,6 +65,15 @@ public class DataPaletteBlock implements DataPaletteExpandable { + } + + this.c.a(DataPaletteBlock.a); ++ ++ // Paper start - Anti-Xray - Add predefined block data ++ if (this.predefinedBlockData != null) { ++ for (int j = 0; j < this.predefinedBlockData.length; j++) { ++ this.getDataPalette().getDataBits(this.predefinedBlockData[j]); ++ } ++ } ++ // Paper end ++ + this.b = new DataBits(this.e, 4096); + } + } +@@ -73,9 +115,27 @@ public class DataPaletteBlock implements DataPaletteExpandable { + return iblockdata == null ? DataPaletteBlock.a : iblockdata; + } + ++ // Paper start - Anti-Xray - Support default method ++ public void writeBlocks(PacketDataSerializer packetDataSerializer) { this.b(packetDataSerializer); } // OBFHELPER + public void b(PacketDataSerializer packetdataserializer) { ++ this.b(packetdataserializer, null, 0); ++ } ++ // Paper end ++ ++ public void writeBlocks(PacketDataSerializer packetDataSerializer, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo, int chunkSectionIndex) { this.b(packetDataSerializer, packetPlayOutMapChunkInfo, chunkSectionIndex); } // Paper - Anti-Xray - OBFHELPER ++ public void b(PacketDataSerializer packetdataserializer, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo, int chunkSectionIndex) { // Paper - Anti-Xray - Add chunk packet info + packetdataserializer.writeByte(this.e); + this.c.b(packetdataserializer); ++ ++ // Paper start - Anti-Xray - Add chunk packet info ++ if (packetPlayOutMapChunkInfo != null) { ++ packetPlayOutMapChunkInfo.setBitsPerValue(chunkSectionIndex, this.getBitsPerValue()); ++ packetPlayOutMapChunkInfo.setDataPalette(chunkSectionIndex, this.getDataPalette()); ++ packetPlayOutMapChunkInfo.setDataBitsIndex(chunkSectionIndex, packetdataserializer.writerIndex() + PacketDataSerializer.countBytes(this.getDataBits().getDataBits().length)); ++ packetPlayOutMapChunkInfo.setPredefinedBlockData(chunkSectionIndex, this.predefinedBlockData); ++ } ++ // Paper end ++ + packetdataserializer.a(this.b.a()); + } + +diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java +index d0b67d8f..eeaa625d 100644 +--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java ++++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +@@ -74,6 +74,7 @@ public class EntityFallingBlock extends Entity { + blockposition = new BlockPosition(this); + if (this.world.getType(blockposition).getBlock() == block && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR, 0).isCancelled()) { + this.world.setAir(blockposition); ++ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray + } else if (!this.world.isClientSide) { + this.die(); + return; +@@ -139,6 +140,7 @@ public class EntityFallingBlock extends Entity { + return; + } + this.world.setTypeAndData(blockposition, this.block, 3); ++ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray + // CraftBukkit end + if (block instanceof BlockFalling) { + ((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata); +diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java +index e148901e..61fbdeb6 100644 +--- a/src/main/java/net/minecraft/server/Explosion.java ++++ b/src/main/java/net/minecraft/server/Explosion.java +@@ -228,6 +228,7 @@ public class Explosion { + blockposition = (BlockPosition) iterator.next(); + IBlockData iblockdata = this.world.getType(blockposition); + Block block = iblockdata.getBlock(); ++ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray + + if (flag) { + double d0 = (double) ((float) blockposition.getX() + this.world.random.nextFloat()); +diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java +index d583cced..2eddb68d 100644 +--- a/src/main/java/net/minecraft/server/NetworkManager.java ++++ b/src/main/java/net/minecraft/server/NetworkManager.java +@@ -62,7 +62,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + } + }; + private final EnumProtocolDirection h; +- private final Queue i = Queues.newConcurrentLinkedQueue(); ++ private final Queue i = Queues.newConcurrentLinkedQueue(); private final Queue getPacketQueue() { return this.i; } // Paper - Anti-Xray - OBFHELPER + private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); + public Channel channel; + // Spigot Start // PAIL +@@ -138,8 +138,8 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + } + + public void sendPacket(Packet packet) { +- if (this.isConnected()) { +- this.m(); ++ if (this.isConnected() && this.trySendQueue() && !(packet instanceof PacketPlayOutMapChunk && !((PacketPlayOutMapChunk) packet).isReady())) { // Paper - Async-Anti-Xray - Add chunk packets which are not ready or all packets if the queue contains chunk packets which are not ready to the queue and send the packets later in the right order ++ //this.m(); // Paper - Async-Anti-Xray - Move to if statement (this.trySendQueue()) + this.a(packet, (GenericFutureListener[]) null); + } else { + this.j.writeLock().lock(); +@@ -154,8 +154,8 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + } + + public void sendPacket(Packet packet, GenericFutureListener> genericfuturelistener, GenericFutureListener>... agenericfuturelistener) { +- if (this.isConnected()) { +- this.m(); ++ if (this.isConnected() && this.trySendQueue() && !(packet instanceof PacketPlayOutMapChunk && !((PacketPlayOutMapChunk) packet).isReady())) { // Paper - Async-Anti-Xray - Add chunk packets which are not ready or all packets if the queue contains chunk packets which are not ready to the queue and send the packets later in the right order ++ //this.m(); // Paper - Async-Anti-Xray - Move to if statement (this.trySendQueue()) + this.a(packet, (GenericFutureListener[]) ArrayUtils.add(agenericfuturelistener, 0, genericfuturelistener)); + } else { + this.j.writeLock().lock(); +@@ -169,6 +169,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + + } + ++ private void dispatchPacket(final Packet packet, @Nullable final GenericFutureListener>[] genericFutureListeners) { this.a(packet, genericFutureListeners); } // Paper - Anti-Xray - OBFHELPER + private void a(final Packet packet, @Nullable final GenericFutureListener>[] agenericfuturelistener) { + final EnumProtocol enumprotocol = EnumProtocol.a(packet); + final EnumProtocol enumprotocol1 = (EnumProtocol) this.channel.attr(NetworkManager.c).get(); +@@ -210,22 +211,38 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + + } + +- private void m() { ++ // Paper start - Async-Anti-Xray - Stop dispatching further packets and return false if the peeked packet is a chunk packet which is not ready ++ private boolean trySendQueue() { return this.m(); } // OBFHELPER ++ private boolean m() { // void -> boolean + if (this.channel != null && this.channel.isOpen()) { +- this.j.readLock().lock(); ++ if (this.i.isEmpty()) { // return if the packet queue is empty so that the write lock by Anti-Xray doesn't affect the vanilla performance at all ++ return true; ++ } ++ ++ this.j.writeLock().lock(); // readLock -> writeLock (because of race condition between peek and poll) + + try { + while (!this.i.isEmpty()) { +- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.i.poll(); +- +- this.a(networkmanager_queuedpacket.a, networkmanager_queuedpacket.b); ++ NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.getPacketQueue().peek(); // poll -> peek ++ ++ if (networkmanager_queuedpacket != null) { // Fix NPE (Spigot bug caused by handleDisconnection()) ++ if (networkmanager_queuedpacket.getPacket() instanceof PacketPlayOutMapChunk && !((PacketPlayOutMapChunk) networkmanager_queuedpacket.getPacket()).isReady()) { // Check if the peeked packet is a chunk packet which is not ready ++ return false; // Return false if the peeked packet is a chunk packet which is not ready ++ } else { ++ this.getPacketQueue().poll(); // poll here ++ this.dispatchPacket(networkmanager_queuedpacket.getPacket(), networkmanager_queuedpacket.getGenericFutureListeners()); // dispatch the packet ++ } ++ } + } + } finally { +- this.j.readLock().unlock(); ++ this.j.writeLock().unlock(); // readLock -> writeLock (because of race condition between peek and poll) + } + + } ++ ++ return true; // Return true if all packets were dispatched + } ++ // Paper end + + public void a() { + this.m(); +@@ -332,8 +349,8 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + + static class QueuedPacket { + +- private final Packet a; +- private final GenericFutureListener>[] b; ++ private final Packet a; private final Packet getPacket() { return this.a; } // Paper - Anti-Xray - OBFHELPER ++ private final GenericFutureListener>[] b; private final GenericFutureListener>[] getGenericFutureListeners() { return this.b; } // Paper - Anti-Xray - OBFHELPER + + public QueuedPacket(Packet packet, GenericFutureListener>... agenericfuturelistener) { + this.a = packet; +diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java +index c1273e98..d71734df 100644 +--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java ++++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java +@@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf { + this.a = bytebuf; + } + ++ public static int countBytes(int i) { return PacketDataSerializer.a(i); } // Paper - Anti-Xray - OBFHELPER + public static int a(int i) { + for (int j = 1; j < 5; ++j) { + if ((i & -1 << j * 7) == 0) { +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +index d16669bc..306a6b7c 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +@@ -8,6 +8,10 @@ import java.util.Iterator; + import java.util.List; + import java.util.Map.Entry; + ++// Paper start ++import com.destroystokyo.paper.antixray.PacketPlayOutMapChunkInfo; // Anti-Xray ++// Paper end ++ + public class PacketPlayOutMapChunk implements Packet { + + private int a; +@@ -16,17 +20,30 @@ public class PacketPlayOutMapChunk implements Packet { + private byte[] d; + private List e; + private boolean f; ++ private volatile boolean ready = false; // Paper - Async-Anti-Xray - Ready flag for the network manager + +- public PacketPlayOutMapChunk() {} ++ // Paper start - Async-Anti-Xray - Set the ready flag to true ++ public PacketPlayOutMapChunk() { ++ this.ready = true; ++ } ++ // Paper end + + public PacketPlayOutMapChunk(Chunk chunk, int i) { ++ PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo = chunk.world.chunkPacketBlockController.getPacketPlayOutMapChunkInfo(this, chunk, i); // Paper - Anti-Xray - Add chunk packet info + this.a = chunk.locX; + this.b = chunk.locZ; + this.f = i == '\uffff'; + boolean flag = chunk.getWorld().worldProvider.m(); + + this.d = new byte[this.a(chunk, flag, i)]; +- this.c = this.a(new PacketDataSerializer(this.g()), chunk, flag, i); ++ ++ // Paper start - Anti-Xray - Add chunk packet info ++ if (packetPlayOutMapChunkInfo != null) { ++ packetPlayOutMapChunkInfo.setData(this.d); ++ } ++ // Paper end ++ ++ this.c = this.writeChunk(new PacketDataSerializer(this.g()), chunk, flag, i, packetPlayOutMapChunkInfo); // Paper - Anti-Xray - Add chunk packet info + this.e = Lists.newArrayList(); + Iterator iterator = chunk.getTileEntities().entrySet().iterator(); + +@@ -43,8 +60,19 @@ public class PacketPlayOutMapChunk implements Packet { + } + } + ++ chunk.world.chunkPacketBlockController.modifyBlocks(this, packetPlayOutMapChunkInfo); // Paper - Anti-Xray - Modify blocks + } + ++ // Paper start - Async-Anti-Xray - Getter and Setter for the ready flag ++ public boolean isReady() { ++ return this.ready; ++ } ++ ++ public void setReady(boolean ready) { ++ this.ready = ready; ++ } ++ // Paper end ++ + public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.a = packetdataserializer.readInt(); + this.b = packetdataserializer.readInt(); +@@ -97,7 +125,15 @@ public class PacketPlayOutMapChunk implements Packet { + return bytebuf; + } + ++ // Paper start - Anti-Xray - Support default method ++ public int writeChunk(PacketDataSerializer packetDataSerializer, Chunk chunk, boolean writeSkyLightArray, int chunkSectionSelector) { return this.a(packetDataSerializer, chunk, writeSkyLightArray, chunkSectionSelector); } // OBFHELPER + public int a(PacketDataSerializer packetdataserializer, Chunk chunk, boolean flag, int i) { ++ return this.a(packetdataserializer, chunk, flag, i, null); ++ } ++ // Paper end ++ ++ public int writeChunk(PacketDataSerializer packetDataSerializer, Chunk chunk, boolean writeSkyLightArray, int chunkSectionSelector, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo) { return this.a(packetDataSerializer, chunk, writeSkyLightArray, chunkSectionSelector, packetPlayOutMapChunkInfo); } // Paper - Anti-Xray - OBFHELPER ++ public int a(PacketDataSerializer packetdataserializer, Chunk chunk, boolean flag, int i, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo) { // Paper - Anti-Xray - Add chunk packet info + int j = 0; + ChunkSection[] achunksection = chunk.getSections(); + int k = 0; +@@ -107,7 +143,7 @@ public class PacketPlayOutMapChunk implements Packet { + + if (chunksection != Chunk.a && (!this.e() || !chunksection.a()) && (i & 1 << k) != 0) { + j |= 1 << k; +- chunksection.getBlocks().b(packetdataserializer); ++ chunksection.getBlocks().writeBlocks(packetdataserializer, packetPlayOutMapChunkInfo, k); // Paper - Anti-Xray - Add chunk packet info + packetdataserializer.writeBytes(chunksection.getEmittedLightArray().asBytes()); + if (flag) { + packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes()); +diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java +index 48a008e0..045adbd3 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/PlayerChunk.java +@@ -134,6 +134,8 @@ public class PlayerChunk { + return false; + } else if (!this.chunk.isReady()) { + return false; ++ } else if (!this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, '\uffff', false)) { // Paper - Anti-Xray - Load nearby chunks if necessary ++ return false; // Paper - Anti-Xray - Wait and try again later + } else { + this.dirtyCount = 0; + this.h = 0; +@@ -154,6 +156,7 @@ public class PlayerChunk { + + public void sendChunk(EntityPlayer entityplayer) { + if (this.done) { ++ this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, '\uffff', true); // Paper - Anti-Xray - Load nearby chunks if necessary + entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, '\uffff')); + this.playerChunkMap.getWorld().getTracker().a(entityplayer, this.chunk); + } +@@ -218,6 +221,7 @@ public class PlayerChunk { + this.a(this.playerChunkMap.getWorld().getTileEntity(blockposition)); + } + } else if (this.dirtyCount == 64) { ++ this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, this.h, true); // Paper - Anti-Xray - Load nearby chunks if necessary + this.a((Packet) (new PacketPlayOutMapChunk(this.chunk, this.h))); + } else { + this.a((Packet) (new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk))); +diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java +index a1689c06..b1826332 100644 +--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java ++++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java +@@ -200,6 +200,8 @@ public class PlayerInteractManager { + } + + } ++ ++ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray + } + + public void a(BlockPosition blockposition) { +diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java +index 8860a012..fa0d66d6 100644 +--- a/src/main/java/net/minecraft/server/RegistryBlockID.java ++++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +@@ -47,6 +47,7 @@ public class RegistryBlockID implements Registry { // Paper - Fix decompile e + return Iterators.filter(this.b.iterator(), Predicates.notNull()); + } + ++ public int size() { return this.a(); } // Paper - Anti-Xray - OBFHELPER + public int a() { + return this.a.size(); + } +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index f690aaa1..e193f86f 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -35,6 +35,8 @@ import org.bukkit.generator.ChunkGenerator; + + // Paper start + import java.util.Set; ++import com.destroystokyo.paper.antixray.ChunkPacketBlockController; // Anti-Xray ++import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray; // Anti-Xray + import com.google.common.collect.Sets; + // Paper end + +@@ -138,6 +140,7 @@ public abstract class World implements IBlockAccess { + public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot + + public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper ++ public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray + + public final co.aikar.timings.WorldTimingsHandler timings; // Paper + private boolean guardEntityList; // Spigot +@@ -169,6 +172,7 @@ public abstract class World implements IBlockAccess { + protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { + this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot + this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper ++ this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray + this.generator = gen; + this.world = new CraftWorld((WorldServer) this, gen, env); + this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit +@@ -547,6 +551,7 @@ public abstract class World implements IBlockAccess { + this.c(blockposition, block); + } + ++ this.chunkPacketBlockController.updateNearbyBlocks(this, blockposition); // Paper - Anti-Xray + } + + public void a(BlockPosition blockposition, Block block, EnumDirection enumdirection) { +diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +index 9942f0c7..2da6edc6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java ++++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +@@ -73,7 +73,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { + } + // Build chunk section + if (emptyTest != 0) { +- csect[sec] = new ChunkSection(sec << 4, true, section); ++ csect[sec] = new ChunkSection(sec << 4, true, section, this.world.chunkPacketBlockController.getPredefinedBlockData(chunk, sec)); // Paper - Anti-Xray - Add predefined block data + } + } + } +@@ -98,7 +98,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { + secBlkID[i] = (char) Block.REGISTRY_ID.getId(b.getBlockData()); + } + // Build chunk section +- csect[sec] = new ChunkSection(sec << 4, true, secBlkID); ++ csect[sec] = new ChunkSection(sec << 4, true, secBlkID, this.world.chunkPacketBlockController.getPredefinedBlockData(chunk, sec)); // Paper - Anti-Xray - Add predefined block data + } + } + else { // Else check for byte-per-block section data +@@ -120,7 +120,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { + Block b = Block.getById(btypes[sec][i] & 0xFF); + secBlkID[i] = (char) Block.REGISTRY_ID.getId(b.getBlockData()); + } +- csect[sec] = new ChunkSection(sec << 4, true, secBlkID); ++ csect[sec] = new ChunkSection(sec << 4, true, secBlkID, this.world.chunkPacketBlockController.getPredefinedBlockData(chunk, sec)); // Paper - Anti-Xray - Add predefined block data + } + } + else { // Else, fall back to pre 1.2 method +@@ -160,7 +160,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { + } + // If section built, finish prepping its state + if (csbytes != null) { +- ChunkSection cs = csect[sec] = new ChunkSection(sec << 4, true, csbytes); ++ ChunkSection cs = csect[sec] = new ChunkSection(sec << 4, true, csbytes, this.world.chunkPacketBlockController.getPredefinedBlockData(chunk, sec)); // Paper - Anti-Xray - Add predefined block data + cs.recalcBlockCounts(); + } + } +-- +2.14.1.windows.1 + diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 260cf2a78b..ade491481b 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -60,6 +60,7 @@ import ControllerJump import DataBits import DataConverterMaterialId import DataInspectorBlockEntity +import DataPalette import DefinedStructure import EntityLlama import EULA @@ -75,6 +76,7 @@ import NBTTagCompound import NBTTagList import PersistentScoreboard import PacketPlayInUseEntity +import PacketPlayOutMapChunk import PacketPlayOutPlayerListHeaderFooter import PacketPlayOutScoreboardTeam import PacketPlayOutTitle @@ -87,6 +89,7 @@ import PathfinderWater import PersistentVillage import PlayerConnectionUtils import RegionFile +import RegistryBlockID import RemoteControlListener import TileEntityEnderChest import TileEntityLootable