aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authoranhgelus <anhgelus.morhtuuzh@proton.me>2024-08-22 13:13:35 +0000
committeranhgelus <anhgelus.morhtuuzh@proton.me>2024-08-22 13:13:35 +0000
commita08b6601ebbe837e3a83e50a7a9cada23d5f385a (patch)
tree781ae61f8b53171646e885fb9df784d95442318d /src/main
parente00623805191ca6c3c83ea6a5b4c7bb4f225ec6b (diff)
feat(game): timer on actionbar
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/world/anhgelus/molehunt/Game.java9
-rw-r--r--src/main/java/world/anhgelus/molehunt/Molehunt.java8
2 files changed, 6 insertions, 11 deletions
diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java
index 199f4d4..f7c2715 100644
--- a/src/main/java/world/anhgelus/molehunt/Game.java
+++ b/src/main/java/world/anhgelus/molehunt/Game.java
@@ -82,18 +82,13 @@ public class Game {
@Override
public void run() {
remaining--;
+ playerManager.sendToAll(timing);
playerManager.sendToAll(new OverlayMessageS2CPacket(Text.of(getShortRemainingText())));
if (remaining == 0) {
end();
}
}
- }, 1000L, 1000L);
- timer.scheduleAtFixedRate(new TimerTask() {
- @Override
- public void run() {
- playerManager.broadcast(getRemainingText(), false);
- }
- }, 10*60*1000L, 10*60*1000L);
+ }, 4*1000L, 1000L);
}
}, 4*1000);
}
diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java
index 92a28fe..9838281 100644
--- a/src/main/java/world/anhgelus/molehunt/Molehunt.java
+++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java
@@ -34,10 +34,10 @@ public class Molehunt implements ModInitializer {
game.start();
return Command.SINGLE_SUCCESS;
}));
- command.then(literal("time").executes(context -> {
- context.getSource().sendFeedback(() -> game.getRemainingText(), false);
- return Command.SINGLE_SUCCESS;
- }));
+// command.then(literal("time").executes(context -> {
+// context.getSource().sendFeedback(() -> game.getRemainingText(), false);
+// return Command.SINGLE_SUCCESS;
+// }));
command.then(literal("moles").requires(source -> {
if (game == null) {
return false;