diff --git a/src/main/kotlin/io/github/kr8gz/egghunt/world/EggFindDetector.kt b/src/main/kotlin/io/github/kr8gz/egghunt/world/EggFindDetector.kt index 0f02130..98f3975 100644 --- a/src/main/kotlin/io/github/kr8gz/egghunt/world/EggFindDetector.kt +++ b/src/main/kotlin/io/github/kr8gz/egghunt/world/EggFindDetector.kt @@ -44,16 +44,19 @@ object EggFindDetector { return } - player.sendMessage(EggHunt.MESSAGE_PREFIX + Text.translatable("egghunt.egg.found").formatted(Formatting.GREEN)) - with(config.onEggFound) { if (spawnFireworks) spawnFirework(world, pos) runCommands(world, player, commands) } - if (Database.Eggs.totalCount() == player.inDatabase().foundEggCount()) { + val translationKey = if (Database.Eggs.totalCount() == player.inDatabase().foundEggCount()) { runCommands(world, player, config.onFoundAll.commands) + "egghunt.egg.found.all" + } else { + "egghunt.egg.found" } + + player.sendMessage(EggHunt.MESSAGE_PREFIX + Text.translatable(translationKey).formatted(Formatting.GREEN)) } private fun spawnFirework(world: World, pos: BlockPos) { diff --git a/src/main/resources/data/egghunt/lang/de_de.json b/src/main/resources/data/egghunt/lang/de_de.json index 21baa31..43680e1 100644 --- a/src/main/resources/data/egghunt/lang/de_de.json +++ b/src/main/resources/data/egghunt/lang/de_de.json @@ -14,6 +14,7 @@ "command.egghunt.reset.player.multiple": "Gefundene Eier von %s Spielern wurden zurückgesetzt", "command.egghunt.reset.player.single": "Gefundene Eier von %s wurden zurückgesetzt", "egghunt.egg.found": "Du hast ein Ei gefunden!", + "egghunt.egg.found.all": "Du hast alle Eier gefunden!", "egghunt.egg.found.already": "Du hast dieses Ei bereits gefunden!", "egghunt.egg.placed": "Ei #%s platziert!", "egghunt.egg.removed": "Ei entfernt!", diff --git a/src/main/resources/data/egghunt/lang/en_us.json b/src/main/resources/data/egghunt/lang/en_us.json index fa10d7e..bcf20c3 100644 --- a/src/main/resources/data/egghunt/lang/en_us.json +++ b/src/main/resources/data/egghunt/lang/en_us.json @@ -14,6 +14,7 @@ "command.egghunt.reset.player.multiple": "Reset found eggs for %s players", "command.egghunt.reset.player.single": "Reset found eggs for %s", "egghunt.egg.found": "You found an egg!", + "egghunt.egg.found.all": "You found all eggs!", "egghunt.egg.found.already": "You already found this egg!", "egghunt.egg.placed": "Egg #%s placed!", "egghunt.egg.removed": "Egg removed!",