Fixed issue where water could destroy a farm item.

This commit is contained in:
Brianna 2019-10-01 10:30:32 -04:00
parent 849d5ea171
commit 066f3eb5e4

View File

@ -211,4 +211,12 @@ public class BlockListeners implements Listener {
farm.getLocation().getWorld().dropItemNaturally(farm.getLocation().add(.5, .5, .5), itemStack); farm.getLocation().getWorld().dropItemNaturally(farm.getLocation().add(.5, .5, .5), itemStack);
} }
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onBlockFromToEventMonitor(BlockFromToEvent event) {
// prevent water/lava/egg griefs
if (instance.getFarmManager().getFarm(event.getToBlock()) != null) {
event.setCancelled(true);
}
}
} }