Use different replacement blocks for normal, nether and end worlds in Orebfuscator

This commit is contained in:
David 2014-04-26 13:52:20 +01:00 committed by md_5
parent 928f6e1ea3
commit 4d2b4b4822

View File

@ -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 <md_5@live.com.au>
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