This commit is contained in:
Jesse Boyd 2017-11-09 10:57:17 +11:00
parent 585f1b75a1
commit 6e841543b8
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -68,15 +68,33 @@ public class PlayerEvents_1_8 extends PlotListener implements Listener {
} }
} }
if (!"[(+NBT)]".equals(newLore) || (current.equals(newItem) && newLore.equals(oldLore))) { if (!"[(+NBT)]".equals(newLore) || (current.equals(newItem) && newLore.equals(oldLore))) {
return; switch (newItem.getType()) {
case BANNER:
case SKULL_ITEM:
if (newMeta != null) break;
default:
return;
}
} }
HashSet<Material> blocks = null; HashSet<Material> blocks = null;
Block block = player.getTargetBlock(blocks, 7); Block block = player.getTargetBlock(blocks, 7);
BlockState state = block.getState(); BlockState state = block.getState();
if (state == null) { if (state == null) {
return; return;
} }
if (state.getType() != newItem.getType()) { Material stateType = state.getType();
Material itemType = newItem.getType();
if (stateType != itemType) {
switch (stateType) {
case STANDING_BANNER:
case WALL_BANNER:
if (itemType == Material.BANNER) break;
case SKULL:
if (itemType == Material.SKULL_ITEM) break;
default:
return;
}
return; return;
} }
Location l = BukkitUtil.getLocation(state.getLocation()); Location l = BukkitUtil.getLocation(state.getLocation());