added description message on game start

This commit is contained in:
2025-01-02 01:08:53 +01:00
parent 5acb44b0e1
commit e0ee1e66c9
2 changed files with 20 additions and 9 deletions

View File

@@ -46,10 +46,10 @@ public abstract class Game extends MineNetInstance implements Spawnable {
logger = Logger.getLogger("Game:" + getUniqueId());
eventNode()
.addListener(PlayerMoveEvent.class, this::onPlayerMove)
.addListener(PlayerBlockBreakEvent.class, this::onBlockBreak)
.addListener(PlayerBlockPlaceEvent.class, this::onBlockPlace)
.addListener(ItemDropEvent.class, this::onItemDrop);
.addListener(PlayerMoveEvent.class, this::onPlayerMove)
.addListener(PlayerBlockBreakEvent.class, this::onBlockBreak)
.addListener(PlayerBlockPlaceEvent.class, this::onBlockPlace)
.addListener(ItemDropEvent.class, this::onItemDrop);
}
public Game setParent(Room parentRoom) {
@@ -64,6 +64,17 @@ public abstract class Game extends MineNetInstance implements Spawnable {
game.load();
Room.getRoom(owner).orElseThrow().moveMembersToInstance(game);
MinecraftServer.getSchedulerManager().scheduleTask(() -> {
game.getPlayers().forEach(player -> new ChatMessage(Icon.SCIENCE)
.appendStatic(factory.name().getAssembled(player).asComponent())
.newLine()
.appendStatic(factory.description().getAssembled(player).asComponent())
.send(player));
return TaskSchedule.stop();
}, TaskSchedule.seconds(3));
} catch (Exception e) {
new ChatMessage(Icon.ERROR).appendStatic("Instance crashed: " + e.getMessage()).send(owner);
MinecraftServer.getSchedulerManager().scheduleNextTick(() -> Room.getRoom(owner).orElseThrow().moveMembersToRoomLobby());

View File

@@ -70,12 +70,12 @@ ns:GameFactory#;;
missingDescription;No description;Keine Beschreibung
;;
ns:game_TntRun#;;
name;tnt run;TNT Rennen
name;TNT run;TNT Rennen
description;The tnt at the ground disappears, don't fall;Das TNT am Boden verschwindet, falle nicht herunter
levels;levels;Ebenen
;;
ns:game_ElytraRace#;;
name;elytra race;Elytra Rennen
name;Elytra race;Elytra Rennen
description;Be fast while flying through the rings;Sei schnell während du durch die Ringe fliegst
ringCount;ring count;Anzahl der Ringe
;;
@@ -99,11 +99,11 @@ name;Red light green light;Rotes licht, Grünes licht
description;Only go forward if the Trafficlights show green;Gehe nur bei Grün vorran
;;
ns:game_AcidRain#;;
name;acid rain;Säureregen
name;Acid rain;Säureregen
description;Stay under the holey roof to dodge acid rain;Bleib unter dem löchrigen Dach um dem sauren Regen auszuweichen
;;
ns:game_BowSpleef#;;
name;bow spleef;Bogen Spleef
name;Bow spleef;Bogen Spleef
description;Spleef other players and be the last survivor;Zerstöre Blöcke unter anderen Spielern und sei der letzte im Feld
;;
ns:game_Towerdefense#;;
@@ -124,5 +124,5 @@ isFast;Fast mode;Schneller Modus
hasCombat;Competitive mode;Kompetitiver Modus
;;
ns:game_AnvilRun#;;
name;Anvil Run;Anvil Run
name;Anvil run;Anvil run
description;Run away from falling anvils;Renne von fallenden Ambossen davon
1 map en_us de_de
70 missingDescription No description Keine Beschreibung
71
72 ns:game_TntRun#
73 name tnt run TNT run TNT Rennen
74 description The tnt at the ground disappears, don't fall Das TNT am Boden verschwindet, falle nicht herunter
75 levels levels Ebenen
76
77 ns:game_ElytraRace#
78 name elytra race Elytra race Elytra Rennen
79 description Be fast while flying through the rings Sei schnell während du durch die Ringe fliegst
80 ringCount ring count Anzahl der Ringe
81
99 description Only go forward if the Trafficlights show green Gehe nur bei Grün vorran
100
101 ns:game_AcidRain#
102 name acid rain Acid rain Säureregen
103 description Stay under the holey roof to dodge acid rain Bleib unter dem löchrigen Dach um dem sauren Regen auszuweichen
104
105 ns:game_BowSpleef#
106 name bow spleef Bow spleef Bogen Spleef
107 description Spleef other players and be the last survivor Zerstöre Blöcke unter anderen Spielern und sei der letzte im Feld
108
109 ns:game_Towerdefense#
124 hasCombat Competitive mode Kompetitiver Modus
125
126 ns:game_AnvilRun#
127 name Anvil Run Anvil run Anvil Run Anvil run
128 description Run away from falling anvils Renne von fallenden Ambossen davon