mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-27 19:09:09 +00:00
Additional slime world event listener
This commit is contained in:
@@ -81,6 +81,7 @@ public class GreenhouseBlock extends AbstractCustomCropsBlock {
|
||||
CustomCropsBlockState state = getOrFixState(world, pos3);
|
||||
GreenhouseGlassBreakEvent breakEvent = new GreenhouseGlassBreakEvent(event.entityBreaker(), event.blockBreaker(), event.location(), event.brokenID(), state, event.reason());
|
||||
if (EventUtils.fireAndCheckCancel(breakEvent)) {
|
||||
breakEvent.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
world.removeBlockState(pos3);
|
||||
|
||||
@@ -81,6 +81,7 @@ public class ScarecrowBlock extends AbstractCustomCropsBlock {
|
||||
CustomCropsBlockState state = getOrFixState(world, pos3);
|
||||
ScarecrowBreakEvent breakEvent = new ScarecrowBreakEvent(event.entityBreaker(), event.blockBreaker(), event.location(), event.brokenID(), state, event.reason());
|
||||
if (EventUtils.fireAndCheckCancel(breakEvent)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
world.removeBlockState(pos3);
|
||||
|
||||
@@ -72,6 +72,8 @@ public interface WorldManager extends Reloadable {
|
||||
*/
|
||||
boolean unloadWorld(World world, boolean disabling);
|
||||
|
||||
boolean isMechanicEnabled(World world);
|
||||
|
||||
/**
|
||||
* Retrieves a CustomCrops world based on the specified Bukkit world, if loaded.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user