mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Replace all block states of a specified block (#5055)
Up to now Anti-Xray did only replace blocks that have the default block state of the specified blocks in hidden-blocks (engine-mode: 1) or hidden-blocks and replacement-blocks (engine-mode: 2). Therefore it wasn't possible to replace for example chests facing south because chest refers to the default block state facing north. Supporting block states in these lists is overkill. Instead this commit makes Anti-Xray to replace all block states of a specified block. However, Anti-Xray will still place the default block states.
This commit is contained in:
parent
11b21a19c3
commit
797fc746d0
1 changed files with 6 additions and 1 deletions
|
@ -212,7 +212,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+
|
+
|
||||||
+ // Don't obfuscate air because air causes unnecessary block updates and causes block updates to fail in the void
|
+ // Don't obfuscate air because air causes unnecessary block updates and causes block updates to fail in the void
|
||||||
+ if (block != null && !block.getBlockData().isAir()) {
|
+ if (block != null && !block.getBlockData().isAir()) {
|
||||||
+ obfuscateGlobal[ChunkSection.GLOBAL_PALETTE.getOrCreateIdFor(block.getBlockData())] = true;
|
+ // Replace all block states of a specified block
|
||||||
|
+ // No OBFHELPER for nms.BlockStateList#a() due to too many decompile errors
|
||||||
|
+ // The OBFHELPER should be getBlockDataList()
|
||||||
|
+ for (IBlockData blockData : block.getStates().a()) {
|
||||||
|
+ obfuscateGlobal[ChunkSection.GLOBAL_PALETTE.getOrCreateIdFor(blockData)] = true;
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
|
Loading…
Reference in a new issue