From 124c32c6aff8a618163548c37a2c4be5d0f8ef61 Mon Sep 17 00:00:00 2001 From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:35:55 +0200 Subject: [PATCH] config.yml Zombies renamed to Creatures --- .github/README.md | 2 +- .../villagedefense/arena/ArenaManager.java | 4 ++-- .../spawner/EnemySpawnerRegistryLegacy.java | 2 +- .../managers/spawner/SimpleEnemySpawner.java | 1 + .../arena/states/InGameState.java | 2 +- .../boot/AdditionalValueInitializer.java | 2 +- .../arguments/admin/ClearEntitiesArgument.java | 2 +- src/main/resources/config.yml | 18 +++++++++--------- src/main/resources/permissions.yml | 9 --------- 9 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/README.md b/.github/README.md index 3c890cf8d..560338605 100644 --- a/.github/README.md +++ b/.github/README.md @@ -5,7 +5,7 @@ Village Defense is a Minecraft minigame designed for small and big servers. This minigame is unique and very configurable, 100% free and open source! -The goal is to protect Villagers from hordes of undead Zombies. However, the game isn't that easy. There are more and +The goal is to protect Villagers from hordes of undead Creatures. However, the game isn't that easy. There are more and more zombies every wave and more types of them come in higher waves. There is no wave limit so try to survive as long as you can! diff --git a/src/main/java/plugily/projects/villagedefense/arena/ArenaManager.java b/src/main/java/plugily/projects/villagedefense/arena/ArenaManager.java index 1f62f417f..afd40fff2 100644 --- a/src/main/java/plugily/projects/villagedefense/arena/ArenaManager.java +++ b/src/main/java/plugily/projects/villagedefense/arena/ArenaManager.java @@ -159,10 +159,10 @@ public void startWave(@NotNull Arena arena) { Bukkit.getPluginManager().callEvent(new VillageWaveStartEvent(arena, wave)); int zombiesAmount = (int) Math.ceil((arena.getPlayers().size() * 0.5) * (wave * wave) / 2); - int maxzombies = plugin.getConfig().getInt("Limit.Spawn.Zombies", 75); + int maxzombies = plugin.getConfig().getInt("Limit.Spawn.Creatures", 75); if(zombiesAmount > maxzombies) { - int multiplier = (int) Math.ceil((zombiesAmount - (double) maxzombies) / plugin.getConfig().getInt("Zombies.Multiplier-Divider", 18)); + int multiplier = (int) Math.ceil((zombiesAmount - (double) maxzombies) / plugin.getConfig().getInt("Creatures.Multiplier-Divider", 18)); if(multiplier < 2) multiplier = 2; diff --git a/src/main/java/plugily/projects/villagedefense/arena/managers/enemy/spawner/EnemySpawnerRegistryLegacy.java b/src/main/java/plugily/projects/villagedefense/arena/managers/enemy/spawner/EnemySpawnerRegistryLegacy.java index 70d801553..5da57293d 100644 --- a/src/main/java/plugily/projects/villagedefense/arena/managers/enemy/spawner/EnemySpawnerRegistryLegacy.java +++ b/src/main/java/plugily/projects/villagedefense/arena/managers/enemy/spawner/EnemySpawnerRegistryLegacy.java @@ -88,7 +88,7 @@ public void registerCreatures() { */ public void spawnEnemies(Random random, Arena arena) { int spawn = arena.getWave(); - int zombiesLimit = plugin.getConfig().getInt("Limit.Spawn.Zombies", 75); + int zombiesLimit = plugin.getConfig().getInt("Limit.Spawn.Creatures", 75); if(zombiesLimit < spawn) { spawn = (int) Math.ceil(zombiesLimit / 2.0); } diff --git a/src/main/java/plugily/projects/villagedefense/arena/managers/spawner/SimpleEnemySpawner.java b/src/main/java/plugily/projects/villagedefense/arena/managers/spawner/SimpleEnemySpawner.java index bdda3ebc4..34e60807d 100644 --- a/src/main/java/plugily/projects/villagedefense/arena/managers/spawner/SimpleEnemySpawner.java +++ b/src/main/java/plugily/projects/villagedefense/arena/managers/spawner/SimpleEnemySpawner.java @@ -143,6 +143,7 @@ default void spawn(Location location, Arena arena) { arena.getEnemies().add(creature); } + //TODO Simplify creature spawn reduce to one method e.g. spawn; add weight to creatures configurable! @Override default void spawn(Random random, Arena arena, int spawn) { int wave = arena.getWave(); diff --git a/src/main/java/plugily/projects/villagedefense/arena/states/InGameState.java b/src/main/java/plugily/projects/villagedefense/arena/states/InGameState.java index bbd3a5b48..a2d5bb5f3 100644 --- a/src/main/java/plugily/projects/villagedefense/arena/states/InGameState.java +++ b/src/main/java/plugily/projects/villagedefense/arena/states/InGameState.java @@ -60,7 +60,7 @@ public void handleCall(PluginArena arena) { setArenaTimer(500); } if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_9_R1)) { - int zombiesLeftFrom = getPlugin().getConfig().getInt("Glowing-Status.Zombies-Left"); + int zombiesLeftFrom = getPlugin().getConfig().getInt("Glowing-Status.Creatures-Left"); int startingWave; if(zombiesLeftFrom > 0 && zombiesLeft <= zombiesLeftFrom && (startingWave = getPlugin().getConfig().getInt("Glowing-Status.Starting-Wave")) > 0 diff --git a/src/main/java/plugily/projects/villagedefense/boot/AdditionalValueInitializer.java b/src/main/java/plugily/projects/villagedefense/boot/AdditionalValueInitializer.java index 501dc5226..4b2075c34 100644 --- a/src/main/java/plugily/projects/villagedefense/boot/AdditionalValueInitializer.java +++ b/src/main/java/plugily/projects/villagedefense/boot/AdditionalValueInitializer.java @@ -57,7 +57,7 @@ private void registerConfigOptions() { getConfigPreferences().registerOption("RESPAWN_IN_GAME_JOIN", new ConfigOption("Respawn.In-Game-Join", true)); getConfigPreferences().registerOption("LIMIT_WAVE_UNLIMITED", new ConfigOption("Limit.Wave.Unlimited", true)); getConfigPreferences().registerOption("LIMIT_ENTITY_BUY_AFTER_DEATH", new ConfigOption("Limit.Wave.Entity-Buy-After-Death", true)); - getConfigPreferences().registerOption("ZOMBIE_HEALTHBAR", new ConfigOption("Zombies.Health-Bar", true)); + getConfigPreferences().registerOption("ZOMBIE_HEALTHBAR", new ConfigOption("Creatures.Health-Bar", true)); getConfigPreferences().registerOption("NAME_VISIBILITY_GOLEM", new ConfigOption("Name-Visibility.Golem", true)); getConfigPreferences().registerOption("NAME_VISIBILITY_WOLF", new ConfigOption("Name-Visibility.Wolf", true)); getConfigPreferences().registerOption("NAME_VISIBILITY_VILLAGER", new ConfigOption("Name-Visibility.Villager", true)); diff --git a/src/main/java/plugily/projects/villagedefense/commands/arguments/admin/ClearEntitiesArgument.java b/src/main/java/plugily/projects/villagedefense/commands/arguments/admin/ClearEntitiesArgument.java index e97c8fade..25c6e7cfd 100644 --- a/src/main/java/plugily/projects/villagedefense/commands/arguments/admin/ClearEntitiesArgument.java +++ b/src/main/java/plugily/projects/villagedefense/commands/arguments/admin/ClearEntitiesArgument.java @@ -55,7 +55,7 @@ public void execute(CommandSender sender, String[] args) { return; } if(args.length == 1) { - new MessageBuilder(ChatColor.RED + "Please type valid mob type to clear: VILLAGER, ZOMBIE, IRON_GOLEM").prefix().send(sender); + new MessageBuilder(ChatColor.RED + "Please type valid mob type to clear: VILLAGER, ZOMBIE, IRON_GOLEM, WOLF").prefix().send(sender); return; } Arena arena = (Arena) registry.getPlugin().getArenaRegistry().getArena((Player) sender); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index a246b6cf1..f7500ec97 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -195,19 +195,19 @@ Limit: Golems: 15 # How many villagers will be spawned in an arena? Villagers: 10 - # After how many zombies should we limit them? - # Once limit is reached zombies get more health so it's still harder each wave - Zombies: 75 + # After how many Creatures should we limit them? + # Once limit is reached Creatures get more health so it's still harder each wave + Creatures: 75 # Can the players buy again iron golems or wolves if these # entities died? The config limit and permission will be ignored. Entity-Buy-After-Death: false -Zombies: - # Active after zombies limit is reached - # Higher value means weaker zombies +Creatures: + # Active after Creatures limit is reached + # Higher value means weaker Creatures Multiplier-Divider: 18 - # Enable very simple health bar for zombies? + # Enable very simple health bar for Creatures? # They will have health instead of their names # It will show percentage of health left. Health-Bar: true @@ -237,9 +237,9 @@ Name-Visibility: Glowing-Status: # From which wave should the glowing be activated? Starting-Wave: 6 - # How many zombies should the glow be activated from? + # How many creatures should the glow be activated from? # Set to 0 to disable - Zombies-Left: 0 + Creatures-Left: 0 Update-Notifier: diff --git a/src/main/resources/permissions.yml b/src/main/resources/permissions.yml index 9cf43d6dd..0dd8094ee 100644 --- a/src/main/resources/permissions.yml +++ b/src/main/resources/permissions.yml @@ -26,15 +26,6 @@ Spawn-Limit: Golems: limit-wolve-10: 10 -# Basic permissions for game, permissions explained here: https://wiki.plugily.xyz/ -Basic: - Full-Games: "villagedefense.fullgames" - # represents arena name (NOT MAP NAME!), for example: 'villagedefense.join.ARENAnice' - # use 'villagedefense.join.*' to enable access to all arenas - Join: "villagedefense.join." - Forcestart: "villagedefense.admin.forcestart" - Premium-Kits: "villagedefense.kits.premium" - # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself!