From 169608edc91fec39fdc7f38f0acc15e86968230b Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sat, 28 Dec 2024 21:57:54 +0100 Subject: [PATCH 1/9] Create FinaleStart.java --- src/main/java/de/cuuky/varo/game/finale/FinaleStart.java | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/main/java/de/cuuky/varo/game/finale/FinaleStart.java diff --git a/src/main/java/de/cuuky/varo/game/finale/FinaleStart.java b/src/main/java/de/cuuky/varo/game/finale/FinaleStart.java new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/main/java/de/cuuky/varo/game/finale/FinaleStart.java @@ -0,0 +1 @@ + From 33746de405da8a5876d735a3e234a9733c4fabb9 Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:07:11 +0100 Subject: [PATCH 2/9] Update VaroGame.java --- src/main/java/de/cuuky/varo/game/VaroGame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/cuuky/varo/game/VaroGame.java b/src/main/java/de/cuuky/varo/game/VaroGame.java index ad149daa..f0fb303e 100644 --- a/src/main/java/de/cuuky/varo/game/VaroGame.java +++ b/src/main/java/de/cuuky/varo/game/VaroGame.java @@ -348,7 +348,7 @@ public void run() { } if (VaroGame.this.finaleCountdown != 0) { - Bukkit.broadcastMessage(Main.getPrefix() + "Das Finale startet in " + VaroGame.this.finaleCountdown + " Sekunden!"); + Main.getLanguageManager().broadcastMessage(ConfigMessages.GAME_FINALE_COUNTDOWN).replace("%countdown%", finalecountdown == 1 ? "einer" : String.valueOf(finalecountdown)); } else { VaroGame.this.startFinale(); VaroGame.this.finaleStartScheduler.cancel(); @@ -526,4 +526,4 @@ public void onDeserializeEnd() { @Override public void onSerializeStart() { } -} \ No newline at end of file +} From ecf5005bad6bd606ed1fdd08f849afc0a7a827c1 Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:07:35 +0100 Subject: [PATCH 3/9] Update ConfigMessages.java --- .../configurations/language/languages/ConfigMessages.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java b/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java index f067dcb3..7c64371f 100644 --- a/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java +++ b/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java @@ -86,6 +86,7 @@ public enum ConfigMessages implements DefaultLanguage { DEATH_KILL_LIFE_ADD("death.killLifeAdd", "Dein Team hat aufgrund eines Kills ein Teamleben erhalten!"), DEATH_KILL_TIME_ADD("death.killTimeAdd", "Aufgrund deines Kills hast du zusätzlich %colorcode%%timeAdded% &7Sekunden Zeit erhalten!"), + GAME_FINALE_COUNTDOWN("game.finaleCountdown", "&7Das Finale startet in %colorcode%%countdown% &7Sekunde(n)!"), GAME_START_COUNTDOWN("game.start.startCountdown", "%projectname% &7startet in %colorcode%%countdown% &7Sekunde(n)!"), GAME_VARO_START("game.start.varoStart", "%projectname% &7wurde gestartet! &5Viel Erfolg!"), GAME_VARO_START_TITLE("game.start.startTitle", "%colorcode%%countdown%"), From fc4c9b1545fcd18b70740f9841289209cb195293 Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:10:10 +0100 Subject: [PATCH 4/9] Update ConfigMessages.java --- .../configurations/language/languages/ConfigMessages.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java b/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java index 7c64371f..98c3a9cc 100644 --- a/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java +++ b/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/ConfigMessages.java @@ -86,7 +86,7 @@ public enum ConfigMessages implements DefaultLanguage { DEATH_KILL_LIFE_ADD("death.killLifeAdd", "Dein Team hat aufgrund eines Kills ein Teamleben erhalten!"), DEATH_KILL_TIME_ADD("death.killTimeAdd", "Aufgrund deines Kills hast du zusätzlich %colorcode%%timeAdded% &7Sekunden Zeit erhalten!"), - GAME_FINALE_COUNTDOWN("game.finaleCountdown", "&7Das Finale startet in %colorcode%%countdown% &7Sekunde(n)!"), + GAME_FINALE_COUNTDOWN("game.finale.finaleCountdown", "&7Das Finale startet in %colorcode%%countdown% &7Sekunde(n)!"), GAME_START_COUNTDOWN("game.start.startCountdown", "%projectname% &7startet in %colorcode%%countdown% &7Sekunde(n)!"), GAME_VARO_START("game.start.varoStart", "%projectname% &7wurde gestartet! &5Viel Erfolg!"), GAME_VARO_START_TITLE("game.start.startTitle", "%colorcode%%countdown%"), From 177c3c7d2a76b05cb2c5134f2196ceb9f9e4a996 Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:13:01 +0100 Subject: [PATCH 5/9] Delete src/main/java/de/cuuky/varo/game/finale directory --- src/main/java/de/cuuky/varo/game/finale/FinaleStart.java | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/main/java/de/cuuky/varo/game/finale/FinaleStart.java diff --git a/src/main/java/de/cuuky/varo/game/finale/FinaleStart.java b/src/main/java/de/cuuky/varo/game/finale/FinaleStart.java deleted file mode 100644 index 8b137891..00000000 --- a/src/main/java/de/cuuky/varo/game/finale/FinaleStart.java +++ /dev/null @@ -1 +0,0 @@ - From 989c0803ef48e4c0d6bc1de22f245254cd992288 Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:13:56 +0100 Subject: [PATCH 6/9] Update VaroGame.java --- src/main/java/de/cuuky/varo/game/VaroGame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/cuuky/varo/game/VaroGame.java b/src/main/java/de/cuuky/varo/game/VaroGame.java index f0fb303e..e4ac076d 100644 --- a/src/main/java/de/cuuky/varo/game/VaroGame.java +++ b/src/main/java/de/cuuky/varo/game/VaroGame.java @@ -348,7 +348,7 @@ public void run() { } if (VaroGame.this.finaleCountdown != 0) { - Main.getLanguageManager().broadcastMessage(ConfigMessages.GAME_FINALE_COUNTDOWN).replace("%countdown%", finalecountdown == 1 ? "einer" : String.valueOf(finalecountdown)); + Main.getLanguageManager().broadcastMessage(ConfigMessages.GAME_FINALE_COUNTDOWN).replace("%countdown%", countdown == 1 ? "einer" : String.valueOf(countdown)); } else { VaroGame.this.startFinale(); VaroGame.this.finaleStartScheduler.cancel(); From a8b4fd345158e9724c42cae0d8a09607f13e7a27 Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:14:16 +0100 Subject: [PATCH 7/9] Update VaroGame.java --- src/main/java/de/cuuky/varo/game/VaroGame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/cuuky/varo/game/VaroGame.java b/src/main/java/de/cuuky/varo/game/VaroGame.java index e4ac076d..245c14f9 100644 --- a/src/main/java/de/cuuky/varo/game/VaroGame.java +++ b/src/main/java/de/cuuky/varo/game/VaroGame.java @@ -348,7 +348,7 @@ public void run() { } if (VaroGame.this.finaleCountdown != 0) { - Main.getLanguageManager().broadcastMessage(ConfigMessages.GAME_FINALE_COUNTDOWN).replace("%countdown%", countdown == 1 ? "einer" : String.valueOf(countdown)); + Main.getLanguageManager().broadcastMessage(ConfigMessages.GAME_FINALE_COUNTDOWN).replace("%countdown%", finaleCountdown == 1 ? "einer" : String.valueOf(finaleCountdown)); } else { VaroGame.this.startFinale(); VaroGame.this.finaleStartScheduler.cancel(); From 67be48aa62ae7c728dbfbc213be5c04f134c9c7d Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:40:05 +0100 Subject: [PATCH 8/9] Update LanguageEN.java --- .../configurations/language/languages/LanguageEN.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/LanguageEN.java b/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/LanguageEN.java index 7148b09e..87d50fe9 100644 --- a/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/LanguageEN.java +++ b/src/main/java/de/cuuky/varo/configuration/configurations/language/languages/LanguageEN.java @@ -83,6 +83,7 @@ public enum LanguageEN implements LoadableMessage { DEATH_KILL_LIFE_ADD("death.killLifeAdd", "&7Your team got a team life because of a kill!"), DEATH_KILL_TIME_ADD("death.killTimeAdd", "You've recieved %colorcode%%timeAdded% &7seconds of additional time!"), + GAME_FINALE_COUNTDOWN("game.finale.finaleCountdown", "&7The finale starts in %colorcode%%countdown% &7second(s)!"), GAME_START_COUNTDOWN("game.start.startCountdown", "%projectname% &7starts in %colorcode%%countdown% &7second(s)!"), GAME_VARO_START("game.start.varoStart", "%projectname% &7has started! &5Good luck!"), GAME_VARO_START_TITLE("game.start.startTitle", "%colorcode%%countdown%"), From 07e819206c2fa2a34d54126ac9f1f007040f3e70 Mon Sep 17 00:00:00 2001 From: Kalibrier <157916660+Kalibrier@users.noreply.github.com> Date: Sun, 29 Dec 2024 11:56:08 +0100 Subject: [PATCH 9/9] Update AutoSetup.java Generates all of the spawns on the same height --- .../de/cuuky/varo/game/world/AutoSetup.java | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/cuuky/varo/game/world/AutoSetup.java b/src/main/java/de/cuuky/varo/game/world/AutoSetup.java index 3ecbb2ac..9964c40d 100644 --- a/src/main/java/de/cuuky/varo/game/world/AutoSetup.java +++ b/src/main/java/de/cuuky/varo/game/world/AutoSetup.java @@ -112,15 +112,40 @@ private void setupBorder(Location middle) { private void setupSpawns(Location middle) { System.out.println(Main.getConsolePrefix() + "AutoSetup: Setting the spawns..."); - int y = this.getGroundHeight(middle.getWorld(), this.x, this.z); - if (ConfigSetting.AUTOSETUP_PORTAL_ENABLED.getValueAsBoolean()) - y += ConfigSetting.AUTOSETUP_PORTAL_HEIGHT.getValueAsInt(); - middle.getWorld().setSpawnLocation(this.x, y, this.z); + int flatHeight = getFlatSurfaceHeight(middle.getWorld(), this.x, this.z); + + middle.getWorld().setSpawnLocation(this.x, flatHeight, this.z); new SpawnGenerator(middle, getSpawnRadius(ConfigSetting.AUTOSETUP_SPAWNS_AMOUNT.getValueAsInt()),ConfigSetting.AUTOSETUP_SPAWNS_AMOUNT.getValueAsInt(), (XMaterial) ConfigSetting.AUTOSETUP_SPAWNS_BLOCKID.getValueAsEnum(), (XMaterial) ConfigSetting.AUTOSETUP_SPAWNS_SIDEBLOCKID.getValueAsEnum()); } + private int getFlatSurfaceHeight(World world, int x, int z) { + int flatHeight = getGroundHeight(world, x, z); + + int radius = getSpawnRadius(ConfigSetting.AUTOSETUP_SPAWNS_AMOUNT.getValueAsInt()); + + for (int i = -radius; i <= radius; i++) { + for (int j = -radius; j <= radius; j++) { + if (i * i + j * j <= radius * radius) { + int tempHeight = getGroundHeight(world, x + i, z + j); + flatHeight = Math.min(flatHeight, tempHeight); + } + } + } + + for (int i = -radius; i <= radius; i++) { + for (int j = -radius; j <= radius; j++) { + if (i * i + j * j <= radius * radius) { + Location loc = new Location(world, x + i, flatHeight, z + j); + loc.getBlock().setType(XMaterial.GRASS_BLOCK.parseMaterial()); + } + } + } + + return flatHeight; + } + private void setupAutoStart() { if (ConfigSetting.AUTOSETUP_TIME_HOUR.isIntActivated() && ConfigSetting.AUTOSETUP_TIME_MINUTE.isIntActivated()) { System.out.println(Main.getConsolePrefix() + "AutoSetup: " + "Setting up AutoStart...");