mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-24 18:19:03 +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
|
||||
public boolean onItemUse(Player player, Block blockPlaced,
|
||||
Block blockClicked, Item item) {
|
||||
if (blacklist != null) {
|
||||
if (blacklist != null && item != null) {
|
||||
int itemId = item.getItemId();
|
||||
|
||||
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(),
|
||||
blockPlaced.getY(), blockPlaced.getZ());
|
||||
LocalPlayer localPlayer = new HMPlayer(player);
|
||||
|
Loading…
Reference in New Issue
Block a user