@@ -1,4 +1,4 @@
|
||||
From 9ab09589f7ca0433a1c6aac5b6f6cc847e82995d Mon Sep 17 00:00:00 2001
|
||||
From b6377ce207cad41a8ff913d19889573b70a245ff 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
|
||||
@@ -103,7 +103,7 @@ index 3028404..e24d4b5 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index b276a3d..57511c8 100644
|
||||
index 4a9d48b..7f8d224 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -464,6 +464,7 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -116,7 +116,7 @@ index b276a3d..57511c8 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..c165304
|
||||
index 0000000..6413ac0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/spigotmc/AntiXray.java
|
||||
@@ -0,0 +1,204 @@
|
||||
@@ -153,9 +153,9 @@ index 0000000..c165304
|
||||
+ // If we are obfuscating it
|
||||
+ if ( obfuscateBlocks[i] )
|
||||
+ {
|
||||
+ Block block = Block.byId[i];
|
||||
+ Block block = Block.e(i);
|
||||
+ // Check it exists and is not a tile entity
|
||||
+ if ( block != null && !block.t() /* isTileEntity */ )
|
||||
+ if ( block != null && !block.isTileEntity() )
|
||||
+ {
|
||||
+ // Add it to the set of replacement blocks
|
||||
+ blocks.add( (byte) i );
|
||||
@@ -249,7 +249,7 @@ index 0000000..c165304
|
||||
+ {
|
||||
+ case 1:
|
||||
+ // Replace with stone
|
||||
+ buffer[index] = (byte) Block.STONE.id;
|
||||
+ buffer[index] = 1;
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ // Replace with random ore.
|
||||
@@ -278,10 +278,10 @@ index 0000000..c165304
|
||||
+ if ( world.isLoaded( x, y, z ) )
|
||||
+ {
|
||||
+ // Get block id
|
||||
+ int id = world.getTypeId( x, y, z );
|
||||
+ Block block = world.getType(x, y, z);
|
||||
+
|
||||
+ // See if it needs update
|
||||
+ if ( updateSelf && obfuscateBlocks[id] )
|
||||
+ if ( updateSelf && obfuscateBlocks[Block.b(block)] )
|
||||
+ {
|
||||
+ // Send the update
|
||||
+ world.notify( x, y, z );
|
||||
@@ -314,7 +314,7 @@ index 0000000..c165304
|
||||
+
|
||||
+ private static boolean hasTransparentBlockAdjacent(World world, int x, int y, int z, int radius)
|
||||
+ {
|
||||
+ return !Block.l( world.getTypeId( x, y, z ) ) /* isSolidBlock */
|
||||
+ return !world.getType(x, y, z).r() /* isSolidBlock */
|
||||
+ || ( radius > 0
|
||||
+ && ( hasTransparentBlockAdjacent( world, x + 1, y, z, radius - 1 )
|
||||
+ || hasTransparentBlockAdjacent( world, x - 1, y, z, radius - 1 )
|
||||
|
||||
Reference in New Issue
Block a user