diff options
author | Spottedleaf <[email protected]> | 2019-06-24 06:00:26 -0700 |
---|---|---|
committer | Zach <[email protected]> | 2019-06-24 08:00:26 -0500 |
commit | 725081bb9509c7860344569a4a1e41a8b6129129 (patch) | |
tree | 005bda4edc7851481ea9295ecdf422939ffc9146 | |
parent | 35e71bbc9cd837e0d0b5a180acff09de6484054b (diff) | |
download | Paper-725081bb9509c7860344569a4a1e41a8b6129129.tar.gz Paper-725081bb9509c7860344569a4a1e41a8b6129129.zip |
Anti-Xray improvements (#2227)
-rw-r--r-- | Spigot-Server-Patches/0335-Anti-Xray.patch | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Spigot-Server-Patches/0335-Anti-Xray.patch b/Spigot-Server-Patches/0335-Anti-Xray.patch index ec56316cbf..5fb75ece6b 100644 --- a/Spigot-Server-Patches/0335-Anti-Xray.patch +++ b/Spigot-Server-Patches/0335-Anti-Xray.patch @@ -1,4 +1,4 @@ -From b6acf5d97d05f6b9d8c544a1760eafd5643cc027 Mon Sep 17 00:00:00 2001 +From dceca76b8863b3839a4c54698701d67ccc8951a1 Mon Sep 17 00:00:00 2001 From: stonar96 <[email protected]> Date: Mon, 20 Aug 2018 03:03:58 +0200 Subject: [PATCH] Anti-Xray @@ -107,13 +107,15 @@ index 0000000000..1ba8477bf9 +} 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 0000000000..e3da35b6ba +index 0000000000..d1da1fd2d0 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -@@ -0,0 +1,684 @@ +@@ -0,0 +1,691 @@ +package com.destroystokyo.paper.antixray; + ++import java.util.ArrayList; +import java.util.HashSet; ++import java.util.List; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; @@ -176,7 +178,10 @@ index 0000000000..e3da35b6ba + executorService = null; + } + ++ List<String> toObfuscate; ++ + if (engineMode == EngineMode.HIDE) { ++ toObfuscate = paperWorldConfig.hiddenBlocks; + predefinedBlockData = null; + predefinedBlockDataStone = new IBlockData[] {Blocks.STONE.getBlockData()}; + predefinedBlockDataNetherrack = new IBlockData[] {Blocks.NETHERRACK.getBlockData()}; @@ -186,12 +191,14 @@ index 0000000000..e3da35b6ba + predefinedBlockDataBitsNetherrackGlobal = new int[] {ChunkSection.GLOBAL_PALETTE.getOrCreateIdFor(Blocks.NETHERRACK.getBlockData())}; + predefinedBlockDataBitsEndStoneGlobal = new int[] {ChunkSection.GLOBAL_PALETTE.getOrCreateIdFor(Blocks.END_STONE.getBlockData())}; + } else { ++ toObfuscate = new ArrayList<>(paperWorldConfig.replacementBlocks); + Set<IBlockData> predefinedBlockDataSet = new HashSet<IBlockData>(); + + for (String id : paperWorldConfig.hiddenBlocks) { + Block block = IRegistry.BLOCK.get(new MinecraftKey(id)); + + if (block != null && !block.isTileEntity()) { ++ toObfuscate.add(id); + predefinedBlockDataSet.add(block.getBlockData()); + } + } @@ -211,7 +218,7 @@ index 0000000000..e3da35b6ba + predefinedBlockDataBitsEndStoneGlobal = null; + } + -+ for (String id : (engineMode == EngineMode.HIDE) ? paperWorldConfig.hiddenBlocks : paperWorldConfig.replacementBlocks) { ++ for (String id : toObfuscate) { + Block block = IRegistry.BLOCK.get(new MinecraftKey(id)); + + if (block != null) { @@ -1534,7 +1541,7 @@ index 16e3469d01..e4c0cc6a33 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 b007eb36c7..14f419deb8 100644 +index 7b7152c06c..79dea3c858 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,6 +1,8 @@ |