Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General minigame overhaul #134

Draft
wants to merge 112 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
19b952c
feat: Wizard Kit updated
Plajer Sep 1, 2022
f06a59b
Bump pom.xml from 4.6.1-dev67 to 4.6.1-dev68
github-actions[bot] Sep 1, 2022
ab63efa
feat: Medic Kit update
Plajer Sep 1, 2022
6acf8fe
feat: Include power level in golem/wolf custom name
Plajer Sep 1, 2022
a92eb32
feat: Wizard kit cooldowns API change
Plajer Sep 5, 2022
f41c7a1
feat: Tornado kit (working on it)
Plajer Sep 5, 2022
a4daf99
feat: Kit actionbar abilities draft
Plajer Sep 5, 2022
81e99bd
Merge remote-tracking branch 'github/development' into development
Plajer Sep 5, 2022
243ed15
Merge remote-tracking branch 'github/development' into development
Plajer Sep 5, 2022
5c497cd
revert: Copyright modified
Plajer Sep 5, 2022
7f41d01
fix: 1.8 fixes and variables naming
Plajer Sep 5, 2022
439ed69
fix: 1.8 health attributes
Plajer Sep 5, 2022
26a4d10
fix: 1.8 material utils
Plajer Sep 5, 2022
8641ca3
sadsadasdas
Plajer Sep 5, 2022
6cea17a
feat: Improve Tornado kit
Plajer Sep 6, 2022
678b410
Merge remote-tracking branch 'origin/development' into development
Plajer Sep 26, 2022
0200c3d
feat: Final flight ability for Tornado kit
Plajer Sep 26, 2022
8eed808
Merge remote-tracking branch 'origin/development' into development
Plajer Nov 18, 2022
07b719f
fix: Adjust MessageInitializer
Plajer Nov 18, 2022
f54875c
Merge branch 'development' into development
Tigerpanzer02 Jul 31, 2023
fbb90d3
Bump version from 4.6.1-SNAPSHOT79 to 4.6.1-SNAPSHOT80
Jul 31, 2023
db0e29a
Updated MinigamesBox
Tigerpanzer02 Jul 31, 2023
327cf52
Merge remote-tracking branch 'Plajer/development' into development-pl…
Tigerpanzer02 Jul 31, 2023
d6efa58
Bump version from 4.6.1-SNAPSHOT80 to 4.6.1-SNAPSHOT81
Jul 31, 2023
34b9eb1
Merge remote-tracking branch 'github/development' into development
Plajer Aug 1, 2023
a2609b9
fix: Compilation fix for non UTF-8 setups
Plajer Aug 1, 2023
f175604
fix: Ensure compilation compatibility with Java 8
Plajer Aug 1, 2023
d06ef50
feat(QoL): wizard kit QoL updates
Plajer Aug 1, 2023
359933e
feat: Orbs recode proposal
Plajer Aug 1, 2023
853b51d
feat: Improve sounds and QoL for new kits
Plajer Aug 1, 2023
2af6507
feat: Update messages readability
Plajer Aug 1, 2023
eac7af4
feat: Dropped flesh should always be given to the killer
Plajer Aug 1, 2023
0e29908
feat: More aggressive glowing status
Plajer Aug 1, 2023
a755342
Bump version from 4.6.1-SNAPSHOT81 to 4.6.1-SNAPSHOT82
Aug 1, 2023
ea6e7f1
refactor: Use SoundHelper
Plajer Aug 1, 2023
99db1f6
refactor: Code complexity reduced
Plajer Aug 1, 2023
8c50927
refactor: Code complexity reduced
Plajer Aug 1, 2023
baf93d8
Merge remote-tracking branch 'github/development' into development
Plajer Aug 1, 2023
09c26f9
Bump version from 4.6.1-SNAPSHOT82 to 4.6.1-SNAPSHOT83
Aug 1, 2023
651b38c
feat: Implement new cleaner kit
Plajer Aug 2, 2023
e963ae9
feat: Ability unlocked message
Plajer Aug 2, 2023
23ccafc
feat: Ability/passive power increased message
Plajer Aug 2, 2023
f7579d7
feat: Improve hitbox for wizard kit
Plajer Aug 2, 2023
b479c65
fix: Cleaner kit threw stack overflow
Plajer Aug 2, 2023
e7223bc
Merge remote-tracking branch 'github/development' into development
Plajer Aug 2, 2023
bbec6f6
Bump version from 4.6.1-SNAPSHOT83 to 4.6.1-SNAPSHOT84
Aug 2, 2023
0193978
feat: Enemies killed by pets give kills to owner
Plajer Aug 4, 2023
dc41920
feat: Implement entities riding via ProtocolLib
Plajer Aug 4, 2023
c54c4c8
fix: Rideable entities steering logic
Plajer Aug 4, 2023
d00fb78
fix: Drops filter for enemies without drop item
Plajer Aug 4, 2023
ce2addf
Merge remote-tracking branch 'github/development' into development
Plajer Aug 4, 2023
56b45e9
Bump version from 4.6.1-SNAPSHOT84 to 4.6.1-SNAPSHOT85
Aug 4, 2023
7b3c520
fix: Poplust wrong cooldown given
Plajer Aug 4, 2023
b84225e
fix: Doors restoring logic
Plajer Aug 4, 2023
c6b6491
Merge remote-tracking branch 'github/development' into development
Plajer Aug 4, 2023
34a42fb
Bump version from 4.6.1-SNAPSHOT85 to 4.6.1-SNAPSHOT86
Aug 4, 2023
bd789eb
fix: Drops logic
Plajer Aug 4, 2023
4bd7765
feat: Wave locked shop items feature
Plajer Aug 4, 2023
78b1aa7
Merge remote-tracking branch 'github/development' into development
Plajer Aug 4, 2023
f1f5e69
Bump version from 4.6.1-SNAPSHOT86 to 4.6.1-SNAPSHOT87
Aug 4, 2023
e5376b9
feat: Orb statistics placeholder
Plajer Aug 4, 2023
c4d8ca0
feat: Redesign terminator kit
Plajer Aug 4, 2023
89dae76
Merge remote-tracking branch 'github/development' into development
Plajer Aug 4, 2023
dab8dfa
Bump version from 4.6.1-SNAPSHOT87 to 4.6.1-SNAPSHOT88
Aug 4, 2023
a9fbf41
feat: Implement builder kit
Plajer Aug 11, 2023
085a4af
Merge remote-tracking branch 'github/development' into development
Plajer Aug 11, 2023
125cf94
Bump version from 4.6.1-SNAPSHOT88 to 4.6.1-SNAPSHOT89
Aug 11, 2023
437d9e5
feat: Create Pets Friend kit, modify entity upgrades
Plajer Aug 28, 2023
23cd523
Merge remote-tracking branch 'github/development' into development
Plajer Aug 28, 2023
95b4b66
Bump version from 4.6.1-SNAPSHOT89 to 4.6.1-SNAPSHOT90
Aug 28, 2023
258d0d6
fix: Fix on game leave golems and wolves removal
Plajer Aug 28, 2023
13a4725
fix: Dangling javadoc element
Plajer Aug 28, 2023
93a6549
refactor: Minimum working version is now 1.12.2
Plajer Aug 28, 2023
f62c71f
refactor: Minimum working version is now 1.12.2
Plajer Aug 28, 2023
4920d9d
fix: Door destroy order matters
Plajer Aug 28, 2023
66dc6c6
feat(QoL): Builder fences break animation
Plajer Aug 28, 2023
1762d60
fix: Development fixes
Plajer Aug 28, 2023
d20d00d
fix: Logic fix
Plajer Aug 28, 2023
ae670fd
feat(QoL): Shop sounds
Plajer Aug 28, 2023
c070fbf
feat(QoL): Play global villager damage sound
Plajer Aug 28, 2023
59bbd6c
feat: Revamp door breaking logic
Plajer Aug 28, 2023
0f8be20
feat: Revamp door breaking logic
Plajer Aug 28, 2023
ea67415
feat: Door restore logic improved
Plajer Aug 29, 2023
443a920
feat: Entities health bars improved
Plajer Aug 29, 2023
fc6dac3
feat: Nerf baby zombie speed a bit
Plajer Aug 29, 2023
2710d91
feat: Assists system implemented
Plajer Aug 30, 2023
820a236
Merge remote-tracking branch 'github/development' into development
Plajer Aug 30, 2023
37030da
feat: Buff medic with villagers healing passive
Plajer Aug 30, 2023
34a8e27
fix: Door logc fix, remove debug
Plajer Aug 30, 2023
0ba5abc
feat: Change wave refresh logic
Plajer Aug 30, 2023
a1ae533
feat: Shot bow kit recreated
Plajer Aug 30, 2023
2c5a37c
fix: Apply normal speed for unprovoked golems
Plajer Aug 31, 2023
694b438
feat: Natural regeneration for pets
Plajer Aug 31, 2023
f54d74d
fix: Players can steal pets by upgrading them
Plajer Aug 31, 2023
1885731
fix: Pet spawn limits fixed
Plajer Aug 31, 2023
ce19560
fix: Small nerfs for kits
Plajer Aug 31, 2023
188023d
fix: Remove pets from arena properly
Plajer Aug 31, 2023
91b011c
feat: Disable AI after game end
Plajer Sep 1, 2023
44ad92c
fix: Nerf tnt explosion and friendly fire
Plajer Sep 1, 2023
c16b67e
fix: Shotbow fixes
Plajer Sep 1, 2023
8a4cc49
fix: No zombies to clean threw exception
Plajer Sep 1, 2023
92b4472
fix: Better villager hurt global sound
Plajer Sep 1, 2023
93d3ea7
fix: Vehicle steer fix
Plajer Sep 1, 2023
a60dfec
feat: Trying to smoothen orbs given in later wave
Plajer Sep 2, 2023
c8ad2d3
fix: Upgrade minigame core
Plajer Sep 2, 2023
2fc1611
fix: Do not give flesh to spectators
Plajer Sep 2, 2023
33744db
Bump version from 5.0.1-SNAPSHOT3 to 5.0.1-SNAPSHOT4
Mar 8, 2024
351ffc8
feat: Village Defense Gold
Plajer Apr 20, 2024
fcc9525
Merge remote-tracking branch 'origin/development' into development
Plajer Apr 20, 2024
1e86696
Bump version from 5.0.1-SNAPSHOT4 to 5.0.1-SNAPSHOT5
Apr 20, 2024
8964d93
feat: VDUserManager, README update
Plajer Apr 20, 2024
ae9aba5
Bump version from 5.0.1-SNAPSHOT5 to 5.0.1-SNAPSHOT6
Apr 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ repositories {


dependencies {
implementation("plugily.projects:MiniGamesBox-Classic:1.2.0-SNAPSHOT36") { isTransitive = false }
implementation("plugily.projects:MiniGamesBox-Classic:1.2.0-SNAPSHOT40") { isTransitive = false }
compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("org.jetbrains:annotations:24.0.1")
compileOnly(files("lib/spigot/1.8.8-R0.1.jar"))
}

group = "plugily.projects"
version = "4.6.1-SNAPSHOT79"
version = "4.6.1-SNAPSHOT84"
description = "VillageDefense"
java {
withJavadocJar()
Expand Down Expand Up @@ -73,6 +73,12 @@ tasks {
options.encoding = "UTF-8"
}

compileJava {
options.encoding = "UTF-8"
targetCompatibility = JavaVersion.VERSION_1_8.toString()
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
}

}

publishing {
Expand Down
28 changes: 15 additions & 13 deletions src/main/java/plugily/projects/villagedefense/Main.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
/*
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package plugily.projects.villagedefense;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPluginLoader;
Expand Down Expand Up @@ -48,6 +47,7 @@
import plugily.projects.villagedefense.handlers.upgrade.EntityUpgradeMenu;
import plugily.projects.villagedefense.handlers.upgrade.upgrades.Upgrade;
import plugily.projects.villagedefense.handlers.upgrade.upgrades.UpgradeBuilder;
import plugily.projects.villagedefense.kits.KitHelper;
import plugily.projects.villagedefense.kits.free.KnightKit;
import plugily.projects.villagedefense.kits.free.LightTankKit;
import plugily.projects.villagedefense.kits.level.ArcherKit;
Expand Down Expand Up @@ -118,6 +118,7 @@ public void initializePluginClasses() {
addFileName("creatures");
Arena.init(this);
ArenaUtils.init(this);
KitHelper.init(this);
new ArenaEvents(this);
arenaManager = new ArenaManager(this);
arenaRegistry = new ArenaRegistry(this);
Expand Down Expand Up @@ -162,6 +163,7 @@ public void addKits() {
getDebugger().debug("Kit adding finished took {0}ms", System.currentTimeMillis() - start);
}


private void addPluginMetrics() {
getMetrics().addCustomChart(new Metrics.SimplePie("hooked_addons", () -> {
if(getServer().getPluginManager().getPlugin("VillageDefense-Enhancements") != null) {
Expand Down
23 changes: 12 additions & 11 deletions src/main/java/plugily/projects/villagedefense/arena/Arena.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@

package plugily.projects.villagedefense.arena;

import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
import java.util.logging.Level;
import java.util.stream.Collectors;

import org.bukkit.Location;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
Expand All @@ -28,6 +37,7 @@
import org.bukkit.entity.Villager;
import org.bukkit.entity.Wolf;
import org.jetbrains.annotations.NotNull;

import plugily.projects.minigamesbox.classic.arena.ArenaState;
import plugily.projects.minigamesbox.classic.arena.PluginArena;
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
Expand All @@ -45,15 +55,6 @@
import plugily.projects.villagedefense.arena.states.StartingState;
import plugily.projects.villagedefense.creatures.CreatureUtils;

import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
import java.util.logging.Level;
import java.util.stream.Collectors;

/**
* @author Tigerpanzer_02
* <p>
Expand Down Expand Up @@ -247,7 +248,7 @@ public void spawnWolf(Location location, Player player) {
Wolf wolf = CreatureUtils.getCreatureInitializer().spawnWolf(location);
wolf.setOwner(player);
wolf.setCustomNameVisible(getPlugin().getConfigPreferences().getOption("NAME_VISIBILITY_WOLF"));
wolf.setCustomName(new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_WAVE_ENTITIES_WOLF_NAME").asKey().player(player).build());
wolf.setCustomName(new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_WAVE_ENTITIES_WOLF_NAME").asKey().integer(0).player(player).build());
new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_WAVE_ENTITIES_WOLF_SPAWN").asKey().player(player).sendPlayer();
addWolf(wolf);
}
Expand All @@ -259,7 +260,7 @@ public void spawnGolem(Location location, Player player) {

IronGolem ironGolem = CreatureUtils.getCreatureInitializer().spawnGolem(location);
ironGolem.setCustomNameVisible(getPlugin().getConfigPreferences().getOption("NAME_VISIBILITY_GOLEM"));
ironGolem.setCustomName(new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_WAVE_ENTITIES_GOLEM_NAME").asKey().player(player).build());
ironGolem.setCustomName(new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_WAVE_ENTITIES_GOLEM_NAME").asKey().integer(0).player(player).build());
new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_WAVE_ENTITIES_GOLEM_SPAWN").asKey().player(player).sendPlayer();
addIronGolem(ironGolem);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package plugily.projects.villagedefense.arena;
Expand Down Expand Up @@ -177,7 +177,7 @@ public void onEntityDamage(EntityDamageEvent event) {
}

@EventHandler
public void onDieEntity(EntityDeathEvent event) {
public void onVillagerDeath(EntityDeathEvent event) {
LivingEntity entity = event.getEntity();
if(!(entity instanceof Creature)) {
return;
Expand All @@ -192,24 +192,7 @@ public void onDieEntity(EntityDeathEvent event) {
plugin.getRewardsHandler().performReward(null, arena, plugin.getRewardsHandler().getRewardType("VILLAGER_DEATH"));
plugin.getHolidayManager().applyHolidayDeathEffects(entity);
new MessageBuilder("IN_GAME_MESSAGES_VILLAGE_VILLAGER_DIED").asKey().arena(arena).sendArena();
} else {
if(!arena.getEnemies().contains(entity)) {
continue;
}
arena.removeEnemy((Creature) entity);
arena.changeArenaOptionBy("TOTAL_KILLED_ZOMBIES", 1);

Player killer = entity.getKiller();
Arena killerArena = plugin.getArenaRegistry().getArena(killer);

if(killerArena != null) {
plugin.getUserManager().addStat(killer, plugin.getStatsStorage().getStatisticType("KILLS"));
plugin.getUserManager().addExperience(killer, 2 * arena.getArenaOption("ZOMBIE_DIFFICULTY_MULTIPLIER"));
plugin.getRewardsHandler().performReward(killer, plugin.getRewardsHandler().getRewardType("ZOMBIE_KILL"));
plugin.getPowerupRegistry().spawnPowerup(entity.getLocation(), killerArena);
}
}
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package plugily.projects.villagedefense.arena;
Expand All @@ -28,6 +28,7 @@
import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder;
import plugily.projects.minigamesbox.classic.user.User;
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
import plugily.projects.minigamesbox.classic.utils.version.xseries.XSound;
import plugily.projects.villagedefense.Main;
import plugily.projects.villagedefense.api.event.wave.VillageWaveEndEvent;
import plugily.projects.villagedefense.api.event.wave.VillageWaveStartEvent;
Expand Down Expand Up @@ -78,8 +79,10 @@ public void stopGame(boolean quickStop, @NotNull PluginArena arena) {
}
if(plugin.getConfigPreferences().getOption("LIMIT_WAVE_UNLIMITED") && wave >= plugin.getConfig().getInt("Limit.Wave.Game-End", 25)) {
plugin.getUserManager().addStat(user, plugin.getStatsStorage().getStatisticType("WINS"));
XSound.ENTITY_VILLAGER_YES.play(player);
} else {
plugin.getUserManager().addStat(user, plugin.getStatsStorage().getStatisticType("LOSES"));
XSound.ENTITY_VILLAGER_NO.play(player);
}
plugin.getUserManager().addExperience(player, wave);
}
Expand Down Expand Up @@ -109,6 +112,7 @@ public void endWave(@NotNull Arena arena) {
Player player = user.getPlayer();
plugin.getRewardsHandler().performReward(player, arena, plugin.getRewardsHandler().getRewardType("END_WAVE"));
}
XSound.ENTITY_VILLAGER_YES.play(user.getPlayer());
}

arena.setTimer(plugin.getConfig().getInt("Time-Manager.Cooldown-Before-Next-Wave", 25));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
* Village Defense - Protect villagers from hordes of zombies
* Copyright (c) 2023 Plugily Projects - maintained by Tigerpanzer_02 and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package plugily.projects.villagedefense.arena.states;
Expand All @@ -22,6 +22,8 @@
import plugily.projects.minigamesbox.classic.arena.PluginArena;
import plugily.projects.minigamesbox.classic.arena.states.PluginInGameState;
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder;
import plugily.projects.minigamesbox.classic.utils.helper.SoundHelper;
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
import plugily.projects.villagedefense.arena.Arena;

Expand Down Expand Up @@ -63,8 +65,8 @@ public void handleCall(PluginArena arena) {
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
&& pluginArena.getWave() >= startingWave) {
&& (startingWave = getPlugin().getConfig().getInt("Glowing-Status.Starting-Wave")) > 0
&& pluginArena.getWave() >= startingWave) {
for(org.bukkit.entity.Creature remaining : pluginArena.getEnemies()) {
if(!remaining.isGlowing()) { // To avoid setting glowing property every time
remaining.setGlowing(true);
Expand All @@ -82,9 +84,14 @@ public void handleCall(PluginArena arena) {
if(arena.getArenaOption("ZOMBIES_TO_SPAWN") < 0) {
arena.setArenaOption("ZOMBIES_TO_SPAWN", 0);
}
} else if(arena.getTimer() <= 0) {
pluginArena.setFighting(true);
pluginArena.getPlugin().getArenaManager().startWave(pluginArena);
} else if(arena.getTimer() <= 3) {
SoundHelper.playArenaCountdown(arena);
if(arena.getTimer() <= 0) {
pluginArena.setFighting(true);
pluginArena.getPlugin().getArenaManager().startWave(pluginArena);
} else if(arena.getTimer() >= 1) {
new TitleBuilder("IN_GAME_MESSAGES_VILLAGE_WAVE_TITLE_STARTING_" + arena.getTimer()).asKey().arena(arena).sendArena();
}
}
}

Expand Down
Loading