Skip to content

Commit

Permalink
the last prog
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldmensch committed Sep 15, 2024
1 parent eb4cf41 commit 1840280
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/main/java/club/devcord/gamejam/commands/GameCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
});

scheduler.runTaskLater(plugin, () -> {
team.players().forEach(p -> p.showTitle(Title.title(MiniMessage.miniMessage().deserialize("<rainbow>Jetzt"), Component.empty())));

LevelPipeline levelPipeline = new LevelPipeline(team, plugin);
levelPipeline.start();
plugin.teamPipelines().put(team, levelPipeline);
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/club/devcord/gamejam/level/LevelPipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.title.Title;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -46,7 +47,10 @@ public void next() {
team.players().forEach(
p -> p.playSound(Sound.sound(Key.key("minecraft:effect.achievementcompleted"), Sound.Source.MASTER, 100, 1))
);

levels.peek().start();

showLevelTitle();
} else {
endTime = Instant.now();
team.players().forEach(player -> {
Expand All @@ -65,10 +69,15 @@ public void next() {
}
}

private void showLevelTitle() {
team.players().forEach(player -> player.showTitle(Title.title(Component.text("Level %s".formatted(level())).color(NamedTextColor.AQUA), Component.empty())));
}


public void start() {
levels.peek().start();
startTime = Instant.now();
showLevelTitle();
}

public int level() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void switchItems() {
if(inventory.getItemInMainHand().isSimilar(TheJumpLevel.THE_EYE) && random.nextInt(0, 100) < 40) {
var newSlot = random.nextInt(0, 8);
while(inventory.getItem(newSlot) != null
&& inventory.getItem(newSlot).isEmpty()) {
&& !inventory.getItem(newSlot).isEmpty()) {
newSlot = random.nextInt(0, 8);
}

Expand Down

0 comments on commit 1840280

Please sign in to comment.