Anti Xray cleanup
Undo the accidental renaming of a method ine45e15cAikar wanted to rename DataPalette#getDataBits(T object) to getOrCreateIdFor ine45e15cbut he also accidentally renamed ChunkPacketInfo#getDataBitsIndex(int chunkSectionIndex) to getOrCreateIdForIndex. Remove chunk-edge-mode and chunk loading entirely from Anti-Xray The chunk-edge-mode is broken since several versions. Loading chunk neighbors for chunk edge obfuscation isn't needed anymore. Unlike in previous versions, these are under normal circumstances already loaded at the time we need them (plugins for example can bypass this). Use the modified methods and constructors everywhere Anti-Xray provides support for the default nms methods and constructors, which where modified by Anti-Xray to avoid breaking stuff (plugins) which somehow uses these methods. However, the modified versions of those methods and constructors should be used where possible.
This commit is contained in:
@@ -20,7 +20,7 @@ remains the same.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/util/math/ThreadUnsafeRandom.java b/src/main/java/com/destroystokyo/paper/util/math/ThreadUnsafeRandom.java
|
||||
new file mode 100644
|
||||
index 0000000000..3edc8e52e0
|
||||
index 00000000000..3edc8e52e06
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/util/math/ThreadUnsafeRandom.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -71,7 +71,7 @@ index 0000000000..3edc8e52e0
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index e29ec958b3..e40375b67a 100644
|
||||
index e29ec958b35..e40375b67a4 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -0,0 +0,0 @@ public class Block implements IMaterial {
|
||||
@@ -86,7 +86,7 @@ index e29ec958b3..e40375b67a 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java
|
||||
index 6d351f0979..a44f65f40d 100644
|
||||
index 6d351f0979e..a44f65f40d2 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockFluids.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockFluids.java
|
||||
@@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource {
|
||||
@@ -99,7 +99,7 @@ index 6d351f0979..a44f65f40d 100644
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index db7ba12fd4..9010359fbd 100644
|
||||
index db7ba12fd4f..9010359fbdc 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
|
||||
@@ -111,7 +111,7 @@ index db7ba12fd4..9010359fbd 100644
|
||||
return this.d(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 42eede6781..65882f4632 100644
|
||||
index a2a0ca3394c..bb95fe20e8a 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 {
|
||||
@@ -126,7 +126,7 @@ index 42eede6781..65882f4632 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
index 4526527aca..3eaf893cdf 100644
|
||||
index eeb7eee925d..64b625e988f 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
@@ -135,30 +135,17 @@ index 4526527aca..3eaf893cdf 100644
|
||||
public static final DataPalette<IBlockData> GLOBAL_PALETTE = new DataPaletteGlobal<>(Block.REGISTRY_ID, Blocks.AIR.getBlockData());
|
||||
- private final int yPos;
|
||||
+ final int yPos; // Paper - private -> package-private
|
||||
short nonEmptyBlockCount; // Paper - private -> package-private
|
||||
private short nonEmptyBlockCount;
|
||||
- private short tickingBlockCount;
|
||||
+ short tickingBlockCount; // Paper - private -> package-private
|
||||
private short e;
|
||||
final DataPaletteBlock<IBlockData> blockIds;
|
||||
|
||||
+ Chunk chunk; // Paper
|
||||
+ final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper
|
||||
+
|
||||
public ChunkSection(int i) {
|
||||
// Paper start - add parameters
|
||||
this(i, (IChunkAccess)null, (IWorldReader)null, true);
|
||||
@@ -0,0 +0,0 @@ public class ChunkSection {
|
||||
this.tickingBlockCount = short1;
|
||||
this.e = short2;
|
||||
this.blockIds = new DataPaletteBlock<>(ChunkSection.GLOBAL_PALETTE, Block.REGISTRY_ID, GameProfileSerializer::d, GameProfileSerializer::a, Blocks.AIR.getBlockData(), world instanceof GeneratorAccess ? ((GeneratorAccess) world).getMinecraftWorld().chunkPacketBlockController.getPredefinedBlockData(world, chunk, this, initializeBlocks) : null, initializeBlocks); // Paper - Anti-Xray - Add predefined block data
|
||||
+ // Paper start
|
||||
+ if (chunk instanceof Chunk) {
|
||||
+ this.chunk = (Chunk)chunk;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public IBlockData getType(int i, int j, int k) {
|
||||
// Paper start - Anti-Xray - Add parameters
|
||||
@Deprecated public ChunkSection(int i) { this(i, null, null, true); } // Notice for updates: Please make sure this constructor isn't used anywhere
|
||||
public ChunkSection(int i, IChunkAccess chunk, World world, boolean initializeBlocks) {
|
||||
@@ -0,0 +0,0 @@ public class ChunkSection {
|
||||
--this.nonEmptyBlockCount;
|
||||
if (iblockdata1.q()) {
|
||||
@@ -215,7 +202,7 @@ index 4526527aca..3eaf893cdf 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
|
||||
index f9680b6830..a61cffa3f4 100644
|
||||
index f9680b6830c..a61cffa3f49 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataBits.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataBits.java
|
||||
@@ -0,0 +0,0 @@ public class DataBits {
|
||||
@@ -266,7 +253,7 @@ index f9680b6830..a61cffa3f4 100644
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
index 44aed67274..fa664897fb 100644
|
||||
index 2c7872bd051..be5f98c3c36 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||
@@ -0,0 +0,0 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> {
|
||||
@@ -285,7 +272,7 @@ index 44aed67274..fa664897fb 100644
|
||||
public interface a<T> {
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
index dd02cb3485..b24a5100b4 100644
|
||||
index dd02cb34850..b24a5100b45 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
|
||||
@@ -298,7 +285,7 @@ index dd02cb3485..b24a5100b4 100644
|
||||
|
||||
public final BlockPosition getHome() { return this.es(); } // Paper - OBFHELPER
|
||||
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
index de43881653..e821c236b4 100644
|
||||
index de43881653f..e821c236b45 100644
|
||||
--- a/src/main/java/net/minecraft/server/IBlockData.java
|
||||
+++ b/src/main/java/net/minecraft/server/IBlockData.java
|
||||
@@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
|
||||
@@ -351,7 +338,7 @@ index de43881653..e821c236b4 100644
|
||||
|
||||
public final SoundEffectType getStepSound() { return this.r(); } // Paper - OBFHELPER
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0c23fc89d7..de9f49b884 100644
|
||||
index 0c23fc89d7a..de9f49b8848 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -376,7 +363,7 @@ index 0c23fc89d7..de9f49b884 100644
|
||||
|
||||
public boolean isSavingDisabled() {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index c348e3e500..fcbc9f2913 100644
|
||||
index c348e3e5008..fcbc9f29139 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
||||
Reference in New Issue
Block a user