mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 03:25:24 +01:00
Fixed NullPointerExceptions in item use hook.
This commit is contained in:
parent
484fe22e9e
commit
79f55a02cb
@ -960,7 +960,7 @@ public boolean onInventoryChange(Player player) {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(Player player, Block blockPlaced,
|
public boolean onItemUse(Player player, Block blockPlaced,
|
||||||
Block blockClicked, Item item) {
|
Block blockClicked, Item item) {
|
||||||
if (blacklist != null) {
|
if (blacklist != null && item != null) {
|
||||||
int itemId = item.getItemId();
|
int itemId = item.getItemId();
|
||||||
|
|
||||||
if (!blacklist.onUse(itemId, player)) {
|
if (!blacklist.onUse(itemId, player)) {
|
||||||
@ -968,7 +968,7 @@ public boolean onItemUse(Player player, Block blockPlaced,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useRegions) {
|
if (useRegions && blockPlaced != null) {
|
||||||
Vector pt = new Vector(blockPlaced.getX(),
|
Vector pt = new Vector(blockPlaced.getX(),
|
||||||
blockPlaced.getY(), blockPlaced.getZ());
|
blockPlaced.getY(), blockPlaced.getZ());
|
||||||
LocalPlayer localPlayer = new HMPlayer(player);
|
LocalPlayer localPlayer = new HMPlayer(player);
|
||||||
|
Loading…
Reference in New Issue
Block a user