summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-02-28 15:59:23 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-02-28 15:59:23 +0000
commit016e50e6fcd206b4b8eb09570ea2d5a67008df88 (patch)
treecb90c1d10bc735fba5095efdeca25353dc722d39 /src/main/java
parent38c2103ff42b2dd456a448dfe37f9cc3e28c752f (diff)
downloadcraftbukkit-016e50e6fcd206b4b8eb09570ea2d5a67008df88.tar
craftbukkit-016e50e6fcd206b4b8eb09570ea2d5a67008df88.tar.gz
craftbukkit-016e50e6fcd206b4b8eb09570ea2d5a67008df88.tar.lz
craftbukkit-016e50e6fcd206b4b8eb09570ea2d5a67008df88.tar.xz
craftbukkit-016e50e6fcd206b4b8eb09570ea2d5a67008df88.zip
Hacky fix against block invulnerability
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/Chunk.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 55a8340b..22920c2e 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -2,11 +2,13 @@ package net.minecraft.server;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
// CraftBukkit
+import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftWorld;
public class Chunk {
@@ -473,6 +475,22 @@ public class Chunk {
this.d.c.removeAll(this.l.values());
for (int i = 0; i < this.m.length; ++i) {
+ Iterator<Object> iter = this.m[i].iterator();
+
+ // Craftbukkit start
+ while(iter.hasNext()) {
+ Entity e = (Entity)iter.next();
+ int cx = Location.locToBlock(e.locX) >> 4;
+ int cz = Location.locToBlock(e.locZ) >> 4;
+
+ if ((e instanceof EntityPlayer) && ((cx != this.j) || (cz != this.k))) {
+ EntityPlayer player = (EntityPlayer)e;
+ iter.remove(); // Do not pass along players, as doing so can get them stuck outside of time.
+ // (which for example disables inventory icon updates and prevents block breaking)
+ }
+ }
+ // Craftbukkit end
+
this.d.b(this.m[i]);
}
}