Fix a ConcurrentModificationException in the antixray
By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From ef9e06887f0d3836c29e13ae7927b23b9ad36bf1 Mon Sep 17 00:00:00 2001
|
||||
From 37f3e3718d4d554cf96839442b7f07be32cb80d0 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
|
||||
@@ -115,10 +115,29 @@ index 2db45ad..97fe53c 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 6da7de6..2de7e62 100644
|
||||
index 6da7de6..84fe64c 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -548,6 +548,7 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -233,9 +233,16 @@ public abstract class World implements IBlockAccess {
|
||||
return this.getType(i, k, j);
|
||||
}
|
||||
|
||||
- public Block getType(int i, int j, int k) {
|
||||
+ // Spigot start
|
||||
+ public Block getType(int i, int j, int k)
|
||||
+ {
|
||||
+ return getType( i, j, k, true );
|
||||
+ }
|
||||
+
|
||||
+ public Block getType(int i, int j, int k, boolean useCaptured) {
|
||||
// CraftBukkit start - tree generation
|
||||
- if (captureTreeGeneration) {
|
||||
+ if (captureTreeGeneration && useCaptured) {
|
||||
+ // Spigot end
|
||||
Iterator<BlockState> it = capturedBlockStates.iterator();
|
||||
while (it.hasNext()) {
|
||||
BlockState previous = it.next();
|
||||
@@ -548,6 +555,7 @@ public abstract class World implements IBlockAccess {
|
||||
this.e(i, j + 1, k, block);
|
||||
this.e(i, j, k - 1, block);
|
||||
this.e(i, j, k + 1, block);
|
||||
@@ -128,7 +147,7 @@ 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..20ae98e
|
||||
index 0000000..d326d18
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/spigotmc/AntiXray.java
|
||||
@@ -0,0 +1,227 @@
|
||||
@@ -340,7 +359,7 @@ index 0000000..20ae98e
|
||||
+
|
||||
+ private static boolean hasTransparentBlockAdjacent(World world, int x, int y, int z, int radius)
|
||||
+ {
|
||||
+ return !isSolidBlock(world.getType(x, y, z)) /* isSolidBlock */
|
||||
+ return !isSolidBlock(world.getType(x, y, z, false)) /* isSolidBlock */
|
||||
+ || ( radius > 0
|
||||
+ && ( hasTransparentBlockAdjacent( world, x + 1, y, z, radius - 1 )
|
||||
+ || hasTransparentBlockAdjacent( world, x - 1, y, z, radius - 1 )
|
||||
@@ -408,5 +427,5 @@ index 1814b4f..45b2aae 100644
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.8.3.2
|
||||
1.9.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user