Fixed build flag & block-place and block-break incompatiblity

This commit is contained in:
isokissa3 2017-01-22 17:21:40 +02:00
parent a3b551a512
commit 368f96c51e

View file

@ -91,8 +91,7 @@ public class BlockListener implements Listener
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false) @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
public void onBlockBreakEvent(BreakBlockEvent event) public void onBlockBreakEvent(BreakBlockEvent event)
{ {
if (event.getResult() == Result.DEFAULT) Result originalResult = event.getResult();
{
Object cause = event.getCause().getRootCause(); Object cause = event.getCause().getRootCause();
if (cause instanceof Player) if (cause instanceof Player)
@ -120,7 +119,7 @@ public class BlockListener implements Listener
} }
else else
{ {
event.setResult(Result.DEFAULT); event.setResult(originalResult);
return; return;
} }
} }
@ -128,5 +127,4 @@ public class BlockListener implements Listener
} }
} }
} }
}
} }