Skip to content

Commit

Permalink
Fix HologramModule & ChestModule
Browse files Browse the repository at this point in the history
  • Loading branch information
getplusm committed Dec 30, 2023
1 parent ff835d3 commit 5336ee1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'plazmer'
version = '2.0.0'
version = '2.0.1'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected Predicate<Boolean> onLoad() {
}
this.chestBlocksMap.put(schematicName, chestBlocks);
}
return true;
return this.dungeon().getStage().isOpening() || this.dungeon().getStage().isOpened() || this.dungeon().getStage().isWaitingPlayers();
};
}

Expand Down Expand Up @@ -103,9 +103,9 @@ public boolean onActivate() {
}

List<DungeonReward> rewards = new ArrayList<>();
Collection<DungeonReward> rewardList = dungeon().getRewards();
Collection<DungeonReward> 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())) {
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -19,7 +19,8 @@ public HologramModule(@NotNull Dungeon dungeon, @NotNull String id) {
@Override
protected Predicate<Boolean> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 5336ee1

Please sign in to comment.