mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Closes #1731
This commit is contained in:
parent
585f1b75a1
commit
6e841543b8
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user