-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes bug where animals spawn too much in greenhouses.
Also tracks island deletion so greenhouses are removed when that happens.
- Loading branch information
1 parent
2341d9e
commit 085db69
Showing
6 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/world/bentobox/greenhouses/listeners/IslandChangeEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package world.bentobox.greenhouses.listeners; | ||
|
||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
|
||
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandDeleteEvent; | ||
import world.bentobox.greenhouses.Greenhouses; | ||
|
||
/** | ||
* @author tastybento | ||
* | ||
*/ | ||
public class IslandChangeEvents implements Listener { | ||
|
||
private Greenhouses addon; | ||
|
||
/** | ||
* @param addon | ||
*/ | ||
public IslandChangeEvents(Greenhouses addon) { | ||
this.addon = addon; | ||
} | ||
|
||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled=true) | ||
public void onIslandDeleteEvent(IslandDeleteEvent e) { | ||
addon.getManager().removeGreenhouses(e.getIsland()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters