Fixed regression bug cause item frames and paintings to not be protected.

This commit is contained in:
sk89q 2012-11-07 09:07:38 -08:00
parent b8c9e78910
commit 051e0cb811

View File

@ -78,8 +78,10 @@ public void onHangingingBreak(HangingBreakEvent event) {
if (event instanceof HangingBreakByEntityEvent) { if (event instanceof HangingBreakByEntityEvent) {
HangingBreakByEntityEvent entityEvent = (HangingBreakByEntityEvent) event; HangingBreakByEntityEvent entityEvent = (HangingBreakByEntityEvent) event;
if (entityEvent instanceof Player) { Entity removerEntity = entityEvent.getRemover();
Player player = (Player) entityEvent.getRemover();
if (removerEntity instanceof Player) {
Player player = (Player) removerEntity;
if (wcfg.getBlacklist() != null) { if (wcfg.getBlacklist() != null) {
if (hanging instanceof Painting if (hanging instanceof Painting
@ -105,7 +107,7 @@ public void onHangingingBreak(HangingBreakEvent event) {
} }
} }
} else { } else {
if (entityEvent.getRemover() instanceof Creeper) { if (removerEntity instanceof Creeper) {
if (wcfg.blockCreeperBlockDamage || wcfg.blockCreeperExplosions) { if (wcfg.blockCreeperBlockDamage || wcfg.blockCreeperExplosions) {
event.setCancelled(true); event.setCancelled(true);
return; return;