summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorWesley Wolfe <weswolf@aol.com>2012-08-05 21:31:36 -0500
committerWesley Wolfe <weswolf@aol.com>2012-08-05 21:32:01 -0500
commit44234c47cedc4226fd118fbffd84866a3320e1af (patch)
tree9494a2ef45a68981b207e0b3ea6c67d231ca3e36 /src/main/java/net/minecraft/server
parenta574ec54cc68710e6949d462c4571c87d2c7e37a (diff)
downloadcraftbukkit-44234c47cedc4226fd118fbffd84866a3320e1af.tar
craftbukkit-44234c47cedc4226fd118fbffd84866a3320e1af.tar.gz
craftbukkit-44234c47cedc4226fd118fbffd84866a3320e1af.tar.lz
craftbukkit-44234c47cedc4226fd118fbffd84866a3320e1af.tar.xz
craftbukkit-44234c47cedc4226fd118fbffd84866a3320e1af.zip
Cease execution if block is AIR. Fixes BUKKIT-2104
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/ItemInWorldManager.java1
-rw-r--r--src/main/java/net/minecraft/server/PlayerInventory.java6
2 files changed, 1 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java
index e163a2c0..aa63a1c4 100644
--- a/src/main/java/net/minecraft/server/ItemInWorldManager.java
+++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java
@@ -271,6 +271,7 @@ public class ItemInWorldManager {
return false;
} else {
int l = this.world.getTypeId(i, j, k);
+ if (Block.byId[l] == null) return false; // CraftBukkit - a plugin set block to air without cancelling
int i1 = this.world.getData(i, j, k);
this.world.a(this.player, 2001, i, j, k, l + (this.world.getData(i, j, k) << 12));
diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java
index 88566f49..f1275e68 100644
--- a/src/main/java/net/minecraft/server/PlayerInventory.java
+++ b/src/main/java/net/minecraft/server/PlayerInventory.java
@@ -363,12 +363,6 @@ public class PlayerInventory implements IInventory {
}
public boolean b(Block block) {
- // CraftBukkit start - fixed NPE
- if (block == null) {
- return false;
- }
- // CraftBukkit end
-
if (block.material.isAlwaysDestroyable()) {
return true;
} else {