From 4d2b4b482252040da6fe95157b513bfb383cccaa Mon Sep 17 00:00:00 2001 From: David Date: Sat, 26 Apr 2014 13:52:20 +0100 Subject: [PATCH] Use different replacement blocks for normal, nether and end worlds in Orebfuscator --- CraftBukkit-Patches/0063-Orebfuscator.patch | 27 ++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/CraftBukkit-Patches/0063-Orebfuscator.patch b/CraftBukkit-Patches/0063-Orebfuscator.patch index 39de8e6..95fa15b 100644 --- a/CraftBukkit-Patches/0063-Orebfuscator.patch +++ b/CraftBukkit-Patches/0063-Orebfuscator.patch @@ -1,4 +1,4 @@ -From 4721d9011f520f9764d8dd4d429e2d000f57a859 Mon Sep 17 00:00:00 2001 +From ef9e06887f0d3836c29e13ae7927b23b9ad36bf1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 16 May 2013 18:51:05 +1000 Subject: [PATCH] Orebfuscator @@ -128,10 +128,10 @@ index 6da7de6..2de7e62 100644 public void b(int i, int j, int k, Block block, int l) { diff --git a/src/main/java/org/spigotmc/AntiXray.java b/src/main/java/org/spigotmc/AntiXray.java new file mode 100644 -index 0000000..8e69bff +index 0000000..20ae98e --- /dev/null +++ b/src/main/java/org/spigotmc/AntiXray.java -@@ -0,0 +1,212 @@ +@@ -0,0 +1,227 @@ +package org.spigotmc; + +import gnu.trove.set.TByteSet; @@ -139,6 +139,7 @@ index 0000000..8e69bff +import net.minecraft.server.Block; +import net.minecraft.server.Blocks; +import net.minecraft.server.World; ++import org.bukkit.craftbukkit.util.CraftMagicNumbers; + +public class AntiXray +{ @@ -222,6 +223,20 @@ index 0000000..8e69bff + int startX = chunkX << 4; + int startZ = chunkY << 4; + ++ byte replaceWithTypeId; ++ switch ( world.getWorld().getEnvironment() ) ++ { ++ case NETHER: ++ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.NETHERRACK); ++ break; ++ case THE_END: ++ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.WHITESTONE); ++ break; ++ default: ++ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.STONE); ++ break; ++ } ++ + // Chunks can have up to 16 sections + for ( int i = 0; i < 16; i++ ) + { @@ -259,8 +274,8 @@ index 0000000..8e69bff + switch ( world.spigotConfig.engineMode ) + { + case 1: -+ // Replace with stone -+ buffer[index] = 1; ++ // Replace with replacement material ++ buffer[index] = replaceWithTypeId; + break; + case 2: + // Replace with random ore. @@ -393,5 +408,5 @@ index 1814b4f..45b2aae 100644 + } } -- -1.9.1 +1.8.3.2