From 5c5851ce8441bced76c6abb2bd9cbfbbfedb01c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 13:11:15 +0200 Subject: feat: config fields and gamerules related to world borders --- .../java/world/anhgelus/molehunt/Molehunt.java | 17 ++++++++++++++++- .../world/anhgelus/molehunt/config/Config.java | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java index d7c0d58..7e6ce81 100644 --- a/src/main/java/world/anhgelus/molehunt/Molehunt.java +++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java @@ -39,7 +39,7 @@ public class Molehunt implements ModInitializer { public static final SimpleConfig CONFIG_FILE = Config.configFile(MOD_ID); public static final GameRules.Key GAME_DURATION = GameRuleRegistry.register( - MOD_ID +":gameDuration", + MOD_ID +":gameDurationMinutes", GameRules.Category.MISC, GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("game_duration", 90)) ); @@ -77,6 +77,21 @@ public class Molehunt implements ModInitializer { CONFIG.sendConfigPayload(); }) ); + public static final GameRules.Key INITIAL_WORLD_SIZE = GameRuleRegistry.register( + MOD_ID +":initialWorldSize", + GameRules.Category.MISC, + GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("initial_world_size", 200), 0) + ); + public static final GameRules.Key FINAL_WORLD_SIZE = GameRuleRegistry.register( + MOD_ID +":finalWorldSize", + GameRules.Category.MISC, + GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("final_world_size", 50), 0) + ); + public static final GameRules.Key SHRINKING_STARTING_OFFSET = GameRuleRegistry.register( + MOD_ID +":borderShrinkingStartingOffsetMinutes", + GameRules.Category.MISC, + GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("border_shrinking_starting_offset", 10), 0) + ); public Game game; diff --git a/src/main/java/world/anhgelus/molehunt/config/Config.java b/src/main/java/world/anhgelus/molehunt/config/Config.java index dbaebcf..eedb659 100644 --- a/src/main/java/world/anhgelus/molehunt/config/Config.java +++ b/src/main/java/world/anhgelus/molehunt/config/Config.java @@ -57,7 +57,10 @@ public class Config { private static String defaultConfig(String s) { return """ # Molehunt mod configuration file + # To regenerate the default configuration, delete, move or rename this file. + # Game settings + # The duration of a molehunt game, in minutes. # Default: 90 minutes (1 hour 30 minutes). game_duration = 90 @@ -73,6 +76,9 @@ public class Config { # Default: -1. mole_count = -1 + + # Client-side settings (applies to all players) + # Show nametags # Default: false show_nametags = false @@ -84,6 +90,22 @@ public class Config { # Show tab # Default: false show_tab = false + + + # World border settings : + + # Initial world size (in blocks). + # Default: 200 blocks. + initial_world_size = 200 + + # Final world size (in blocks). + # Default: 50 blocks. + final_world_size = 50 + + # Shrinking starting offset (in minutes) + # The time before starting to shrink the world borders. + # Default: 10 minutes. + border_shrinking_starting_offset = 10 """; } } -- cgit v1.2.3 From f59f9bdfadfb804e804cbafc168af82817f334f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 13:12:01 +0200 Subject: feat: config fields and gamerules related to world borders --- src/main/java/world/anhgelus/molehunt/Molehunt.java | 6 +++--- .../java/world/anhgelus/molehunt/config/Config.java | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java index 7e6ce81..7df62fd 100644 --- a/src/main/java/world/anhgelus/molehunt/Molehunt.java +++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java @@ -87,10 +87,10 @@ public class Molehunt implements ModInitializer { GameRules.Category.MISC, GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("final_world_size", 50), 0) ); - public static final GameRules.Key SHRINKING_STARTING_OFFSET = GameRuleRegistry.register( - MOD_ID +":borderShrinkingStartingOffsetMinutes", + public static final GameRules.Key SHRINKING_STARTING_TIME_OFFSET = GameRuleRegistry.register( + MOD_ID +":borderShrinkingStartingTimeOffsetMinutes", GameRules.Category.MISC, - GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("border_shrinking_starting_offset", 10), 0) + GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("border_shrinking_starting_time_offset", 10), 0) ); public Game game; diff --git a/src/main/java/world/anhgelus/molehunt/config/Config.java b/src/main/java/world/anhgelus/molehunt/config/Config.java index eedb659..b42a469 100644 --- a/src/main/java/world/anhgelus/molehunt/config/Config.java +++ b/src/main/java/world/anhgelus/molehunt/config/Config.java @@ -16,9 +16,7 @@ public class Config { public void sendConfigPayload() { final var payload = new ConfigPayload(areNametagsEnabled(), areSkinsEnabled(), isTabEnabled()); - server.getPlayerManager().getPlayerList().forEach(p -> { - ServerPlayNetworking.send(p, payload); - }); + server.getPlayerManager().getPlayerList().forEach(p -> ServerPlayNetworking.send(p, payload)); } public void sendConfigPayload(boolean showNametags, boolean showSkins, boolean showTab) { @@ -50,6 +48,18 @@ public class Config { return server.getGameRules().getBoolean(Molehunt.SHOW_TAB); } + public int getInitialWorldSize() { + return server.getGameRules().getInt(Molehunt.INITIAL_WORLD_SIZE); + } + + public int getFinalWorldSize() { + return server.getGameRules().getInt(Molehunt.FINAL_WORLD_SIZE); + } + + public int getBorderShrinkingStartingTimeOffset() { + return server.getGameRules().getInt(Molehunt.SHRINKING_STARTING_TIME_OFFSET); + } + public static SimpleConfig configFile(String fileName) { return SimpleConfig.of(fileName).provider(Config::defaultConfig).request(); } @@ -105,7 +115,7 @@ public class Config { # Shrinking starting offset (in minutes) # The time before starting to shrink the world borders. # Default: 10 minutes. - border_shrinking_starting_offset = 10 + border_shrinking_starting_time_offset = 10 """; } } -- cgit v1.2.3 From 57c83485e1db1513fa204c3ef5a0d81176995490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 13:25:56 +0200 Subject: feat: set and shrink world borders --- src/main/java/world/anhgelus/molehunt/Game.java | 24 ++++++++++++++++++++++ .../world/anhgelus/molehunt/config/Config.java | 1 + 2 files changed, 25 insertions(+) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java index dbe7ebd..b6c0338 100644 --- a/src/main/java/world/anhgelus/molehunt/Game.java +++ b/src/main/java/world/anhgelus/molehunt/Game.java @@ -21,6 +21,8 @@ public class Game { public final int defaultTime = Molehunt.CONFIG.getGameDuration()*60; private int remaining = defaultTime; + private Timer borderTimeOffsetTime = new Timer(); + private final MinecraftServer server; private final List moles = new ArrayList<>(); @@ -57,6 +59,20 @@ public class Game { gamerules.get(GameRules.DO_IMMEDIATE_RESPAWN).set(true, server); gamerules.get(GameRules.DO_ENTITY_DROPS).set(false, server); + final var worldBorder = server.getOverworld().getWorldBorder(); + worldBorder.setSize(Molehunt.CONFIG.getInitialWorldSize()); + if (Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() < Molehunt.CONFIG.getGameDuration()) { + borderTimeOffsetTime.schedule(new TimerTask() { + @Override + public void run() { + worldBorder.interpolateSize( + Molehunt.CONFIG.getInitialWorldSize(), + Molehunt.CONFIG.getFinalWorldSize(), + (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60 * 60); + } + }, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60 * 60); + } + final var title = new TitleS2CPacket(Text.translatable("molehunt.game.start.suspense")); playerManager.getPlayerList().forEach(p -> { p.kill(); @@ -116,6 +132,14 @@ public class Game { public void end() { timer.cancel(); timer = new Timer(); + + borderTimeOffsetTime.cancel(); + borderTimeOffsetTime = new Timer(); + + final var worldBorder = server.getOverworld().getWorldBorder(); + // Stops the border shrinking. + worldBorder.setSize(worldBorder.getSize()); + started = false; final var pm = server.getPlayerManager(); final var winnerSuspense = new TitleS2CPacket(Text.translatable("molehunt.game.end.suspense.title")); diff --git a/src/main/java/world/anhgelus/molehunt/config/Config.java b/src/main/java/world/anhgelus/molehunt/config/Config.java index b42a469..3f22df3 100644 --- a/src/main/java/world/anhgelus/molehunt/config/Config.java +++ b/src/main/java/world/anhgelus/molehunt/config/Config.java @@ -114,6 +114,7 @@ public class Config { # Shrinking starting offset (in minutes) # The time before starting to shrink the world borders. + # If this value is greater than the game duration, borders will never shrink. # Default: 10 minutes. border_shrinking_starting_time_offset = 10 """; -- cgit v1.2.3 From c57d37921b6c7e7eea53f495b0d2c8ade927e555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 18:13:45 +0200 Subject: fix: seconds instead of milliseconds --- src/main/java/world/anhgelus/molehunt/Game.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java index b6c0338..9919703 100644 --- a/src/main/java/world/anhgelus/molehunt/Game.java +++ b/src/main/java/world/anhgelus/molehunt/Game.java @@ -70,7 +70,7 @@ public class Game { Molehunt.CONFIG.getFinalWorldSize(), (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60 * 60); } - }, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60 * 60); + }, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60); } final var title = new TitleS2CPacket(Text.translatable("molehunt.game.start.suspense")); -- cgit v1.2.3 From b47d51c012675243911657e8e1a3e561074b8464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 18:25:07 +0200 Subject: fix: seconds instead of milliseconds but really this time, and also btw recycling the timer task because it's better for the planet --- src/main/java/world/anhgelus/molehunt/Game.java | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java index 9919703..7670805 100644 --- a/src/main/java/world/anhgelus/molehunt/Game.java +++ b/src/main/java/world/anhgelus/molehunt/Game.java @@ -21,7 +21,17 @@ public class Game { public final int defaultTime = Molehunt.CONFIG.getGameDuration()*60; private int remaining = defaultTime; - private Timer borderTimeOffsetTime = new Timer(); + private Timer borderTimeOffsetTimer = new Timer(); + private final TimerTask borderTimeOffsetTask = new TimerTask() { + @Override + public void run() { + final var worldBorder = server.getOverworld().getWorldBorder(); + worldBorder.interpolateSize( + Molehunt.CONFIG.getInitialWorldSize(), + Molehunt.CONFIG.getFinalWorldSize(), + (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60); + } + }; private final MinecraftServer server; @@ -62,15 +72,7 @@ public class Game { final var worldBorder = server.getOverworld().getWorldBorder(); worldBorder.setSize(Molehunt.CONFIG.getInitialWorldSize()); if (Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() < Molehunt.CONFIG.getGameDuration()) { - borderTimeOffsetTime.schedule(new TimerTask() { - @Override - public void run() { - worldBorder.interpolateSize( - Molehunt.CONFIG.getInitialWorldSize(), - Molehunt.CONFIG.getFinalWorldSize(), - (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60 * 60); - } - }, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60); + borderTimeOffsetTimer.schedule(borderTimeOffsetTask, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60 * 1000); } final var title = new TitleS2CPacket(Text.translatable("molehunt.game.start.suspense")); @@ -133,8 +135,8 @@ public class Game { timer.cancel(); timer = new Timer(); - borderTimeOffsetTime.cancel(); - borderTimeOffsetTime = new Timer(); + borderTimeOffsetTimer.cancel(); + borderTimeOffsetTimer = new Timer(); final var worldBorder = server.getOverworld().getWorldBorder(); // Stops the border shrinking. -- cgit v1.2.3 From 7f60288c07c356616fdee270ece7b2a625dcfdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 18:27:07 +0200 Subject: perf: cancel TimerTask instead of cancelling timer --- src/main/java/world/anhgelus/molehunt/Game.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java index 7670805..b8d7136 100644 --- a/src/main/java/world/anhgelus/molehunt/Game.java +++ b/src/main/java/world/anhgelus/molehunt/Game.java @@ -135,8 +135,7 @@ public class Game { timer.cancel(); timer = new Timer(); - borderTimeOffsetTimer.cancel(); - borderTimeOffsetTimer = new Timer(); + borderTimeOffsetTask.cancel(); final var worldBorder = server.getOverworld().getWorldBorder(); // Stops the border shrinking. -- cgit v1.2.3 From 06027e9cd2b71a9606fb38dbde261cc629a68cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 18:37:21 +0200 Subject: perf: do not recycle timer task because somehow it's actually better ? idk anymore --- src/main/java/world/anhgelus/molehunt/Game.java | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java index b8d7136..300b4c2 100644 --- a/src/main/java/world/anhgelus/molehunt/Game.java +++ b/src/main/java/world/anhgelus/molehunt/Game.java @@ -21,18 +21,6 @@ public class Game { public final int defaultTime = Molehunt.CONFIG.getGameDuration()*60; private int remaining = defaultTime; - private Timer borderTimeOffsetTimer = new Timer(); - private final TimerTask borderTimeOffsetTask = new TimerTask() { - @Override - public void run() { - final var worldBorder = server.getOverworld().getWorldBorder(); - worldBorder.interpolateSize( - Molehunt.CONFIG.getInitialWorldSize(), - Molehunt.CONFIG.getFinalWorldSize(), - (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60); - } - }; - private final MinecraftServer server; private final List moles = new ArrayList<>(); @@ -72,7 +60,16 @@ public class Game { final var worldBorder = server.getOverworld().getWorldBorder(); worldBorder.setSize(Molehunt.CONFIG.getInitialWorldSize()); if (Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() < Molehunt.CONFIG.getGameDuration()) { - borderTimeOffsetTimer.schedule(borderTimeOffsetTask, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60 * 1000); + timer.schedule(new TimerTask() { + @Override + public void run() { + final var worldBorder = server.getOverworld().getWorldBorder(); + worldBorder.interpolateSize( + Molehunt.CONFIG.getInitialWorldSize(), + Molehunt.CONFIG.getFinalWorldSize(), + (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60); + } + }, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60 * 1000); } final var title = new TitleS2CPacket(Text.translatable("molehunt.game.start.suspense")); @@ -135,8 +132,6 @@ public class Game { timer.cancel(); timer = new Timer(); - borderTimeOffsetTask.cancel(); - final var worldBorder = server.getOverworld().getWorldBorder(); // Stops the border shrinking. worldBorder.setSize(worldBorder.getSize()); -- cgit v1.2.3 From f00242079c8d5d2fccde794296ceb57ed2b9abaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 23:25:54 +0200 Subject: style: change gamerule name because borders can also grow instead of shrinking --- src/main/java/world/anhgelus/molehunt/Molehunt.java | 6 +++--- src/main/java/world/anhgelus/molehunt/config/Config.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java index 450666a..52399dc 100644 --- a/src/main/java/world/anhgelus/molehunt/Molehunt.java +++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java @@ -89,10 +89,10 @@ public class Molehunt implements ModInitializer { GameRules.Category.MISC, GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("final_world_size", 50), 0) ); - public static final GameRules.Key SHRINKING_STARTING_TIME_OFFSET = GameRuleRegistry.register( - MOD_ID +":borderShrinkingStartingTimeOffsetMinutes", + public static final GameRules.Key MOVING_STARTING_TIME_OFFSET = GameRuleRegistry.register( + MOD_ID +":borderMovingStartingTimeOffsetMinutes", GameRules.Category.MISC, - GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("border_shrinking_starting_time_offset", 10), 0) + GameRuleFactory.createIntRule(CONFIG_FILE.getOrDefault("border_moving_starting_time_offset", 10), 0) ); public Game game; diff --git a/src/main/java/world/anhgelus/molehunt/config/Config.java b/src/main/java/world/anhgelus/molehunt/config/Config.java index 3f22df3..e1c84a4 100644 --- a/src/main/java/world/anhgelus/molehunt/config/Config.java +++ b/src/main/java/world/anhgelus/molehunt/config/Config.java @@ -57,7 +57,7 @@ public class Config { } public int getBorderShrinkingStartingTimeOffset() { - return server.getGameRules().getInt(Molehunt.SHRINKING_STARTING_TIME_OFFSET); + return server.getGameRules().getInt(Molehunt.MOVING_STARTING_TIME_OFFSET); } public static SimpleConfig configFile(String fileName) { @@ -112,11 +112,11 @@ public class Config { # Default: 50 blocks. final_world_size = 50 - # Shrinking starting offset (in minutes) - # The time before starting to shrink the world borders. - # If this value is greater than the game duration, borders will never shrink. + # Moving starting time offset (in minutes) + # The time before starting to move the world borders. + # If this value is greater than the game duration, borders will never move. # Default: 10 minutes. - border_shrinking_starting_time_offset = 10 + border_moving_starting_time_offset = 10 """; } } -- cgit v1.2.3 From 4a70f3f81c7e593fd5acbf064d89b15ef024c604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 23:43:25 +0200 Subject: feat: translation for world border related gamerules --- src/client/resources/assets/molehunt/lang/en_us.json | 15 +++++++++------ src/client/resources/assets/molehunt/lang/fr_fr.json | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/resources/assets/molehunt/lang/en_us.json b/src/client/resources/assets/molehunt/lang/en_us.json index 3a50d81..fd44d7c 100644 --- a/src/client/resources/assets/molehunt/lang/en_us.json +++ b/src/client/resources/assets/molehunt/lang/en_us.json @@ -13,10 +13,13 @@ "molehunt.game.start.mole.title": "§cThe Mole!", "molehunt.game.start.mole.subtitle": "§eGet the list of moles with §6/molehunt moles", "molehunt.game.start.survivor": "§aNot the Mole!", - "gamerule.molehunt:gameDuration": "Duration of a game", - "gamerule.molehunt:molePercentage": "Percentage of Mole", - "gamerule.molehunt:moleCount": "Number of Mole", - "gamerule.molehunt:showNametags": "Show players' nametag", - "gamerule.molehunt:showTab": "Enable the tab", - "gamerule.molehunt:showSkins": "Show players' skin" + "gamerule.molehunt:gameDuration": "Molehunt : Duration of a game", + "gamerule.molehunt:molePercentage": "Molehunt : Percentage of Mole", + "gamerule.molehunt:moleCount": "Molehunt : Number of Mole", + "gamerule.molehunt:showNametags": "Molehunt : Show players' nametag", + "gamerule.molehunt:showTab": "Molehunt : Enable the tab", + "gamerule.molehunt:showSkins": "Molehunt : Show players' skin", + "gamerule.molehunt:initialWorldSize": "Molehunt : Initial world size", + "gamerule.molehunt:finalWorldSize": "Molehunt : Final world size", + "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt : Time before moving the borders" } \ No newline at end of file diff --git a/src/client/resources/assets/molehunt/lang/fr_fr.json b/src/client/resources/assets/molehunt/lang/fr_fr.json index bb73ca8..ce1ccbb 100644 --- a/src/client/resources/assets/molehunt/lang/fr_fr.json +++ b/src/client/resources/assets/molehunt/lang/fr_fr.json @@ -13,10 +13,13 @@ "molehunt.game.start.mole.title": "§cLa Taupe !", "molehunt.game.start.mole.subtitle": "§eRécupérer la liste des taupes avec §6/molehunt moles", "molehunt.game.start.survivor": "§aPas la Taupe!", - "gamerule.molehunt:gameDuration": "Durée d'une partie", - "gamerule.molehunt:molePercentage": "Pourcentage de Taupes", - "gamerule.molehunt:moleCount": "Nombre de Taupes", - "gamerule.molehunt:showNametags": "Affiche les nametags des joueurs", - "gamerule.molehunt:showTab": "Active le tab", - "gamerule.molehunt:showSkins": "Affiche les skins des joueurs" + "gamerule.molehunt:gameDuration": "Molehunt : Durée d'une partie", + "gamerule.molehunt:molePercentage": "Molehunt : Pourcentage de Taupes", + "gamerule.molehunt:moleCount": "Molehunt : Nombre de Taupes", + "gamerule.molehunt:showNametags": "Molehunt : Affiche les nametags des joueurs", + "gamerule.molehunt:showTab": "Molehunt : Active la liste des joueurs", + "gamerule.molehunt:showSkins": "Molehunt : Affiche les skins des joueurs", + "gamerule.molehunt:initialWorldSize": "Molehunt : Taille initiale du monde", + "gamerule.molehunt:finalWorldSize": "Molehunt : Taille finale du monde", + "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt : Temps avant de bouger les bordures du monde" } \ No newline at end of file -- cgit v1.2.3 From 57cc65835c093d60bcbf12a6a517ede850a1421d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 23:53:14 +0200 Subject: fix: minecraft takes milliseconds and not seconds --- src/main/java/world/anhgelus/molehunt/game/Game.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/world/anhgelus/molehunt/game/Game.java b/src/main/java/world/anhgelus/molehunt/game/Game.java index 8670f7e..8e2406e 100644 --- a/src/main/java/world/anhgelus/molehunt/game/Game.java +++ b/src/main/java/world/anhgelus/molehunt/game/Game.java @@ -69,7 +69,7 @@ public class Game { worldBorder.interpolateSize( Molehunt.CONFIG.getInitialWorldSize(), Molehunt.CONFIG.getFinalWorldSize(), - (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60); + (long) (Molehunt.CONFIG.getGameDuration() - Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset()) * 60 * 1000); } }, (long) Molehunt.CONFIG.getBorderShrinkingStartingTimeOffset() * 60 * 1000); } -- cgit v1.2.3 From 82e4cb178bff8e9e2d7a0507ede7a78bad2f50b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sat, 24 Aug 2024 23:59:43 +0200 Subject: fix: minecraft takes milliseconds and not seconds --- src/client/resources/assets/molehunt/lang/en_us.json | 3 ++- src/client/resources/assets/molehunt/lang/fr_fr.json | 3 ++- src/main/java/world/anhgelus/molehunt/game/Game.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/resources/assets/molehunt/lang/en_us.json b/src/client/resources/assets/molehunt/lang/en_us.json index fd44d7c..04a3a8b 100644 --- a/src/client/resources/assets/molehunt/lang/en_us.json +++ b/src/client/resources/assets/molehunt/lang/en_us.json @@ -12,7 +12,8 @@ "molehunt.game.start.suspense": "§eYou are...", "molehunt.game.start.mole.title": "§cThe Mole!", "molehunt.game.start.mole.subtitle": "§eGet the list of moles with §6/molehunt moles", - "molehunt.game.start.survivor": "§aNot the Mole!", + "molehunt.game.start.survivor.title": "§aNot the Mole!", + "molehunt.game.start.survivor.subtitle": "§eTry to survive and find out who's the mole!", "gamerule.molehunt:gameDuration": "Molehunt : Duration of a game", "gamerule.molehunt:molePercentage": "Molehunt : Percentage of Mole", "gamerule.molehunt:moleCount": "Molehunt : Number of Mole", diff --git a/src/client/resources/assets/molehunt/lang/fr_fr.json b/src/client/resources/assets/molehunt/lang/fr_fr.json index ce1ccbb..42b4722 100644 --- a/src/client/resources/assets/molehunt/lang/fr_fr.json +++ b/src/client/resources/assets/molehunt/lang/fr_fr.json @@ -12,7 +12,8 @@ "molehunt.game.start.suspense": "§eVous êtes...", "molehunt.game.start.mole.title": "§cLa Taupe !", "molehunt.game.start.mole.subtitle": "§eRécupérer la liste des taupes avec §6/molehunt moles", - "molehunt.game.start.survivor": "§aPas la Taupe!", + "molehunt.game.start.survivor.title": "§aPas la taupe!", + "molehunt.game.start.survivor.subtitle": "§eEssaye de survivre et de trouver qui est la taupe !", "gamerule.molehunt:gameDuration": "Molehunt : Durée d'une partie", "gamerule.molehunt:molePercentage": "Molehunt : Pourcentage de Taupes", "gamerule.molehunt:moleCount": "Molehunt : Nombre de Taupes", diff --git a/src/main/java/world/anhgelus/molehunt/game/Game.java b/src/main/java/world/anhgelus/molehunt/game/Game.java index 8e2406e..a2fdfbb 100644 --- a/src/main/java/world/anhgelus/molehunt/game/Game.java +++ b/src/main/java/world/anhgelus/molehunt/game/Game.java @@ -93,7 +93,8 @@ public class Game { p.networkHandler.sendPacket(new TitleS2CPacket(Text.translatable("molehunt.game.start.mole.title"))); p.networkHandler.sendPacket(new SubtitleS2CPacket(Text.translatable("molehunt.game.start.mole.subtitle"))); } else { - p.networkHandler.sendPacket(new TitleS2CPacket(Text.translatable("molehunt.game.start.survivor"))); + p.networkHandler.sendPacket(new TitleS2CPacket(Text.translatable("molehunt.game.start.survivor.title"))); + p.networkHandler.sendPacket(new SubtitleS2CPacket(Text.translatable("molehunt.game.start.survivor.subtitle"))); } // reset health and food level p.setHealth(p.getMaxHealth()); -- cgit v1.2.3 From a243d9c2d8847ab4b95b56d4496ee2e301c75f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Kosman?= Date: Sun, 25 Aug 2024 00:10:18 +0200 Subject: I don't like english typography :( --- src/client/resources/assets/molehunt/lang/en_us.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/resources/assets/molehunt/lang/en_us.json b/src/client/resources/assets/molehunt/lang/en_us.json index 04a3a8b..5896c03 100644 --- a/src/client/resources/assets/molehunt/lang/en_us.json +++ b/src/client/resources/assets/molehunt/lang/en_us.json @@ -14,13 +14,13 @@ "molehunt.game.start.mole.subtitle": "§eGet the list of moles with §6/molehunt moles", "molehunt.game.start.survivor.title": "§aNot the Mole!", "molehunt.game.start.survivor.subtitle": "§eTry to survive and find out who's the mole!", - "gamerule.molehunt:gameDuration": "Molehunt : Duration of a game", - "gamerule.molehunt:molePercentage": "Molehunt : Percentage of Mole", - "gamerule.molehunt:moleCount": "Molehunt : Number of Mole", - "gamerule.molehunt:showNametags": "Molehunt : Show players' nametag", - "gamerule.molehunt:showTab": "Molehunt : Enable the tab", - "gamerule.molehunt:showSkins": "Molehunt : Show players' skin", - "gamerule.molehunt:initialWorldSize": "Molehunt : Initial world size", - "gamerule.molehunt:finalWorldSize": "Molehunt : Final world size", - "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt : Time before moving the borders" + "gamerule.molehunt:gameDuration": "Molehunt: Duration of a game", + "gamerule.molehunt:molePercentage": "Molehunt: Percentage of Mole", + "gamerule.molehunt:moleCount": "Molehunt: Number of Mole", + "gamerule.molehunt:showNametags": "Molehunt: Show players' nametag", + "gamerule.molehunt:showTab": "Molehunt: Enable the tab", + "gamerule.molehunt:showSkins": "Molehunt: Show players' skin", + "gamerule.molehunt:initialWorldSize": "Molehunt: Initial world size", + "gamerule.molehunt:finalWorldSize": "Molehunt: Final world size", + "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt: Time before moving the borders" } \ No newline at end of file -- cgit v1.2.3