mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-11-06 02:50:27 +01:00
Fixed issue where water could destroy a farm item.
This commit is contained in:
parent
849d5ea171
commit
066f3eb5e4
@ -211,4 +211,12 @@ public class BlockListeners implements Listener {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user