aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2018-10-28 18:08:08 -0400
committerZach Brown <[email protected]>2018-10-28 18:08:08 -0400
commitece0b19c59c98df5dda540e612b71fcc1c688f66 (patch)
tree9dd56ec787c85df866623dcf0f60ce9483f2220f /Spigot-Server-Patches
parente6473fc52055bd50a5686a1c71af87cebaf12de2 (diff)
downloadPaper-ece0b19c59c98df5dda540e612b71fcc1c688f66.tar.gz
Paper-ece0b19c59c98df5dda540e612b71fcc1c688f66.zip
Update upstream B/CB/S
Diffstat (limited to 'Spigot-Server-Patches')
-rw-r--r--Spigot-Server-Patches/0009-Timings-v2.patch89
-rw-r--r--Spigot-Server-Patches/0340-Anti-Xray.patch74
2 files changed, 90 insertions, 73 deletions
diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch
index 4b853458bc..3da0367b6d 100644
--- a/Spigot-Server-Patches/0009-Timings-v2.patch
+++ b/Spigot-Server-Patches/0009-Timings-v2.patch
@@ -1,4 +1,4 @@
-From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
+From 155c59138feb1470d84c679f22c0d72c3c2874ca Mon Sep 17 00:00:00 2001
From: Aikar <[email protected]>
Date: Thu, 3 Mar 2016 04:00:11 -0600
Subject: [PATCH] Timings v2
@@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
new file mode 100644
-index 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..a6292f1d7
--- /dev/null
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +1,132 @@
@@ -144,7 +144,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+}
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
new file mode 100644
-index 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..145cb274b
--- /dev/null
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +1,104 @@
@@ -253,7 +253,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 87a7b6980..2f17e5219 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -14,11 +14,14 @@ import java.util.concurrent.TimeUnit;
@@ -297,7 +297,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index dfcb285df..bb8b450ac 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -23,6 +23,15 @@ public class Block implements IMaterial {
@@ -317,7 +317,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private final float frictionFactor;
protected final BlockStateList<Block, IBlockData> blockStateList;
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index e634325ba..68ba638c6 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -842,6 +842,7 @@ public class Chunk implements IChunkAccess {
@@ -337,7 +337,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 85a065f03..4b8b77710 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -14,6 +14,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
@@ -357,7 +357,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return chunk1;
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 5819e86f3..7239f5437 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -90,7 +90,7 @@ public class ChunkProviderServer implements IChunkProvider {
@@ -398,7 +398,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot
} catch (IOException ioexception) {
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 71c0e069a..e53e40e43 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1,5 +1,6 @@
@@ -445,7 +445,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index b7cdc495a..8b9b076de 100644
--- a/src/main/java/net/minecraft/server/CustomFunction.java
+++ b/src/main/java/net/minecraft/server/CustomFunction.java
@@ -13,12 +13,22 @@ public class CustomFunction {
@@ -472,7 +472,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return this.b;
}
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 4d7e15179..40ff72f72 100644
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
@@ -109,7 +109,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener {
@@ -485,7 +485,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
int j = 0;
CustomFunction.c[] acustomfunction_c = customfunction.b();
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 7f56df0b6..b488178d5 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -29,7 +29,7 @@ import org.apache.logging.log4j.Level;
@@ -538,7 +538,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return waitable.get();
} catch (java.util.concurrent.ExecutionException e) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index fde9d4d51..c765b5cf3 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender;
@@ -577,7 +577,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
protected float ab() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 03cd1db36..dec9d2d08 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -32,7 +32,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@@ -653,7 +653,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index ae31935c4..70c9b1f50 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -168,7 +168,7 @@ public class EntityTracker {
@@ -684,7 +684,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index bdbd24b6b..2d812b024 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1,5 +1,6 @@
@@ -837,7 +837,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.methodProfiler.e();
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 15194bd63..12a8fec29 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1,5 +1,6 @@
@@ -931,7 +931,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 5646f28a8..e6bb2506c 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -59,6 +59,7 @@ import org.bukkit.inventory.CraftingInventory;
@@ -942,7 +942,23 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// CraftBukkit end
public class PlayerConnection implements PacketListenerPlayIn, ITickable {
-@@ -1627,7 +1628,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+@@ -136,7 +137,6 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+ // CraftBukkit end
+
+ public void Y_() {
+- org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot
+ this.syncPosition();
+ this.player.playerTick();
+ this.player.setLocation(this.l, this.m, this.n, this.player.yaw, this.player.pitch);
+@@ -209,7 +209,6 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+ this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
+ this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
+ }
+- org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.stopTiming(); // Spigot
+
+ }
+
+@@ -1629,7 +1628,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
// CraftBukkit end
private void handleCommand(String s) {
@@ -951,7 +967,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// CraftBukkit start - whole method
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
-@@ -1638,7 +1639,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+@@ -1640,7 +1639,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
this.server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -960,7 +976,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
return;
}
-@@ -1651,7 +1652,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+@@ -1653,7 +1652,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return;
} finally {
@@ -970,7 +986,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s);
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 616797dc6..3a5daf670 100644
--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
@@ -1,10 +1,16 @@
@@ -991,7 +1007,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
throw CancelledPacketHandleException.INSTANCE;
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 393c4c118..4d800957a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1,5 +1,6 @@
@@ -1015,7 +1031,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public WhiteList getWhitelist() {
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index a07895935..ee5c2421b 100644
--- a/src/main/java/net/minecraft/server/TickListServer.java
+++ b/src/main/java/net/minecraft/server/TickListServer.java
@@ -24,13 +24,19 @@ public class TickListServer<T> implements TickList<T> {
@@ -1069,7 +1085,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index c69209497..68ac014aa 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -4,12 +4,13 @@ import javax.annotation.Nullable;
@@ -1089,7 +1105,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private final TileEntityTypes<?> e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER
protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 433d0ad96..759fa98c4 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,5 +1,6 @@
@@ -1204,7 +1220,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public boolean a(@Nullable Entity entity, VoxelShape voxelshape) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 74a61f300..d10fb980d 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,5 +1,6 @@
@@ -1311,7 +1327,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
// CraftBukkit start
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 6dd4e18e9..b34a3564c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1896,12 +1896,31 @@ public final class CraftServer implements Server {
@@ -1348,10 +1364,10 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
deleted file mode 100644
-index 7ac07ac07ac0..7ac07ac07ac0
+index 666d1eb9e..000000000
--- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
+++ /dev/null
-@@ -1,174 +0,0 @@
+@@ -1,175 +0,0 @@
-package org.bukkit.craftbukkit;
-
-import com.google.common.collect.Maps;
@@ -1371,6 +1387,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
- public static final CustomTimingsHandler playerListTimer = new CustomTimingsHandler("Player List");
- public static final CustomTimingsHandler commandFunctionsTimer = new CustomTimingsHandler("Command Functions");
- public static final CustomTimingsHandler connectionTimer = new CustomTimingsHandler("Connection Handler");
+- public static final CustomTimingsHandler playerConnectionTimer = new CustomTimingsHandler("** PlayerConnection");
- public static final CustomTimingsHandler tickablesTimer = new CustomTimingsHandler("Tickables");
- public static final CustomTimingsHandler schedulerTimer = new CustomTimingsHandler("Scheduler");
- public static final CustomTimingsHandler chunkIOTickTimer = new CustomTimingsHandler("ChunkIOTick");
@@ -1527,7 +1544,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 413dd35f0..52a8c48fa 100644
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
@@ -1,6 +1,8 @@
@@ -1563,7 +1580,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 9f78f2c4a..832d2de47 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1715,6 +1715,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1582,7 +1599,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public Player.Spigot spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index f11bd7545..93b9134d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -14,6 +14,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@@ -1658,7 +1675,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
private boolean isReady(final int currentTick) {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 7e7ce9a81..46029ce24 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
@@ -1,8 +1,8 @@
@@ -1740,7 +1757,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
- // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index e52ef47b7..3d90b3426 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
@@ -5,6 +5,7 @@ import org.bukkit.util.CachedServerIcon;
@@ -1752,7 +1769,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.value = value;
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index c1071c92e..a99c0cea0 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -30,7 +30,7 @@ import net.minecraft.server.EntityWither;
diff --git a/Spigot-Server-Patches/0340-Anti-Xray.patch b/Spigot-Server-Patches/0340-Anti-Xray.patch
index db28578852..2ea9242934 100644
--- a/Spigot-Server-Patches/0340-Anti-Xray.patch
+++ b/Spigot-Server-Patches/0340-Anti-Xray.patch
@@ -1,11 +1,11 @@
-From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
+From bf5ffa79f05a3980b1b6fbbd843c73a5ec3ebffb Mon Sep 17 00:00:00 2001
From: stonar96 <[email protected]>
Date: Mon, 20 Aug 2018 03:03:58 +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 7ac07ac07ac0..7ac07ac07ac0 100644
+index ac07bcc75..ca93fab88 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -1,7 +1,10 @@
@@ -49,7 +49,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}
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 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..1ba8477bf
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java
@@ -0,0 +1,45 @@
@@ -100,7 +100,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+}
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 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..d00e113ba
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
@@ -0,0 +1,670 @@
@@ -776,7 +776,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java
new file mode 100644
-index 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..a68bace35
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java
@@ -0,0 +1,81 @@
@@ -863,7 +863,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java
new file mode 100644
-index 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..e255a45fa
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java
@@ -0,0 +1,29 @@
@@ -898,7 +898,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+}
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 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..cc586827a
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
@@ -0,0 +1,56 @@
@@ -960,7 +960,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+}
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 7ac07ac07ac0..7ac07ac07ac0
+index 000000000..37093419c
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
@@ -0,0 +1,84 @@
@@ -1049,7 +1049,7 @@ index 7ac07ac07ac0..7ac07ac07ac0
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 585de1bb2..4e8eb137a 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -535,7 +535,7 @@ public class Chunk implements IChunkAccess {
@@ -1071,7 +1071,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
this.initLighting();
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 2dc5a8594..9b4bc3ff6 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -859,7 +859,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@@ -1093,7 +1093,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
chunksection.getBlocks().a(nbttagcompound, "Palette", "BlockStates");
chunksection.a(new NibbleArray(nbttagcompound.getByteArray("BlockLight")));
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 7e4c79a1c..bdfc7d81f 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -10,9 +10,15 @@ public class ChunkSection {
@@ -1114,7 +1114,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
if (flag) {
this.skyLight = new NibbleArray();
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 95eb1a84a..34019bd1b 100644
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
@@ -42,7 +42,7 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
@@ -1136,7 +1136,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
}) : (Scheduler.a) this.progressCache.get(chunkcoordintpair.a());
}
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 6e7454b13..71a3636be 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -1,5 +1,6 @@
@@ -1271,7 +1271,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
int jx = along.length * 64 / 4096;
if (this.h == this.b) {
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index f8facddb4..b2afec5e4 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -158,8 +158,8 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
@@ -1332,7 +1332,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public void a() {
this.o();
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 22a262bb6..40ec398ee 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -1,5 +1,6 @@
@@ -1418,7 +1418,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
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 7ac07ac07ac0..7ac07ac07ac0 100644
+index a0fcac329..2c7c8adf7 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -118,6 +118,8 @@ public class PlayerChunk {
@@ -1449,7 +1449,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
} 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 7ac07ac07ac0..7ac07ac07ac0 100644
+index cae24961f..a9690fb1c 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -206,6 +206,8 @@ public class PlayerInteractManager {
@@ -1462,45 +1462,45 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
public void a(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 0b79c1b16..6554c7727 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
-@@ -46,11 +46,23 @@ public class ProtoChunk implements IChunkAccess {
+@@ -40,12 +40,24 @@ public class ProtoChunk implements IChunkAccess {
+ private long s;
+ private final Map<WorldGenStage.Features, BitSet> t;
private boolean u;
- public boolean needsDecoration; // CraftBukkit
++ private GeneratorAccess world; // Paper - Anti-Xray
-- public ProtoChunk(int i, int j, ChunkConverter chunkconverter) {
-- this(new ChunkCoordIntPair(i, j), chunkconverter);
-+ private final GeneratorAccess world; // Paper - Anti-Xray
+ // Paper start - Anti-Xray - Support default constructors
-+ public ProtoChunk(int ix, int jx, ChunkConverter chunkconverter) {
-+ this(ix, jx, chunkconverter, null);
+ public ProtoChunk(int ix, int jx, ChunkConverter chunkconverter) {
+- this(new ChunkCoordIntPair(ix, jx), chunkconverter);
++ this(new ChunkCoordIntPair(ix, jx), chunkconverter, null);
}
public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter) {
+ this(chunkcoordintpair, chunkconverter, null);
+ }
-+ // Paper end
+
-+ public ProtoChunk(int i, int j, ChunkConverter chunkconverter, GeneratorAccess world) { // Paper - Anti-Xray
-+ this(new ChunkCoordIntPair(i, j), chunkconverter, world); // Paper - Anti-Xray
++ public ProtoChunk(int i, int j, ChunkConverter chunkconverter, GeneratorAccess world) {
++ this(new ChunkCoordIntPair(i, j), chunkconverter, world);
+ }
+
-+ public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, GeneratorAccess world) { // Paper - Anti-Xray
-+ this.world = world; // Paper - Anti-Xray
++ public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, GeneratorAccess world) {
++ this.world = world;
++ // Paper end
this.d = new AtomicInteger();
this.f = Maps.newEnumMap(HeightMap.Type.class);
this.g = ChunkStatus.EMPTY;
-@@ -153,7 +165,7 @@ public class ProtoChunk implements IChunkAccess {
+@@ -132,7 +144,7 @@ public class ProtoChunk implements IChunkAccess {
return iblockdata;
}
-- this.j[j >> 4] = new ChunkSection(j >> 4 << 4, this.x());
-+ this.j[j >> 4] = new ChunkSection(j >> 4 << 4, this.x(), this, this.world, true); // Paper - Anti-Xray
+- this.j[jx >> 4] = new ChunkSection(jx >> 4 << 4, this.x());
++ this.j[jx >> 4] = new ChunkSection(jx >> 4 << 4, this.x(), this, this.world, true); // Paper - Anti-Xray
}
- IBlockData iblockdata1 = this.j[j >> 4].getType(i & 15, j & 15, k & 15);
-@@ -407,7 +419,7 @@ public class ProtoChunk implements IChunkAccess {
+ IBlockData iblockdata1 = this.j[jx >> 4].getType(ix & 15, jx & 15, kx & 15);
+@@ -375,7 +387,7 @@ public class ProtoChunk implements IChunkAccess {
return;
}
@@ -1510,7 +1510,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
if (enumskyblock == EnumSkyBlock.SKY) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index bb0a23fcb..d239fc6d3 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,6 +1,8 @@
@@ -1547,7 +1547,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644
if (iblockdata1 == null) {
// CraftBukkit start - remove blockstate if failed
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java
-index 7ac07ac07ac0..7ac07ac07ac0 100644
+index 550416bef..923d1b282 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java
@@ -17,9 +17,11 @@ import org.bukkit.material.MaterialData;