mirror of
https://github.com/songoda/EpicFarming.git
synced 2025-02-21 15:01:25 +01:00
Fixed dupe bug when removing farms.
This commit is contained in:
parent
25bb3b1c4e
commit
e6ecdb5deb
@ -65,6 +65,14 @@ public class Farm {
|
||||
EpicFarming.getInstance().getGuiManager().showGUI(player, opened);
|
||||
}
|
||||
|
||||
public void forceMenuClose() {
|
||||
if (opened == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
opened.close();
|
||||
}
|
||||
|
||||
public void upgrade(UpgradeType type, Player player) {
|
||||
EpicFarming instance = EpicFarming.getInstance();
|
||||
if (instance.getLevelManager().getLevels().containsKey(this.level.getLevel() + 1)) {
|
||||
|
@ -112,6 +112,7 @@ public class BlockListeners implements Listener {
|
||||
if (farm == null) return;
|
||||
|
||||
plugin.getDataManager().deleteFarm(farm);
|
||||
farm.forceMenuClose();
|
||||
|
||||
FarmTask.getCrops(farm, false);
|
||||
|
||||
@ -140,6 +141,7 @@ public class BlockListeners implements Listener {
|
||||
FarmTask.getCrops(farm, false);
|
||||
|
||||
plugin.getDataManager().deleteFarm(farm);
|
||||
farm.forceMenuClose();
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
|
@ -110,6 +110,7 @@ public class EntityListeners implements Listener {
|
||||
|
||||
Farm farm = plugin.getFarmManager().removeFarm(block.getLocation());
|
||||
plugin.getDataManager().deleteFarm(farm);
|
||||
farm.forceMenuClose();
|
||||
|
||||
FarmTask.getCrops(farm, false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user