Switch index length check around to prevent crashes
By: md_5 <md_5@live.com.au>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From b49341b577917fd16fd7dbbd424cfba241742f6e Mon Sep 17 00:00:00 2001
|
||||
From e795b98bec6778f4f4b8a59ca061fc61d1d6bfff 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
|
||||
@@ -29,7 +29,7 @@ index 758d447..1d1c88c 100644
|
||||
double d0 = (double) ((float) i + this.world.random.nextFloat());
|
||||
double d1 = (double) ((float) j + this.world.random.nextFloat());
|
||||
diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java
|
||||
index 3c3bdbf..4c24f80 100644
|
||||
index fa10397..91d7feb 100644
|
||||
--- a/src/main/java/net/minecraft/server/Packet51MapChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java
|
||||
@@ -33,6 +33,7 @@ public class Packet51MapChunk extends Packet {
|
||||
@@ -108,10 +108,10 @@ index d77a4cc..4aa9ab7 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..c29b789
|
||||
index 0000000..48c8a99
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/spigotmc/AntiXray.java
|
||||
@@ -0,0 +1,203 @@
|
||||
@@ -0,0 +1,204 @@
|
||||
+package org.spigotmc;
|
||||
+
|
||||
+import gnu.trove.set.TByteSet;
|
||||
@@ -218,6 +218,11 @@ index 0000000..c29b789
|
||||
+ {
|
||||
+ for ( int x = 0; x < 16; x++ )
|
||||
+ {
|
||||
+ // For some reason we can get too far ahead of ourselves (concurrent modification on bulk chunks?) so if we do, just abort and move on
|
||||
+ if ( index >= buffer.length )
|
||||
+ {
|
||||
+ continue;
|
||||
+ }
|
||||
+ // Grab the block ID in the buffer.
|
||||
+ // TODO: extended IDs are not yet supported
|
||||
+ int blockId = buffer[index] & 0xFF;
|
||||
@@ -250,11 +255,7 @@ index 0000000..c29b789
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // For some reason we can get too far ahead of ourselves (concurrent modification on bulk chunks?) so if we do, just abort and move on
|
||||
+ if ( ++index >= buffer.length )
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ index++;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user