Skip to content

Commit

Permalink
message for finding all eggs
Browse files Browse the repository at this point in the history
  • Loading branch information
kr8gz committed Mar 10, 2024
1 parent 5a4c270 commit 4129a5d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/data/egghunt/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/data/egghunt/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down

0 comments on commit 4129a5d

Please sign in to comment.