Houston, we got a patch (#2731)
* Houston, we got a patch * is this the end of the beginning or the beginning of the end
This commit is contained in:
@@ -5,7 +5,7 @@ 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 55b78f54c..cfc4156bc 100644
|
||||
index f5ed0a698..363676348 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -1181,7 +1181,7 @@ index 000000000..37093419c
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 2003522d9..d604f96c1 100644
|
||||
index 14ec31f0a..863a2222f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
@@ -1194,7 +1194,7 @@ index 2003522d9..d604f96c1 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 73f93e494..a02807411 100644
|
||||
index 6371f2f5b..17cacafe7 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader {
|
||||
@@ -1213,10 +1213,10 @@ index 73f93e494..a02807411 100644
|
||||
- ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1);
|
||||
+ ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, worldserver); // Paper - Anti-Xray
|
||||
|
||||
protochunk.a(biomestorage);
|
||||
object = protochunk;
|
||||
protochunk.a(abiomebase);
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
index ca2bf8b77..584b3e639 100644
|
||||
index 0d5deee36..4526527ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkSection {
|
||||
@@ -1227,7 +1227,7 @@ index ca2bf8b77..584b3e639 100644
|
||||
+ short nonEmptyBlockCount; // Paper - private -> package-private
|
||||
private short tickingBlockCount;
|
||||
private short e;
|
||||
final DataPaletteBlock<IBlockData> blockIds; // Paper - package
|
||||
final DataPaletteBlock<IBlockData> blockIds;
|
||||
|
||||
public ChunkSection(int i) {
|
||||
- this(i, (short) 0, (short) 0, (short) 0);
|
||||
@@ -1255,7 +1255,7 @@ index ca2bf8b77..584b3e639 100644
|
||||
|
||||
public IBlockData getType(int i, int j, int k) {
|
||||
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
index 1e2bca1e0..8fba1e2f3 100644
|
||||
index 2c1d1b1a5..44aed6727 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
@@ -1440,7 +1440,7 @@ index e156804f7..96a785af2 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 ef71a1feb..483317608 100644
|
||||
index 47710067a..654474341 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -1451,9 +1451,9 @@ index ef71a1feb..483317608 100644
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
private byte[] e; private byte[] getData() { return this.e; } // Paper - OBFHELPER
|
||||
private List<NBTTagCompound> f;
|
||||
private boolean g;
|
||||
private byte[] f; private byte[] getData() { return this.f; } // Paper - OBFHELPER
|
||||
private List<NBTTagCompound> g;
|
||||
private boolean h;
|
||||
+ private volatile boolean ready; // Paper - Async-Anti-Xray - Ready flag for the network manager
|
||||
|
||||
- public PacketPlayOutMapChunk() {}
|
||||
@@ -1479,37 +1479,33 @@ index ef71a1feb..483317608 100644
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
}
|
||||
|
||||
this.e = new byte[this.a(chunk, i)];
|
||||
- this.c = this.a(new PacketDataSerializer(this.i()), chunk, i);
|
||||
this.f = new byte[this.a(chunk, i)];
|
||||
- this.c = this.a(new PacketDataSerializer(this.j()), chunk, i);
|
||||
+ // Paper start - Anti-Xray - Add chunk packet info
|
||||
+ if (chunkPacketInfo != null) {
|
||||
+ chunkPacketInfo.setData(this.getData());
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ this.c = this.writeChunk(new PacketDataSerializer(this.i()), chunk, i, chunkPacketInfo); // Paper - Anti-Xray - Add chunk packet info
|
||||
this.f = Lists.newArrayList();
|
||||
+ this.c = this.writeChunk(new PacketDataSerializer(this.j()), chunk, i, chunkPacketInfo); // Paper - Anti-Xray - Add chunk packet info
|
||||
this.g = Lists.newArrayList();
|
||||
iterator = chunk.getTileEntities().entrySet().iterator();
|
||||
int totalSigns = 0; // Paper
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
this.f.add(nbttagcompound);
|
||||
}
|
||||
}
|
||||
+ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // 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
|
||||
+
|
||||
|
||||
@Override
|
||||
public void a(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
this.a = packetdataserializer.readInt();
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
|
||||
public int writeChunk(PacketDataSerializer packetDataSerializer, Chunk chunk, int chunkSectionSelector) { return this.a(packetDataSerializer, chunk, chunkSectionSelector); } // Paper - OBFHELPER
|
||||
@@ -1531,9 +1527,13 @@ index ef71a1feb..483317608 100644
|
||||
+ chunksection.getBlocks().writeDataPaletteBlock(packetdataserializer, chunkPacketInfo, k); // Paper - Anti-Xray - Add chunk packet info
|
||||
}
|
||||
}
|
||||
+ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // Paper - Anti-Xray - Modify blocks
|
||||
+ }
|
||||
|
||||
return j;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
index 98590e233..af934ef8b 100644
|
||||
index 43d9a5634..615d27863 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunk {
|
||||
@@ -1558,7 +1558,7 @@ index 98590e233..af934ef8b 100644
|
||||
this.a(new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, chunk), false);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index b04657356..a5df9fee6 100644
|
||||
index 93729eea2..fc6436c4f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
@@ -1580,7 +1580,7 @@ index b04657356..a5df9fee6 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
index a36aba015..f04fc366f 100644
|
||||
index 18ff6dd68..8720dd120 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||
@@ -1591,9 +1591,9 @@ index a36aba015..f04fc366f 100644
|
||||
+ this.world.chunkPacketBlockController.onPlayerLeftClickBlock(this, blockposition, enumdirection); // Paper - Anti-Xray
|
||||
}
|
||||
|
||||
public void a(BlockPosition blockposition, PacketPlayInBlockDig.EnumPlayerDigType packetplayinblockdig_enumplayerdigtype) {
|
||||
public void a(BlockPosition blockposition, PacketPlayInBlockDig.EnumPlayerDigType packetplayinblockdig_enumplayerdigtype, String s) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
|
||||
index 6bdd7dda0..7bad12eb0 100644
|
||||
index 39339fa27..f376e2106 100644
|
||||
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
|
||||
@@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess {
|
||||
@@ -1636,7 +1636,7 @@ index 6bdd7dda0..7bad12eb0 100644
|
||||
|
||||
return this.j[i];
|
||||
diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java
|
||||
index 157ca6a7e..9c114d2d3 100644
|
||||
index a905a29e7..335b64435 100644
|
||||
--- a/src/main/java/net/minecraft/server/TicketType.java
|
||||
+++ b/src/main/java/net/minecraft/server/TicketType.java
|
||||
@@ -0,0 +0,0 @@ public class TicketType<T> {
|
||||
@@ -1648,7 +1648,7 @@ index 157ca6a7e..9c114d2d3 100644
|
||||
public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
|
||||
return new TicketType<>(s, comparator, 0L);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 3f71ca9e4..e31ffdb0d 100644
|
||||
index 9ad76ab32..39725335d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
@@ -1660,7 +1660,7 @@ index 3f71ca9e4..e31ffdb0d 100644
|
||||
import com.destroystokyo.paper.event.server.ServerExceptionEvent;
|
||||
import com.destroystokyo.paper.exception.ServerInternalException;
|
||||
import com.google.common.base.MoreObjects;
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
|
||||
|
||||
public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper
|
||||
@@ -1668,7 +1668,7 @@ index 3f71ca9e4..e31ffdb0d 100644
|
||||
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPosition lastPhysicsProblem; // Spigot
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
protected World(WorldData worlddata, DimensionManager dimensionmanager, BiFunction<World, WorldProvider, IChunkProvider> bifunction, GameProfilerFiller gameprofilerfiller, boolean flag, org.bukkit.generator.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
|
||||
@@ -1676,7 +1676,7 @@ index 3f71ca9e4..e31ffdb0d 100644
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
// CraftBukkit end
|
||||
|
||||
IBlockData iblockdata1 = chunk.setType(blockposition, iblockdata, (i & 64) != 0, (i & 1024) == 0); // CraftBukkit custom NO_PLACE flag
|
||||
|
||||
Reference in New Issue
Block a user