mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
Cease execution if block is AIR. Fixes BUKKIT-2104
This commit is contained in:
parent
a574ec54cc
commit
44234c47ce
@ -271,6 +271,7 @@ public class ItemInWorldManager {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
int l = this.world.getTypeId(i, j, k);
|
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);
|
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));
|
this.world.a(this.player, 2001, i, j, k, l + (this.world.getData(i, j, k) << 12));
|
||||||
|
@ -363,12 +363,6 @@ public class PlayerInventory implements IInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean b(Block block) {
|
public boolean b(Block block) {
|
||||||
// CraftBukkit start - fixed NPE
|
|
||||||
if (block == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
if (block.material.isAlwaysDestroyable()) {
|
if (block.material.isAlwaysDestroyable()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user