mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Anti Xray: Obfuscate blocks touching lava feature (#3311)
This commit is contained in:
parent
d4b6e902d1
commit
16d779960b
1 changed files with 4 additions and 1 deletions
|
@ -27,6 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public EngineMode engineMode;
|
||||
+ public int maxChunkSectionIndex;
|
||||
+ public int updateRadius;
|
||||
+ public boolean lavaObscures;
|
||||
+ public List<String> hiddenBlocks;
|
||||
+ public List<String> replacementBlocks;
|
||||
+ private void antiXray() {
|
||||
|
@ -36,6 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ maxChunkSectionIndex = getInt("anti-xray.max-chunk-section-index", 3);
|
||||
+ maxChunkSectionIndex = maxChunkSectionIndex > 15 ? 15 : maxChunkSectionIndex;
|
||||
+ updateRadius = getInt("anti-xray.update-radius", 2);
|
||||
+ lavaObscures = getBoolean("anti-xray.lava-obscures", false);
|
||||
+ hiddenBlocks = getList("anti-xray.hidden-blocks", Arrays.asList("gold_ore", "iron_ore", "coal_ore", "lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "redstone_ore", "clay", "emerald_ore", "ender_chest"));
|
||||
+ replacementBlocks = getList("anti-xray.replacement-blocks", Arrays.asList("stone", "oak_planks"));
|
||||
+ if (PaperConfig.version < 19) {
|
||||
|
@ -202,7 +204,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ if (blockData != null) {
|
||||
+ solidGlobal[i] = blockData.isOccluding(emptyChunk, zeroPos)
|
||||
+ && blockData.getBlock() != Blocks.SPAWNER && blockData.getBlock() != Blocks.BARRIER && blockData.getBlock() != Blocks.SHULKER_BOX;
|
||||
+ && blockData.getBlock() != Blocks.SPAWNER && blockData.getBlock() != Blocks.BARRIER && blockData.getBlock() != Blocks.SHULKER_BOX || paperWorldConfig.lavaObscures && blockData == Blocks.LAVA.getBlockData();
|
||||
+ // Comparing blockData == Blocks.LAVA.getBlockData() instead of blockData.getBlock() == Blocks.LAVA ensures that only "stationary lava" is used
|
||||
+ // shulker box checks TE.
|
||||
+ }
|
||||
+ }
|
||||
|
|
Loading…
Reference in a new issue