diff --git a/build.gradle b/build.gradle index 42fd01c..d298f3a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group = 'plazmer' -version = '2.0.0' +version = '2.0.1' repositories { mavenCentral() diff --git a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/DungeonManager.java b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/DungeonManager.java index 5194245..746b93a 100644 --- a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/DungeonManager.java +++ b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/DungeonManager.java @@ -181,7 +181,7 @@ public boolean spawnDungeon(@NotNull Dungeon dungeon, @NotNull Location location if (!module.spawn(location)){ return false; } - DungeonStage.call(dungeon, DungeonStage.PREPARE, "Dungeon Manager with location"); + DungeonStage.call(dungeon, DungeonStage.OPENING, "Dungeon Manager with location"); return true; } diff --git a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/ChestModule.java b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/ChestModule.java index 260158d..a374ebd 100644 --- a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/ChestModule.java +++ b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/ChestModule.java @@ -67,7 +67,7 @@ protected Predicate onLoad() { } this.chestBlocksMap.put(schematicName, chestBlocks); } - return true; + return this.dungeon().getStage().isOpening() || this.dungeon().getStage().isOpened() || this.dungeon().getStage().isWaitingPlayers(); }; } @@ -103,9 +103,9 @@ public boolean onActivate() { } List rewards = new ArrayList<>(); - Collection rewardList = dungeon().getRewards(); + Collection rewardList = this.dungeon().getRewards(); if (!rewardList.isEmpty()) { - if (dungeon().getChestSettings().isSeparateMenu()) { + if (this.dungeon().getChestSettings().isSeparateMenu()) { for (Block block : blocks) { for (DungeonReward dungeonReward : rewardList) { if (Rnd.chance(dungeonReward.getChance())) { @@ -166,6 +166,7 @@ public void update() { } int time = chest.getCurrentTick(); DungeonChestState state = chest.getState(); + if (state.isWaiting() && chest.getNextStateTime() == 0 || state.isCooldown() && chest.getNextStateTime() == 0) { chest.setChestState(DungeonChestState.CLOSED); time = -1; diff --git a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/HologramModule.java b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/HologramModule.java index 9fd7a01..3a4b0aa 100644 --- a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/HologramModule.java +++ b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/HologramModule.java @@ -10,7 +10,7 @@ public class HologramModule extends AbstractModule { private ChestModule chestModule; - private HologramHandler handler; + private final HologramHandler handler; public HologramModule(@NotNull Dungeon dungeon, @NotNull String id) { super(dungeon, id, true); this.handler = plugin().getHologramHandler(); @@ -19,7 +19,8 @@ public HologramModule(@NotNull Dungeon dungeon, @NotNull String id) { @Override protected Predicate onLoad() { this.chestModule = dungeon().getModuleManager().getModule(ChestModule.class).orElse(null); - return aBoolean -> (this.dungeon().getStage().isOpened() || this.dungeon().getStage().isOpening()) && handler != null && this.chestModule != null && !this.chestModule.getChests().isEmpty() && dungeon().getLocation() != null; + return aBoolean -> (this.dungeon().getStage().isOpened() || this.dungeon().getStage().isOpening() || this.dungeon().getStage().isWaitingPlayers()) + && handler != null && this.chestModule != null && !this.chestModule.getChests().isEmpty() && dungeon().getLocation() != null; } @Override diff --git a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/SpawnModule.java b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/SpawnModule.java index b649b88..4ad7afa 100644 --- a/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/SpawnModule.java +++ b/src/main/java/t/me/p1azmer/plugin/dungeons/dungeon/modules/impl/SpawnModule.java @@ -100,7 +100,7 @@ public boolean onActivate() { } if (rangeInfo.isBiomesAsBlack()) { if (rangeInfo.getBiomes().contains(biome)) { - this.debug("Biomes not contains biome " + biome.name()); + this.debug("Biomes contains biome " + biome.name()); return false; } } else if (!rangeInfo.getBiomes().contains(biome)) {