Sigh. Back to good old fashioned whatever we had before. Can anyone recommend some xray client I can actually use to test this stuff?

This commit is contained in:
md_5 2013-07-28 21:47:45 +10:00
parent cb44b83822
commit 2fff7d15c5
7 changed files with 61 additions and 51 deletions

View file

@ -1,4 +1,4 @@
From dacf797a6228808d2c39af537c53e394c35015df Mon Sep 17 00:00:00 2001
From 8e3b5b89cf6f0c18fae11f27e178f4e0731914a6 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 7 Jul 2013 09:32:53 +1000
Subject: [PATCH] Spigot Configuration
@ -94,7 +94,7 @@ index 00326c1..8148f9b 100644
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
new file mode 100644
index 0000000..358d5ec
index 0000000..2f2752a
--- /dev/null
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -0,0 +1,120 @@
@ -144,8 +144,8 @@ index 0000000..358d5ec
+
+ commands = new HashMap<String, Command>();
+
+ version = getInt( "config-version", 2 );
+ set( "config-version", 2 );
+ version = getInt( "config-version", 3 );
+ set( "config-version", 3 );
+ readConfig( SpigotConfig.class, null );
+ }
+

View file

@ -1,4 +1,4 @@
From 08ff6f95339bf788c1d8a79c53642cdab3b72c2f Mon Sep 17 00:00:00 2001
From 3c7f43e649d3e15939a321426a27eb5dbabddfea 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
@ -108,12 +108,14 @@ index a7afa55..1a60229 100644
diff --git a/src/main/java/org/spigotmc/AntiXray.java b/src/main/java/org/spigotmc/AntiXray.java
new file mode 100644
index 0000000..59bae3b
index 0000000..c165304
--- /dev/null
+++ b/src/main/java/org/spigotmc/AntiXray.java
@@ -0,0 +1,186 @@
@@ -0,0 +1,204 @@
+package org.spigotmc;
+
+import gnu.trove.set.TByteSet;
+import gnu.trove.set.hash.TByteHashSet;
+import net.minecraft.server.Block;
+import net.minecraft.server.World;
+
@ -125,7 +127,8 @@ index 0000000..59bae3b
+ /*========================================================================*/
+ // Used to keep track of which blocks to obfuscate
+ private final boolean[] obfuscateBlocks = new boolean[ Short.MAX_VALUE ];
+ private final boolean[] replaceBlocks = new boolean[ Short.MAX_VALUE ];
+ // Used to select a random replacement ore
+ private byte[] replacementOres;
+
+ public AntiXray(SpigotWorldConfig config)
+ {
@ -134,10 +137,25 @@ index 0000000..59bae3b
+ {
+ obfuscateBlocks[id] = true;
+ }
+ for ( int id : config.xRayReplacements )
+
+ // For every block
+ TByteSet blocks = new TByteHashSet();
+ for ( int i = 0; i < obfuscateBlocks.length; i++ )
+ {
+ replaceBlocks[id] = true;
+ // If we are obfuscating it
+ if ( obfuscateBlocks[i] )
+ {
+ Block block = Block.byId[i];
+ // Check it exists and is not a tile entity
+ if ( block != null && !block.t() /* isTileEntity */ )
+ {
+ // Add it to the set of replacement blocks
+ blocks.add( (byte) i );
+ }
+ }
+ }
+ // Bake it to a flat array of replacements
+ replacementOres = blocks.toArray();
+ }
+
+ /**
@ -209,7 +227,7 @@ index 0000000..59bae3b
+ // TODO: extended IDs are not yet supported
+ int blockId = buffer[index] & 0xFF;
+ // Check if the block should be obfuscated
+ if ( obfuscateBlocks[blockId] || replaceBlocks[blockId] )
+ if ( obfuscateBlocks[blockId] )
+ {
+ // TODO: Don't really understand this, but if radius is not 0 and the world isn't loaded, bail out
+ if ( initialRadius != 0 && !isLoaded( world, startX + x, ( i << 4 ) + y, startZ + z, initialRadius ) )
@ -226,12 +244,12 @@ index 0000000..59bae3b
+ buffer[index] = (byte) Block.STONE.id;
+ break;
+ case 2:
+ if ( randomOre >= world.spigotConfig.xRayReplacements.size() )
+ // Replace with random ore.
+ if ( randomOre >= replacementOres.length )
+ {
+ randomOre = 0;
+ }
+ // Replace with random ore.
+ buffer[index] = world.spigotConfig.xRayReplacements.get( randomOre++ ).byteValue();
+ buffer[index] = replacementOres[randomOre++];
+ break;
+ }
+ }
@ -255,7 +273,7 @@ index 0000000..59bae3b
+ int id = world.getTypeId( x, y, z );
+
+ // See if it needs update
+ if ( updateSelf && ( obfuscateBlocks[id] || replaceBlocks[id] ) )
+ if ( updateSelf && obfuscateBlocks[id] )
+ {
+ // Send the update
+ world.notify( x, y, z );
@ -299,51 +317,43 @@ index 0000000..59bae3b
+ }
+}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 3e66d79..c70055b 100644
index 3e66d79..bab9d8f 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -1,5 +1,8 @@
@@ -1,5 +1,6 @@
package org.spigotmc;
+import gnu.trove.set.TIntSet;
+import gnu.trove.set.hash.TIntHashSet;
+import java.util.Arrays;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -128,4 +131,35 @@ public class SpigotWorldConfig
@@ -128,4 +129,29 @@ public class SpigotWorldConfig
viewDistance = getInt( "view-distance", Bukkit.getViewDistance() );
log( "View Distance: " + viewDistance );
}
+
+ public boolean antiXray;
+ public int engineMode;
+ public List<Integer> blocks;
+ public List<Integer> xRayReplacements;
+ public boolean antiXray = true;
+ public int engineMode = 1;
+ public List<Integer> blocks = Arrays.asList( new Integer[]
+ {
+ 1, 5, 14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130
+ } );
+ public AntiXray antiXrayInstance;
+ private void antiXray()
+ {
+ antiXray = getBoolean( "anti-xray.enabled", true );
+ antiXray = getBoolean( "anti-xray.enabled", antiXray );
+ log( "Anti X-Ray: " + antiXray );
+
+ engineMode = getInt( "anti-xray.engine-mode", 1 );
+ engineMode = getInt( "anti-xray.engine-mode", engineMode );
+ log( "\tEngine Mode: " + engineMode );
+
+ if ( SpigotConfig.version < 2 )
+ if ( SpigotConfig.version < 3 )
+ {
+ set( "anti-xray.blocks", blocks );
+ }
+ blocks = getList( "anti-xray.blocks", Arrays.asList( new Integer[]
+ {
+ 14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130
+ } ) ) ;
+ blocks = getList( "anti-xray.blocks", blocks );
+ log( "\tBlocks: " + blocks );
+
+ xRayReplacements = getList( "anti-xray.replacements", Arrays.asList( new Integer[]
+ {
+ 1, 3
+ } ) );
+
+ antiXrayInstance = new AntiXray( this );
+ }
}

View file

@ -1,4 +1,4 @@
From b84c63da9d744afa5151bba8215240d5851d2f1e Mon Sep 17 00:00:00 2001
From 038cd29b823c4fdf31ec4113960ae56fcd895bc7 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 17:29:54 +1000
Subject: [PATCH] Fix Mob Spawning Relative to View Distance
@ -121,10 +121,10 @@ index 9812538..ecf13aa 100644
continue label110;
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index aea428c..0d4dd7a 100644
index bab9d8f..9f95452 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -161,4 +161,11 @@ public class SpigotWorldConfig
@@ -154,4 +154,11 @@ public class SpigotWorldConfig
antiXrayInstance = new AntiXray( this );
}

View file

@ -1,4 +1,4 @@
From a93b21da824daeb07dc2a9e6cef9e0a0a791dccc Mon Sep 17 00:00:00 2001
From 8afe6c5a3f1b0947603f8e00c6806627e5b95118 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Feb 2013 05:10:21 -0500
Subject: [PATCH] Entity Activation Range
@ -462,10 +462,10 @@ index 0000000..9285a0d
+ }
+}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 0d4dd7a..201e54f 100644
index 9f95452..cca32b5 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -168,4 +168,15 @@ public class SpigotWorldConfig
@@ -161,4 +161,15 @@ public class SpigotWorldConfig
mobSpawnRange = (byte) getInt( "mob-spawn-range", 4 );
log( "Mob Spawn Range: " + mobSpawnRange );
}

View file

@ -1,4 +1,4 @@
From 13586b3381d464e0aead767f3e4619f580ce818e Mon Sep 17 00:00:00 2001
From f60e231ba77aaf5929d124c1d1e67e3d5d2329a7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 20 Feb 2013 11:58:47 -0500
Subject: [PATCH] Entity Tracking Ranges
@ -24,10 +24,10 @@ index 7f23f71..7bb153c 100644
i = this.d;
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 201e54f..6de7b3b 100644
index cca32b5..8ef6c6a 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -179,4 +179,19 @@ public class SpigotWorldConfig
@@ -172,4 +172,19 @@ public class SpigotWorldConfig
miscActivationRange = getInt( "entity-activation-range.misc", miscActivationRange );
log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Mi " + miscActivationRange );
}

View file

@ -1,4 +1,4 @@
From 76a1eea53d21b6952a6f91312af7918b2371058c Mon Sep 17 00:00:00 2001
From 1c9eb2932f5d4eb8287ee104d53edc1eb8368da3 Mon Sep 17 00:00:00 2001
From: DerFlash <bte@freenet.de>
Date: Sun, 2 Jun 2013 16:23:46 +1000
Subject: [PATCH] Hopper Cooldowns
@ -64,10 +64,10 @@ index e8cd525..44ddf35 100644
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 6de7b3b..d6bca3c 100644
index 8ef6c6a..4920e3f 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -194,4 +194,13 @@ public class SpigotWorldConfig
@@ -187,4 +187,13 @@ public class SpigotWorldConfig
maxTrackingRange = getInt( "entity-tracking-range.other", maxTrackingRange );
log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + maxTrackingRange );
}

View file

@ -1,4 +1,4 @@
From 2290e255c94f1161e9ba5c3552dff80e52258c96 Mon Sep 17 00:00:00 2001
From 3842ec165452cce601f31803ea8122b0d73f3911 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 22 Jun 2013 16:12:02 +1000
Subject: [PATCH] Allow Disabling of Random Lighting Updates
@ -18,10 +18,10 @@ index 211127b..8bd7876 100644
entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index d6bca3c..6e2223e 100644
index 4920e3f..55878e5 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -203,4 +203,11 @@ public class SpigotWorldConfig
@@ -196,4 +196,11 @@ public class SpigotWorldConfig
hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer );
log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck );
}