From 8aa867c6158447da40b11eb450555fc21c2da323 Mon Sep 17 00:00:00 2001 From: Esophose Date: Thu, 22 Aug 2019 10:32:14 -0600 Subject: [PATCH 01/16] Added support for 1.13 entities --- .../epicbosses/utils/EntityFinder.java | 5 +++ .../utils/entity/handlers/DolphinHandler.java | 22 ++++++++++ .../utils/entity/handlers/DrownedHandler.java | 22 ++++++++++ .../utils/entity/handlers/FishHandler.java | 44 +++++++++++++++++++ .../entity/handlers/MagmaCubeHandler.java | 2 +- .../utils/entity/handlers/PhantomHandler.java | 32 ++++++++++++++ .../utils/entity/handlers/TurtleHandler.java | 22 ++++++++++ 7 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java index 4b19437..9727cc3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java @@ -69,6 +69,11 @@ public enum EntityFinder { LLAMA("Llama", new LlamaHandler(), "llama"), PARROT("Parrot", new ParrotHandler(), "parrot"), VILLAGER("Villager", new VillagerHandler(), "villager"), + DOLPHIN("Dolphin", new DolphinHandler(), "dolphin"), + DROWNED("Drowned", new DrownedHandler(), "drowned"), + FISH("Fish", new FishHandler(), "fish", "tropicalfish", "tropical fish", "tropical_fish", "clownfish", "cod", "salmon", "pufferfish"), + TURTLE("Turtle", new TurtleHandler(), "turtle"), + PHANTOM("Phantom", new PhantomHandler(), "phantom"), CAT("Cat", new CatHandler(), "cat"), FOX("Fox", new FoxHandler(), "fox"), PANDA("Panda", new PandaHandler(), "panda"), diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java new file mode 100644 index 0000000..65c5fd0 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java @@ -0,0 +1,22 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.epicbosses.utils.Versions; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import com.songoda.epicbosses.utils.version.VersionHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class DolphinHandler implements ICustomEntityHandler { + + private VersionHandler versionHandler = new VersionHandler(); + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); + } + + return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.DOLPHIN); + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java new file mode 100644 index 0000000..044749a --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java @@ -0,0 +1,22 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.epicbosses.utils.Versions; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import com.songoda.epicbosses.utils.version.VersionHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class DrownedHandler implements ICustomEntityHandler { + + private VersionHandler versionHandler = new VersionHandler(); + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); + } + + return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.DROWNED); + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java new file mode 100644 index 0000000..17842ef --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java @@ -0,0 +1,44 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.epicbosses.utils.Versions; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import com.songoda.epicbosses.utils.version.VersionHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Fish; +import org.bukkit.entity.LivingEntity; + +public class FishHandler implements ICustomEntityHandler { + + private VersionHandler versionHandler = new VersionHandler(); + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); + } + + + EntityType fishEntityType; + String type = entityType.toUpperCase().replace("_", ""); + switch (type) { + case "COD": + fishEntityType = EntityType.COD; + break; + case "PUFFERFISH": + fishEntityType = EntityType.PUFFERFISH; + break; + case "SALMON": + fishEntityType = EntityType.SALMON; + break; + case "FISH": + case "TROPICALFISH": + case "CLOWNFISH": + default: + fishEntityType = EntityType.TROPICAL_FISH; + break; + } + + return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, fishEntityType); + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java index 752b757..7f291f1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java @@ -19,7 +19,7 @@ public class MagmaCubeHandler implements ICustomEntityHandler { int size = 4; if (entityType.contains(":")) { String[] split = entityType.split(":"); - size = Integer.valueOf(split[1]); + size = Integer.parseInt(split[1]); } MagmaCube magmaCube = (MagmaCube) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.MAGMA_CUBE); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java new file mode 100644 index 0000000..4acb87a --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java @@ -0,0 +1,32 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.epicbosses.utils.Versions; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import com.songoda.epicbosses.utils.version.VersionHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Phantom; + +public class PhantomHandler implements ICustomEntityHandler { + + private VersionHandler versionHandler = new VersionHandler(); + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); + } + + int size = 4; + if (entityType.contains(":")) { + String[] split = entityType.split(":"); + size = Integer.parseInt(split[1]); + } + + Phantom phantom = (Phantom) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PHANTOM); + phantom.setSize(size); + + return phantom; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java new file mode 100644 index 0000000..1b68500 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java @@ -0,0 +1,22 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.epicbosses.utils.Versions; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import com.songoda.epicbosses.utils.version.VersionHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class TurtleHandler implements ICustomEntityHandler { + + private VersionHandler versionHandler = new VersionHandler(); + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); + } + + return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.TURTLE); + } +} From 6135f9c25797f2f65028f831bb4af173e76830af Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 16:53:51 -0400 Subject: [PATCH 02/16] - Added SongodaCore - Removed Lombok - Redid worldguard system - Removed a lot of useless/unused code. - Added compatibility with PlayerPoints and The Reserve. --- api-modules/WorldGuard-Legacy/pom.xml | 42 - .../dependencies/WorldGuardLegacyHelper.java | 122 - api-modules/WorldGuard/pom.xml | 42 - .../utils/dependencies/WorldGuardHelper.java | 134 - plugin-modules/Core/pom.xml | 46 +- .../{current => }/autospawns.json | 0 .../resources-json/{current => }/bosses.json | 0 .../{current => }/commands.json | 0 .../{current => }/droptables.json | 0 .../resources-json/{current => }/items.json | 0 .../resources-json/legacy/autospawns.json | 23 - .../Core/resources-json/legacy/bosses.json | 77 - .../Core/resources-json/legacy/commands.json | 26 - .../resources-json/legacy/droptables.json | 158 - .../Core/resources-json/legacy/items.json | 94 - .../Core/resources-json/legacy/messages.json | 40 - .../Core/resources-json/legacy/minions.json | 38 - .../Core/resources-json/legacy/skills.json | 196 -- .../{current => }/messages.json | 0 .../resources-json/{current => }/minions.json | 0 .../resources-json/{current => }/skills.json | 0 .../{current/config.yml => display.yml} | 36 - .../resources-yml/{current => }/editor.yml | 2 +- .../Core/resources-yml/legacy/config.yml | 259 -- .../Core/resources-yml/legacy/editor.yml | 2984 ----------------- .../com/songoda/epicbosses/CustomBosses.java | 244 -- .../com/songoda/epicbosses/EpicBosses.java | 384 +++ .../com/songoda/epicbosses/api/BossAPI.java | 8 +- .../epicbosses/autospawns/AutoSpawn.java | 56 +- .../handlers/IntervalSpawnHandler.java | 18 +- .../settings/AutoSpawnSettings.java | 58 +- .../types/IntervalSpawnElement.java | 43 +- .../commands/boss/BossCreateCmd.java | 1 - .../epicbosses/commands/boss/BossEditCmd.java | 1 - .../epicbosses/commands/boss/BossHelpCmd.java | 4 +- .../commands/boss/BossNearbyCmd.java | 7 +- .../epicbosses/commands/boss/BossNewCmd.java | 5 +- .../commands/boss/BossReloadCmd.java | 1 + .../epicbosses/commands/boss/BossShopCmd.java | 6 +- .../epicbosses/commands/boss/BossTimeCmd.java | 4 +- .../epicbosses/droptable/DropTable.java | 23 +- .../droptable/elements/DropTableElement.java | 34 +- .../droptable/elements/GiveTableElement.java | 12 +- .../elements/GiveTableSubElement.java | 69 +- .../droptable/elements/SprayTableElement.java | 42 +- .../songoda/epicbosses/entity/BossEntity.java | 88 +- .../epicbosses/entity/MinionEntity.java | 33 +- .../entity/elements/CommandsElement.java | 20 +- .../entity/elements/DropsElement.java | 31 +- .../entity/elements/EntityStatsElement.java | 45 +- .../entity/elements/EquipmentElement.java | 36 +- .../entity/elements/HandsElement.java | 20 +- .../entity/elements/MainStatsElement.java | 45 +- .../entity/elements/MessagesElement.java | 34 +- .../elements/OnDeathMessageElement.java | 40 +- .../elements/OnSpawnMessageElement.java | 23 +- .../entity/elements/SkillsElement.java | 34 +- .../entity/elements/TauntElement.java | 31 +- .../epicbosses/events/BossDamageEvent.java | 25 +- .../epicbosses/events/BossDeathEvent.java | 13 +- .../epicbosses/events/BossSkillEvent.java | 21 +- .../epicbosses/events/BossSpawnEvent.java | 13 +- .../epicbosses/events/PreBossDeathEvent.java | 19 +- .../epicbosses/events/PreBossSkillEvent.java | 17 +- .../epicbosses/events/PreBossSpawnEvent.java | 7 +- .../events/PreBossSpawnItemEvent.java | 14 +- ...leHandler.java => DisplayFileHandler.java} | 6 +- .../epicbosses/file/ItemStackFileHandler.java | 2 - .../epicbosses/file/MinionsFileHandler.java | 1 - .../handlers/AutoSpawnVariableHandler.java | 48 +- .../handlers/BossDisplayNameHandler.java | 46 +- .../handlers/BossShopPriceHandler.java | 40 +- .../handlers/SkillDisplayNameHandler.java | 40 +- .../droptable/GetDropTableItemStack.java | 4 +- .../holder/ActiveAutoSpawnHolder.java | 18 +- .../epicbosses/holder/ActiveBossHolder.java | 85 +- .../epicbosses/holder/ActiveMinionHolder.java | 42 +- .../epicbosses/holder/DeadBossHolder.java | 22 +- .../ActiveIntervalAutoSpawnHolder.java | 23 +- .../listeners/after/BossDeathListener.java | 11 +- .../listeners/during/BossDamageListener.java | 4 +- .../during/BossMinionTargetListener.java | 11 +- .../listeners/during/BossSkillListener.java | 9 +- .../listeners/pre/BossSpawnListener.java | 20 +- .../epicbosses/managers/AutoSpawnManager.java | 4 +- .../managers/BossCommandManager.java | 43 +- .../managers/BossDropTableManager.java | 14 +- .../managers/BossEntityManager.java | 24 +- .../epicbosses/managers/BossHookManager.java | 92 +- .../managers/BossListenerManager.java | 6 +- .../managers/BossLocationManager.java | 83 +- .../managers/BossMechanicManager.java | 13 +- .../epicbosses/managers/BossPanelManager.java | 648 +++- .../epicbosses/managers/BossSkillManager.java | 17 +- .../managers/BossTargetManager.java | 10 +- .../epicbosses/managers/BossTauntManager.java | 6 +- .../managers/MinionMechanicManager.java | 12 +- .../managers/PlaceholderManager.java | 6 +- .../managers/files/AutoSpawnFileManager.java | 4 +- .../managers/files/BossesFileManager.java | 10 +- .../managers/files/CommandsFileManager.java | 8 +- .../managers/files/ItemsFileManager.java | 10 +- .../managers/files/MessagesFileManager.java | 12 +- .../managers/files/MinionsFileManager.java | 10 +- .../managers/files/SkillsFileManager.java | 10 +- .../managers/interfaces/IMechanicManager.java | 1 - .../mechanics/boss/NameMechanic.java | 24 +- .../mechanics/boss/WeaponMechanic.java | 2 +- .../mechanics/minions/NameMechanic.java | 22 +- .../epicbosses/panel/AddItemsPanel.java | 4 +- .../epicbosses/panel/AutoSpawnsPanel.java | 15 +- .../epicbosses/panel/CustomBossesPanel.java | 16 +- .../epicbosses/panel/CustomItemsPanel.java | 5 +- .../epicbosses/panel/CustomSkillsPanel.java | 11 +- .../epicbosses/panel/DropTablePanel.java | 10 +- .../panel/EntityTypeEditorPanel.java | 20 +- .../songoda/epicbosses/panel/ShopPanel.java | 30 +- .../AutoSpawnCustomSettingsEditorPanel.java | 10 +- .../AutoSpawnEntitiesEditorPanel.java | 12 +- .../AutoSpawnSpawnMessageEditorPanel.java | 4 +- .../AutoSpawnSpecialSettingsEditorPanel.java | 4 +- .../autospawns/AutoSpawnTypeEditorPanel.java | 4 +- .../autospawns/MainAutoSpawnEditorPanel.java | 7 +- .../panel/bosses/BossListEditorPanel.java | 11 +- .../panel/bosses/BossShopEditorPanel.java | 4 +- .../panel/bosses/DropsEditorPanel.java | 10 +- .../panel/bosses/DropsMainEditorPanel.java | 5 +- .../panel/bosses/MainBossEditPanel.java | 10 +- .../panel/bosses/SkillListEditorPanel.java | 12 +- .../panel/bosses/SkillMainEditorPanel.java | 4 +- .../panel/bosses/SpawnItemEditorPanel.java | 10 +- .../bosses/StatisticMainEditorPanel.java | 6 +- .../panel/bosses/TargetingEditorPanel.java | 5 +- .../bosses/commands/OnDeathCommandEditor.java | 12 +- .../bosses/commands/OnSpawnCommandEditor.java | 12 +- .../bosses/equipment/BootsEditorPanel.java | 4 +- .../equipment/ChestplateEditorPanel.java | 4 +- .../bosses/equipment/HelmetEditorPanel.java | 4 +- .../bosses/equipment/LeggingsEditorPanel.java | 4 +- .../list/BossListEquipmentEditorPanel.java | 4 +- .../list/BossListStatisticEditorPanel.java | 4 +- .../list/BossListWeaponEditorPanel.java | 4 +- .../bosses/text/DeathTextEditorPanel.java | 4 +- .../SkillMasterMessageTextEditorPanel.java | 4 +- .../bosses/text/SpawnTextEditorPanel.java | 4 +- .../bosses/text/TauntTextEditorPanel.java | 4 +- .../bosses/weapons/MainHandEditorPanel.java | 4 +- .../bosses/weapons/OffHandEditorPanel.java | 4 +- .../droptables/DropTableTypeEditorPanel.java | 6 +- .../droptables/MainDropTableEditorPanel.java | 3 - .../DropTableNewRewardEditorPanel.java | 6 +- .../DropTableRewardMainEditorPanel.java | 4 +- .../DropTableRewardsListEditorPanel.java | 10 +- .../types/drop/DropDropNewRewardPanel.java | 4 +- .../types/drop/DropDropRewardListPanel.java | 4 +- .../drop/DropDropRewardMainEditPanel.java | 4 +- .../drop/DropDropTableMainEditorPanel.java | 6 +- .../types/give/GiveRewardMainEditPanel.java | 7 +- .../give/GiveRewardPositionListPanel.java | 18 +- .../give/GiveRewardRewardsListPanel.java | 10 +- .../commands/GiveCommandNewRewardPanel.java | 10 +- .../commands/GiveCommandRewardListPanel.java | 10 +- .../GiveCommandRewardMainEditPanel.java | 4 +- .../give/drops/GiveDropNewRewardPanel.java | 4 +- .../give/drops/GiveDropRewardListPanel.java | 4 +- .../drops/GiveDropRewardMainEditPanel.java | 4 +- .../give/handlers/GiveRewardEditHandler.java | 28 +- .../types/spray/SprayDropNewRewardPanel.java | 4 +- .../types/spray/SprayDropRewardListPanel.java | 4 +- .../spray/SprayDropRewardMainEditPanel.java | 4 +- .../spray/SprayDropTableMainEditorPanel.java | 6 +- .../ItemStackSubListPanelHandler.java | 8 +- .../panel/handlers/ListCommandListEditor.java | 13 +- .../panel/handlers/ListMessageListEditor.java | 13 +- .../handlers/SingleMessageListEditor.java | 12 +- .../panel/skills/MainSkillEditorPanel.java | 7 +- .../panel/skills/SkillTypeEditorPanel.java | 4 +- .../custom/CommandSkillEditorPanel.java | 10 +- .../skills/custom/CustomSkillEditorPanel.java | 6 +- .../skills/custom/GroupSkillEditorPanel.java | 12 +- .../skills/custom/PotionSkillEditorPanel.java | 10 +- .../commands/CommandListSkillEditorPanel.java | 12 +- .../commands/ModifyCommandEditorPanel.java | 4 +- .../custom/CustomSkillTypeEditorPanel.java | 12 +- .../custom/MaterialTypeEditorPanel.java | 11 +- .../custom/MinionSelectEditorPanel.java | 13 +- .../custom/SpecialSettingsEditorPanel.java | 12 +- .../CreatePotionEffectEditorPanel.java | 4 +- .../potions/PotionEffectTypeEditorPanel.java | 15 +- .../songoda/epicbosses/settings/Settings.java | 53 + .../com/songoda/epicbosses/skills/Skill.java | 58 +- .../epicbosses/skills/custom/Cage.java | 26 +- .../epicbosses/skills/custom/Disarm.java | 6 +- .../epicbosses/skills/custom/Fireball.java | 1 - .../epicbosses/skills/custom/Minions.java | 6 +- .../skills/custom/cage/CageLocationData.java | 27 +- .../skills/custom/cage/CagePlayerData.java | 17 +- .../elements/CustomCageSkillElement.java | 39 +- .../elements/CustomMinionSkillElement.java | 25 +- .../elements/SubCommandSkillElement.java | 30 +- .../elements/SubCustomSkillElement.java | 30 +- .../interfaces/ICustomSkillHandler.java | 1 - .../skills/types/CommandSkillElement.java | 15 +- .../skills/types/CustomSkillElement.java | 13 +- .../skills/types/GroupSkillElement.java | 19 +- .../skills/types/PotionSkillElement.java | 15 +- .../epicbosses/targeting/TargetHandler.java | 13 +- .../types/TopDamagerTargetHandler.java | 5 +- .../com/songoda/epicbosses/utils/Debug.java | 6 +- .../epicbosses/utils/EnchantFinder.java | 19 +- .../epicbosses/utils/EntityFinder.java | 24 +- .../com/songoda/epicbosses/utils/Message.java | 2 +- .../epicbosses/utils/MessageUtils.java | 1 - .../songoda/epicbosses/utils/Permission.java | 6 +- .../epicbosses/utils/PotionEffectFinder.java | 20 +- .../songoda/epicbosses/utils/RandomUtils.java | 2 - .../songoda/epicbosses/utils/ServerUtils.java | 4 +- .../songoda/epicbosses/utils/StringUtils.java | 5 +- .../songoda/epicbosses/utils/Versions.java | 11 +- .../utils/dependencies/ASkyblockHelper.java | 2 +- .../HolographicDisplayHelper.java | 41 - .../utils/dependencies/VaultHelper.java | 41 - .../utils/entity/ICustomEntityHandler.java | 1 - .../entity/handlers/ElderGuardianHandler.java | 3 +- .../utils/entity/handlers/FishHandler.java | 1 - .../entity/handlers/KillerBunnyHandler.java | 4 +- .../entity/handlers/MagmaCubeHandler.java | 1 - .../epicbosses/utils/file/FileHandler.java | 10 +- .../epicbosses/utils/file/YmlFileHandler.java | 16 +- .../itemstack/ItemStackHolderConverter.java | 3 +- .../itemstack/holder/ItemStackHolder.java | 56 +- .../songoda/epicbosses/utils/panel/Panel.java | 71 +- .../handlers/SubVariablePanelHandler.java | 1 - .../base/handlers/VariablePanelHandler.java | 1 - .../utils/panel/builder/PanelBuilder.java | 13 +- .../panel/builder/PanelBuilderCounter.java | 36 +- .../panel/builder/PanelBuilderSettings.java | 34 +- .../potion/holder/PotionEffectHolder.java | 31 +- .../utils/version/VersionHandler.java | 8 +- plugin-modules/WorldGuardHelper/pom.xml | 23 - .../epicbosses/utils/IWorldGuardHelper.java | 24 - pom.xml | 42 +- 242 files changed, 3181 insertions(+), 5899 deletions(-) delete mode 100644 api-modules/WorldGuard-Legacy/pom.xml delete mode 100644 api-modules/WorldGuard-Legacy/src/com/songoda/epicbosses/utils/dependencies/WorldGuardLegacyHelper.java delete mode 100644 api-modules/WorldGuard/pom.xml delete mode 100644 api-modules/WorldGuard/src/com/songoda/epicbosses/utils/dependencies/WorldGuardHelper.java rename plugin-modules/Core/resources-json/{current => }/autospawns.json (100%) rename plugin-modules/Core/resources-json/{current => }/bosses.json (100%) rename plugin-modules/Core/resources-json/{current => }/commands.json (100%) rename plugin-modules/Core/resources-json/{current => }/droptables.json (100%) rename plugin-modules/Core/resources-json/{current => }/items.json (100%) delete mode 100644 plugin-modules/Core/resources-json/legacy/autospawns.json delete mode 100644 plugin-modules/Core/resources-json/legacy/bosses.json delete mode 100644 plugin-modules/Core/resources-json/legacy/commands.json delete mode 100644 plugin-modules/Core/resources-json/legacy/droptables.json delete mode 100644 plugin-modules/Core/resources-json/legacy/items.json delete mode 100644 plugin-modules/Core/resources-json/legacy/messages.json delete mode 100644 plugin-modules/Core/resources-json/legacy/minions.json delete mode 100644 plugin-modules/Core/resources-json/legacy/skills.json rename plugin-modules/Core/resources-json/{current => }/messages.json (100%) rename plugin-modules/Core/resources-json/{current => }/minions.json (100%) rename plugin-modules/Core/resources-json/{current => }/skills.json (100%) rename plugin-modules/Core/resources-yml/{current/config.yml => display.yml} (90%) rename plugin-modules/Core/resources-yml/{current => }/editor.yml (99%) delete mode 100644 plugin-modules/Core/resources-yml/legacy/config.yml delete mode 100644 plugin-modules/Core/resources-yml/legacy/editor.yml delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/CustomBosses.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java rename plugin-modules/Core/src/com/songoda/epicbosses/file/{ConfigFileHandler.java => DisplayFileHandler.java} (69%) create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/settings/Settings.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/HolographicDisplayHelper.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/VaultHelper.java delete mode 100644 plugin-modules/WorldGuardHelper/pom.xml delete mode 100644 plugin-modules/WorldGuardHelper/src/com/songoda/epicbosses/utils/IWorldGuardHelper.java diff --git a/api-modules/WorldGuard-Legacy/pom.xml b/api-modules/WorldGuard-Legacy/pom.xml deleted file mode 100644 index 1e8ad37..0000000 --- a/api-modules/WorldGuard-Legacy/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - EpicBosses - com.songoda.epicbosses - maven-version-number - ../../pom.xml - - 4.0.0 - - WorldGuard-Legacy - jar - - - - org.spigotmc - spigot - 1.12.2 - provided - - - com.songoda.epicbosses - WorldGuardHelper - ${project.version} - provided - - - com.sk89q - worldedit - 6.1.9 - provided - - - com.sk89q - worldguard - 6.2.2 - provided - - - \ No newline at end of file diff --git a/api-modules/WorldGuard-Legacy/src/com/songoda/epicbosses/utils/dependencies/WorldGuardLegacyHelper.java b/api-modules/WorldGuard-Legacy/src/com/songoda/epicbosses/utils/dependencies/WorldGuardLegacyHelper.java deleted file mode 100644 index b38ed4d..0000000 --- a/api-modules/WorldGuard-Legacy/src/com/songoda/epicbosses/utils/dependencies/WorldGuardLegacyHelper.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.songoda.epicbosses.utils.dependencies; - -import com.sk89q.worldguard.bukkit.WGBukkit; -import com.sk89q.worldguard.bukkit.WorldGuardPlugin; -import com.sk89q.worldguard.protection.ApplicableRegionSet; -import com.sk89q.worldguard.protection.flags.DefaultFlag; -import com.sk89q.worldguard.protection.flags.StateFlag; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; -import com.songoda.epicbosses.utils.IWorldGuardHelper; -import org.bukkit.Bukkit; -import org.bukkit.Location; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 16-Oct-18 - */ -public class WorldGuardLegacyHelper implements IWorldGuardHelper { - - private WorldGuardPlugin worldGuard; - - @Override - public boolean isPvpAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WGBukkit.getPlugin(); - } - ApplicableRegionSet applicableRegionSet = this.worldGuard.getRegionManager(loc.getWorld()).getApplicableRegions(loc); - StateFlag.State state = applicableRegionSet.queryState(null, DefaultFlag.PVP); - - return state != StateFlag.State.DENY; - } - - return true; - } - - @Override - public boolean isBreakAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WGBukkit.getPlugin(); - } - - ApplicableRegionSet applicableRegionSet = this.worldGuard.getRegionManager(loc.getWorld()).getApplicableRegions(loc); - StateFlag.State state = applicableRegionSet.queryState(null, DefaultFlag.BLOCK_BREAK); - - return state != StateFlag.State.DENY; - } - - return true; - } - - @Override - public boolean isExplosionsAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WGBukkit.getPlugin(); - } - - ApplicableRegionSet applicableRegionSet = this.worldGuard.getRegionManager(loc.getWorld()).getApplicableRegions(loc); - StateFlag.State state = applicableRegionSet.queryState(null, DefaultFlag.OTHER_EXPLOSION); - - return state != StateFlag.State.DENY; - } - - return true; - } - - @Override - public List getRegionNames(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WGBukkit.getPlugin(); - } - - List regions = new ArrayList<>(); - List parentNames = new ArrayList<>(); - // this prototype is different from v5 to v6, but they're both Iterable - Iterable set = (Iterable) this.worldGuard.getRegionManager(loc.getWorld()).getApplicableRegions(loc); - - for (ProtectedRegion region : set) { - String id = region.getId(); - - regions.add(id); - - ProtectedRegion parent = region.getParent(); - - while (parent != null) { - parentNames.add(parent.getId()); - parent = parent.getParent(); - } - } - - for (String name : parentNames) { - regions.remove(name); - } - - return regions; - } - - return null; - } - - @Override - public boolean isMobSpawningAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WGBukkit.getPlugin(); - } - - ApplicableRegionSet applicableRegionSet = this.worldGuard.getRegionManager(loc.getWorld()).getApplicableRegions(loc); - StateFlag.State state = applicableRegionSet.queryState(null, DefaultFlag.MOB_SPAWNING); - - return state != StateFlag.State.DENY; - } - - return true; - } -} diff --git a/api-modules/WorldGuard/pom.xml b/api-modules/WorldGuard/pom.xml deleted file mode 100644 index d333464..0000000 --- a/api-modules/WorldGuard/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - EpicBosses - com.songoda.epicbosses - maven-version-number - ../../pom.xml - - 4.0.0 - - WorldGuard - jar - - - - org.spigotmc - spigot - 1.14.4 - provided - - - com.songoda.epicbosses - WorldGuardHelper - ${project.version} - provided - - - com.sk89q - worldedit - 7.0.0 - provided - - - com.sk89q - worldguard - 7.0.0 - provided - - - \ No newline at end of file diff --git a/api-modules/WorldGuard/src/com/songoda/epicbosses/utils/dependencies/WorldGuardHelper.java b/api-modules/WorldGuard/src/com/songoda/epicbosses/utils/dependencies/WorldGuardHelper.java deleted file mode 100644 index 728e78f..0000000 --- a/api-modules/WorldGuard/src/com/songoda/epicbosses/utils/dependencies/WorldGuardHelper.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.songoda.epicbosses.utils.dependencies; - -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.world.World; -import com.sk89q.worldguard.WorldGuard; -import com.sk89q.worldguard.protection.ApplicableRegionSet; -import com.sk89q.worldguard.protection.flags.Flags; -import com.sk89q.worldguard.protection.flags.StateFlag; -import com.sk89q.worldguard.protection.managers.RegionManager; -import com.sk89q.worldguard.protection.regions.ProtectedRegion; -import com.sk89q.worldguard.protection.regions.RegionQuery; -import com.songoda.epicbosses.utils.IWorldGuardHelper; -import org.bukkit.Bukkit; -import org.bukkit.Location; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 16-Oct-18 - */ -public class WorldGuardHelper implements IWorldGuardHelper { - - private WorldGuard worldGuard; - - @Override - public boolean isPvpAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WorldGuard.getInstance(); - } - - RegionQuery regionQuery = this.worldGuard.getPlatform().getRegionContainer().createQuery(); - ApplicableRegionSet applicableRegionSet = regionQuery.getApplicableRegions(BukkitAdapter.adapt(loc)); - StateFlag.State state = applicableRegionSet.queryState(null, Flags.PVP); - - return state != StateFlag.State.DENY; - } - - return true; - } - - @Override - public boolean isBreakAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WorldGuard.getInstance(); - } - - RegionQuery regionQuery = this.worldGuard.getPlatform().getRegionContainer().createQuery(); - ApplicableRegionSet applicableRegionSet = regionQuery.getApplicableRegions(BukkitAdapter.adapt(loc)); - StateFlag.State state = applicableRegionSet.queryState(null, Flags.BLOCK_BREAK); - - return state != StateFlag.State.DENY; - } - - return true; - } - - @Override - public boolean isExplosionsAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WorldGuard.getInstance(); - } - - RegionQuery regionQuery = this.worldGuard.getPlatform().getRegionContainer().createQuery(); - ApplicableRegionSet applicableRegionSet = regionQuery.getApplicableRegions(BukkitAdapter.adapt(loc)); - StateFlag.State state = applicableRegionSet.queryState(null, Flags.OTHER_EXPLOSION); - - return state != StateFlag.State.DENY; - } - - return true; - } - - @Override - public List getRegionNames(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if (worldGuard == null) { - this.worldGuard = WorldGuard.getInstance(); - } - - List regions = new ArrayList<>(); - List parentNames = new ArrayList<>(); - World world = BukkitAdapter.adapt(loc.getWorld()); - RegionManager regionManager = this.worldGuard.getPlatform().getRegionContainer().get(world); - - if (regionManager == null) return null; - - ApplicableRegionSet set = regionManager.getApplicableRegions(BukkitAdapter.asBlockVector(loc)); - - for (ProtectedRegion region : set) { - String id = region.getId(); - - regions.add(id); - - ProtectedRegion parent = region.getParent(); - - while (parent != null) { - parentNames.add(parent.getId()); - parent = parent.getParent(); - } - } - - for (String name : parentNames) { - regions.remove(name); - } - - return regions; - } - - return null; - } - - @Override - public boolean isMobSpawningAllowed(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WorldGuard.getInstance(); - } - - RegionQuery regionQuery = this.worldGuard.getPlatform().getRegionContainer().createQuery(); - ApplicableRegionSet applicableRegionSet = regionQuery.getApplicableRegions(BukkitAdapter.adapt(loc)); - StateFlag.State state = applicableRegionSet.queryState(null, Flags.MOB_SPAWNING); - - return state != StateFlag.State.DENY; - } - - return true; - } -} diff --git a/plugin-modules/Core/pom.xml b/plugin-modules/Core/pom.xml index b31929f..8364903 100644 --- a/plugin-modules/Core/pom.xml +++ b/plugin-modules/Core/pom.xml @@ -20,6 +20,12 @@ 1.14.4 provided + + com.songoda + SongodaCore + LATEST + compile + ${project.groupId} FactionHelper @@ -50,24 +56,6 @@ ${project.version} compile - - ${project.groupId} - WorldGuardHelper - ${project.version} - compile - - - ${project.groupId} - WorldGuard - ${project.version} - compile - - - ${project.groupId} - WorldGuard-Legacy - ${project.version} - compile - @@ -89,8 +77,8 @@ false - org.bstats - com.songoda.epicbosses.utils.bstats + com.songoda.core + com.songoda.epicbosses.core utils.factions @@ -107,24 +95,6 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/current/autospawns.json b/plugin-modules/Core/resources-json/autospawns.json similarity index 100% rename from plugin-modules/Core/resources-json/current/autospawns.json rename to plugin-modules/Core/resources-json/autospawns.json diff --git a/plugin-modules/Core/resources-json/current/bosses.json b/plugin-modules/Core/resources-json/bosses.json similarity index 100% rename from plugin-modules/Core/resources-json/current/bosses.json rename to plugin-modules/Core/resources-json/bosses.json diff --git a/plugin-modules/Core/resources-json/current/commands.json b/plugin-modules/Core/resources-json/commands.json similarity index 100% rename from plugin-modules/Core/resources-json/current/commands.json rename to plugin-modules/Core/resources-json/commands.json diff --git a/plugin-modules/Core/resources-json/current/droptables.json b/plugin-modules/Core/resources-json/droptables.json similarity index 100% rename from plugin-modules/Core/resources-json/current/droptables.json rename to plugin-modules/Core/resources-json/droptables.json diff --git a/plugin-modules/Core/resources-json/current/items.json b/plugin-modules/Core/resources-json/items.json similarity index 100% rename from plugin-modules/Core/resources-json/current/items.json rename to plugin-modules/Core/resources-json/items.json diff --git a/plugin-modules/Core/resources-json/legacy/autospawns.json b/plugin-modules/Core/resources-json/legacy/autospawns.json deleted file mode 100644 index 558c738..0000000 --- a/plugin-modules/Core/resources-json/legacy/autospawns.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "MiddleOfTheEarth": { - "editing": true, - "type": "INTERVAL", - "entities": [ - "SkeletonKing" - ], - "autoSpawnSettings": { - "shuffleEntitiesList": true, - "maxAliveAtOnce": 1, - "amountPerSpawn": 1, - "spawnWhenChunkIsntLoaded": false, - "overrideDefaultSpawnMessage": true, - "spawnMessage": "MiddleOfTheEarthSpawnMessage" - }, - "customData": { - "spawnAfterLastBossIsKilled": false, - "location": "world,0,150,0", - "placeholder": "{customBosses_1}", - "spawnRate": 30 - } - } -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/legacy/bosses.json b/plugin-modules/Core/resources-json/legacy/bosses.json deleted file mode 100644 index 872c582..0000000 --- a/plugin-modules/Core/resources-json/legacy/bosses.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "SkeletonKing": { - "spawnItem": "SKSpawnItem", - "targeting": "RandomNearby", - "editing": true, - "buyable": true, - "price": 500000.0, - "entityStats": [ - { - "mainStats": { - "position": 1, - "entityType": "SKELETON", - "health": 50, - "displayName": "&6&lSkeleton King Boss" - }, - "equipment": { - "helmet": "SKHelmet", - "chestplate": "SKChestplate", - "leggings": "SKLeggings", - "boots": "SKBoots" - }, - "hands": { - "mainHand": "SKMainHand", - "offHand": "SKOffHand" - }, - "potions": [ - { - "type": "resistance", - "level": 3, - "duration": -1 - }, - { - "type": "speed", - "level": 1, - "duration": 500 - } - ] - } - ], - "skills": { - "overallChance": 35.5, - "masterMessage": "SKMainSkillMessage", - "skills": [ - "Minions1" - ] - }, - "drops": { - "naturalDrops": false, - "dropExp": false, - "dropTable": "SkeletonTableSpray" - }, - "messages": { - "onSpawn": { - "message": "SKOnSpawn", - "radius": -1 - }, - "onDeath": { - "message": "SKOnDeath", - "positionMessage": "SKPosition", - "radius": -1, - "onlyShow": 3 - }, - "taunts": { - "delay": 60, - "radius": 100, - "taunts": [ - "SKTaunt1", - "SKTaunt2" - ] - } - }, - "commands": { - "onSpawn": "SKOnSpawn", - "onDeath": "SKOnDeath" - } - } -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/legacy/commands.json b/plugin-modules/Core/resources-json/legacy/commands.json deleted file mode 100644 index d781f61..0000000 --- a/plugin-modules/Core/resources-json/legacy/commands.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SKOnSpawn": [ - "broadcast this is a default command that is broadcasted when the Skeleton King is spawned." - ], - "SKOnDeath": [ - "broadcast this is the default command when the Skeleton King is defeated!" - ], - "SKEco500": [ - "eco give %player% 500" - ], - "SKEco2500": [ - "eco give %player% 2500" - ], - "SKEco5000": [ - "eco give %player% 5000" - ], - "Guts1": [ - "give %player% bone 3 name:&eSpecial_Bone lore:&7This_bone_was_obtained_from_the|&7skeleton_king_when_you_rattled_him." - ], - "Guts2": [ - "give %player% ironingot 1 name:&eSpecial_Ingot lore:&7This_ingot_was_obtained_from_the|&7skeleton_king_when_you_rattled_him." - ], - "Guts3": [ - "give %player% diamond 1 name:&eSpecial_Diamond lore:&7This_diamond_was_obtained_from_the|&7skeleton_king_when_you_rattled_him." - ] -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/legacy/droptables.json b/plugin-modules/Core/resources-json/legacy/droptables.json deleted file mode 100644 index 8624a8b..0000000 --- a/plugin-modules/Core/resources-json/legacy/droptables.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "SkeletonTableGive": { - "dropType": "GIVE", - "rewards": { - "giveRewards": { - "1": { - "1": { - "items": { - "SKMainHand": 15.0, - "SKOffHand": 15.0, - "SKHelmet": 15.0, - "SKLeggings": 30.0, - "SKChestplate": 30.0, - "SKBoots": 30.0 - }, - "commands": { - "SKEco500": 30.0, - "SKEco2500": 50.0, - "SKEco5000": 10.0 - }, - "maxDrops": 3, - "maxCommands": 1, - "randomDrops": true, - "randomCommands": true, - "requiredPercentage": 80.0 - }, - "2": { - "items": { - "SKCustomDrop1": 50.0 - }, - "commands": {}, - "maxDrops": 1, - "maxCommands": 0, - "randomDrops": false, - "randomCommands": false, - "requiredPercentage": 50.0 - }, - "3": { - "items": { - "SKCustomDrop1": 100.0 - }, - "commands": {}, - "maxDrops": 1, - "maxCommands": 0, - "randomDrops": false, - "randomCommands": false, - "requiredPercentage": 0.0 - } - }, - "2": { - "1": { - "items": { - "SKMainHand": 8.0, - "SKOffHand": 8.0, - "SKHelmet": 8.0, - "SKLeggings": 20.0, - "SKChestplate": 20.0, - "SKBoots": 20.0 - }, - "commands": {}, - "maxDrops": -1, - "maxCommands": 0, - "randomDrops": false, - "randomCommands": false, - "requiredPercentage": 0.0 - } - }, - "3": { - "1": { - "items": { - "SKMainHand": 5.0, - "SKOffHand": 5.0, - "SKHelmet": 5.0, - "SKLeggings": 15.0, - "SKChestplate": 15.0, - "SKBoots": 15.0 - }, - "commands": {}, - "maxDrops": -1, - "maxCommands": 0, - "randomDrops": false, - "randomCommands": false, - "requiredPercentage": 0.0 - } - }, - "4": { - "1": { - "items": { - "SKMainHand": 3.0, - "SKOffHand": 3.0, - "SKHelmet": 3.0, - "SKLeggings": 10.0, - "SKChestplate": 10.0, - "SKBoots": 10.0 - }, - "commands": {}, - "maxDrops": -1, - "maxCommands": 0, - "randomDrops": false, - "randomCommands": false, - "requiredPercentage": 0.0 - } - }, - "5": { - "1": { - "items": { - "SKMainHand": 1.0, - "SKOffHand": 1.0, - "SKHelmet": 1.0, - "SKLeggings": 5.0, - "SKChestplate": 5.0, - "SKBoots": 5.0 - }, - "commands": {}, - "maxDrops": -1, - "maxCommands": 0, - "randomDrops": false, - "randomCommands": false, - "requiredPercentage": 0.0 - } - } - } - } - }, - "SkeletonTableDrop": { - "dropType": "DROP", - "rewards": { - "dropRewards": { - "SKSpawnItem": 10.0, - "SKHelmet": 45.0, - "SKChestplate": 45.0, - "SKLeggings": 45.0, - "SKBoots": 45.0, - "SKMainHand": 30.0, - "SKOffHand": 30.0 - }, - "randomDrops": true, - "dropMaxDrops": 4 - } - }, - "SkeletonTableSpray": { - "dropType": "SPRAY", - "rewards": { - "sprayRewards": { - "SKSpawnItem": 10.0, - "SKHelmet": 45.0, - "SKChestplate": 45.0, - "SKLeggings": 45.0, - "SKBoots": 45.0, - "SKMainHand": 30.0, - "SKOffHand": 30.0 - }, - "randomSprayDrops": true, - "sprayMaxDistance": 10, - "sprayMaxDrops": 5 - } - } -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/legacy/items.json b/plugin-modules/Core/resources-json/legacy/items.json deleted file mode 100644 index be7ea63..0000000 --- a/plugin-modules/Core/resources-json/legacy/items.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "DefaultAutoSpawnListItem": { - "type": "GRASS", - "name": "&c&lDefault AutoSpawn List Item" - }, - "DefaultDropTableRewardItem": { - "type": "DIAMOND", - "name": "&c&lDefault DropTable Reward Item" - }, - "DefaultDropTableRewardsListItem": { - "type": "CHEST", - "name": "&c&lDefault DropTable Rewards List Item" - }, - "DefaultMinionMenuSpawnItem": { - "type": "MONSTER_EGG", - "name": "&c&lDefault Minion Menu Spawn Item" - }, - "DefaultTextMenuItem": { - "type": "BOOK", - "name": "&c&lDefault Text Menu Item" - }, - "DefaultBossMenuItem": { - "type": "BARRIER", - "name": "&c&lDefault Boss Menu Item" - }, - "DefaultDropTableMenuItem": { - "type": "WOOD_PLATE", - "name": "&c&lDefault Drop Table Menu Item" - }, - "DefaultCustomSkillTypeItem": { - "type": "STICK", - "name": "&c&lDefault Custom Skill Type Item" - }, - "DefaultSelectedTargetingItem": { - "type": "EMERALD_BLOCK", - "name": "&c&lDefault Selected Targeting System Item" - }, - "DefaultSelectedCustomSkillTypeItem": { - "type": "BLAZE_ROD", - "name": "&c&lDefault Selected Custom Skill Type Item" - }, - "DefaultSelectedDropTableItem": { - "type": "GOLD_PLATE", - "name": "&c&lSelected Default Drop Table Menu Item" - }, - "DefaultSkillMenuItem": { - "type": "BLAZE_POWDER", - "name": "&c&lDefault Skill Menu Item" - }, - "DefaultBossListEditorMenuItem": { - "type": "MONSTER_EGG", - "name": "&c&lDefault Boss List Editor Menu Item" - }, - "SKSpawnItem": { - "type": "MONSTER_EGG", - "durability": 51, - "name": "&6&lSkeleton King Boss Spawn Egg", - "lore": [ - "&7Right click a block to spawn", - "&7the boss as that location." - ] - }, - "SKHelmet": { - "type": "GOLD_HELMET", - "enchants": [ "protection:4", "unbreaking:3" ] - }, - "SKChestplate": { - "type": "GOLD_CHESTPLATE", - "enchants": [ "protection:4", "unbreaking:3" ] - }, - "SKLeggings": { - "type": "GOLD_LEGGINGS", - "enchants": [ "protection:4", "unbreaking:3" ] - }, - "SKBoots": { - "type": "DIAMOND_BOOTS", - "enchants": [ "protection:4", "unbreaking:3" ] - }, - "SKMainHand": { - "type": "DIAMOND_SWORD", - "enchants": [ "sharpness:4", "unbreaking:3" ] - }, - "SKOffHand": { - "type": "STICK" - }, - "SKCustomDrop1": { - "type": "STONE", - "name": "&5Skeleton King Stone", - "lore": [ - "&7This stone will bring you", - "&7great luck in battle." - ] - } -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/legacy/messages.json b/plugin-modules/Core/resources-json/legacy/messages.json deleted file mode 100644 index 84d8b34..0000000 --- a/plugin-modules/Core/resources-json/legacy/messages.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "MiddleOfTheEarthSpawnMessage": [ - "&6&lEpicBosses &8» &fA mysterious boss has just been spawned at the middle of the earth in the world &e{world} at the coordinates &e{x}, {y}, {z}&f!" - ], - "SKMainSkillMessage": [ - "&6&l{boss} &7has used the &e{skill} &7skill." - ], - "SKOnSpawn": [ - "&8&m-----*--------------------*-----", - "&7", - "&fA &e{boss} &fhas been spawned by &e{name} &fat &e{location}&f!", - "&7", - "&8&m-----*--------------------*-----" - ], - "SKOnDeath": [ - "&8&m-----*--------------------*-----", - "&7", - "&e{boss}&f has been killed,", - "&fbelow are the top damagers:", - "&7", - "{positions}", - "&7", - "&8&m-----*--------------------*-----" - ], - "SKPosition": [ - "&6&l#{pos} &e{name}&f - &e{percent}% &f(&e{dmg} dmg&f)" - ], - "SKTaunt1": [ - "&6&lSkeleton King &f» &7My pocket knife is sharper than that sword! &o*cackle*" - ], - "SKTaunt2": [ - "&6&lSkeleton King &f» &7You think you humans can defeat me?! I am the notorious Skeleton King!" - ], - "BlindMessage": [ - "&6&lSkeleton King &f» &7I curse you all with blindness!!" - ], - "GutsMessage": [ - "&6&lSkeleton King &f» &7Oh no! You rattled up my skeleton and some of my goods fell!" - ] -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/legacy/minions.json b/plugin-modules/Core/resources-json/legacy/minions.json deleted file mode 100644 index 55a6ff4..0000000 --- a/plugin-modules/Core/resources-json/legacy/minions.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "SkeletonKingMinion": { - "editing": false, - "targeting": "RandomNearby", - "entityStats": [ - { - "mainStats": { - "position": 1, - "entityType": "SKELETON", - "health": 500, - "displayName": "&6&lSkeleton King Boss Minion" - }, - "equipment": { - "helmet": "SKHelmet", - "chestplate": "SKChestplate", - "leggings": "SKLeggings", - "boots": "SKBoots" - }, - "hands": { - "mainHand": "SKMainHand", - "offHand": "SKOffHand" - }, - "potions": [ - { - "type": "resistance", - "level": 3, - "duration": -1 - }, - { - "type": "speed", - "level": 1, - "duration": 500 - } - ] - } - ] - } -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/legacy/skills.json b/plugin-modules/Core/resources-json/legacy/skills.json deleted file mode 100644 index 769596e..0000000 --- a/plugin-modules/Core/resources-json/legacy/skills.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "Blind1": { - "mode": "ALL", - "type": "POTION", - "displayName": "Blind", - "customMessage": "BlindMessage", - "radius": 10, - "customData": { - "potions": [ - { - "type": "blind", - "level": 2, - "duration": 10 - } - ] - } - }, - "Guts1": { - "mode": "ALL", - "type": "COMMAND", - "radius": 10, - "displayName": "Guts", - "customMessage": "GutsMessage", - "customData": { - "commands": [ - { - "name": "a", - "chance": 25, - "commands": [ - "Guts1", - "Guts2" - ] - }, - { - "name": "b", - "chance": 10, - "commands": [ - "Guts3" - ] - } - ] - } - }, - "Cage1": { - "mode": "ALL", - "type": "CUSTOM", - "radius": 10, - "displayName": "Cage", - "customData": { - "custom": { - "type": "CAGE", - "multiplier": 0.0, - "otherSkillData": { - "flatType": "IRON_BLOCK", - "wallType": "IRON_FENCE", - "insideType": "WATER", - "duration": 5 - } - } - } - }, - "Disarm1": { - "mode": "ONE", - "type": "CUSTOM", - "radius": 10, - "displayName": "Disarm", - "customMessage": null, - "customData": { - "custom": { - "type": "DISARM", - "multiplier": null - } - } - }, - "Fireball1": { - "mode": "RANDOM", - "type": "CUSTOM", - "radius": 10, - "displayName": "Fireball", - "customMessage": null, - "customData": { - "custom": { - "type": "FIREBALL", - "multiplier": 3.0 - } - } - }, - "Grapple1": { - "mode": "RANDOM", - "type": "CUSTOM", - "radius": 10, - "displayName": "Grapple", - "customMessage": null, - "customData": { - "custom": { - "type": "GRAPPLE", - "multiplier": 3.0 - } - } - }, - "Insidious1": { - "mode": "RANDOM", - "type": "CUSTOM", - "radius": 10, - "displayName": "Insidious", - "customMessage": null, - "customData": { - "custom": { - "type": "INSIDIOUS", - "multiplier": 2.5 - } - } - }, - "Knockback1": { - "mode": "ALL", - "type": "CUSTOM", - "radius": 10, - "displayName": "Knockback", - "customMessage": null, - "customData": { - "custom": { - "type": "KNOCKBACK", - "multiplier": 2.5 - } - } - }, - "Launch1": { - "mode": "ALL", - "type": "CUSTOM", - "radius": 10, - "displayName": "Launch", - "customMessage": null, - "customData": { - "custom": { - "type": "LAUNCH", - "multiplier": 3.0 - } - } - }, - "Lightning1": { - "mode": "ALL", - "type": "CUSTOM", - "radius": 10, - "displayName": "Lightning", - "customMessage": null, - "customData": { - "custom": { - "type": "LIGHTNING", - "multiplier": null - } - } - }, - "Minions1": { - "mode": "ALL", - "type": "CUSTOM", - "radius": 10, - "displayName": "Minions", - "customMessage": null, - "customData": { - "custom": { - "type": "MINIONS", - "multiplier": null, - "otherSkillData": { - "amount": 5, - "minionToSpawn": "SkeletonKingMinion" - } - } - } - }, - "Warp1": { - "mode": "ONE", - "type": "CUSTOM", - "radius": 10, - "displayName": "Warp", - "customMessage": null, - "customData": { - "custom": { - "type": "WARP", - "multiplier": null - } - } - }, - "Shazaam1": { - "mode": "ALL", - "type": "GROUP", - "radius": 10, - "displayName": "Shazaam", - "customMessage": "ShazaamMessage", - "customData": { - "groupedSkills": [ - "Blind1", - "Knockback1" - ] - } - } -} \ No newline at end of file diff --git a/plugin-modules/Core/resources-json/current/messages.json b/plugin-modules/Core/resources-json/messages.json similarity index 100% rename from plugin-modules/Core/resources-json/current/messages.json rename to plugin-modules/Core/resources-json/messages.json diff --git a/plugin-modules/Core/resources-json/current/minions.json b/plugin-modules/Core/resources-json/minions.json similarity index 100% rename from plugin-modules/Core/resources-json/current/minions.json rename to plugin-modules/Core/resources-json/minions.json diff --git a/plugin-modules/Core/resources-json/current/skills.json b/plugin-modules/Core/resources-json/skills.json similarity index 100% rename from plugin-modules/Core/resources-json/current/skills.json rename to plugin-modules/Core/resources-json/skills.json diff --git a/plugin-modules/Core/resources-yml/current/config.yml b/plugin-modules/Core/resources-yml/display.yml similarity index 90% rename from plugin-modules/Core/resources-yml/current/config.yml rename to plugin-modules/Core/resources-yml/display.yml index db0af25..631c034 100644 --- a/plugin-modules/Core/resources-yml/current/config.yml +++ b/plugin-modules/Core/resources-yml/display.yml @@ -1,39 +1,3 @@ -Settings: - debug: true - bossTargetRange: 50.0 - defaultNearbyRadius: 250.0 - nearbyFormat: '{name} ({distance}m)' - - BlockedWorlds: - enabled: false - worlds: - - 'world_the_end' - - 'world_nether' -Toggles: - bossShop: true - endermanTeleporting: true - potionsAffectingBoss: true -Limits: - maxNearbyRadius: 500.0 -Hooks: - ASkyBlock: - enabled: false - onOwnIsland: false - Factions: - enabled: false - useWarzoneSpawnRegion: false - HolographicDisplays: - enabled: false - StackMob: - enabled: false - WorldGuard: - enabled: true - spawnRegions: - - 'spawn_region1' - - 'spawn_region2' - blockedRegions: - - 'blocked_region1' - - 'blocked_region2' Display: Boss: Text: diff --git a/plugin-modules/Core/resources-yml/current/editor.yml b/plugin-modules/Core/resources-yml/editor.yml similarity index 99% rename from plugin-modules/Core/resources-yml/current/editor.yml rename to plugin-modules/Core/resources-yml/editor.yml index c641c0f..7d759da 100644 --- a/plugin-modules/Core/resources-yml/current/editor.yml +++ b/plugin-modules/Core/resources-yml/editor.yml @@ -956,7 +956,7 @@ TargetingPanel: - '&7' - '&7The default boss target range is' - '&f50 blocks&7. However this can be' - - '&7adjusted in the config.yml.' + - '&7adjusted in the display.yml.' '27': type: PAPER name: '&e&lGo Back' diff --git a/plugin-modules/Core/resources-yml/legacy/config.yml b/plugin-modules/Core/resources-yml/legacy/config.yml deleted file mode 100644 index db0af25..0000000 --- a/plugin-modules/Core/resources-yml/legacy/config.yml +++ /dev/null @@ -1,259 +0,0 @@ -Settings: - debug: true - bossTargetRange: 50.0 - defaultNearbyRadius: 250.0 - nearbyFormat: '{name} ({distance}m)' - - BlockedWorlds: - enabled: false - worlds: - - 'world_the_end' - - 'world_nether' -Toggles: - bossShop: true - endermanTeleporting: true - potionsAffectingBoss: true -Limits: - maxNearbyRadius: 500.0 -Hooks: - ASkyBlock: - enabled: false - onOwnIsland: false - Factions: - enabled: false - useWarzoneSpawnRegion: false - HolographicDisplays: - enabled: false - StackMob: - enabled: false - WorldGuard: - enabled: true - spawnRegions: - - 'spawn_region1' - - 'spawn_region2' - blockedRegions: - - 'blocked_region1' - - 'blocked_region2' -Display: - Boss: - Text: - menuName: '&b&l{name} Editor' - selectedName: '&bMessage: &f{name} &a&l** Selected **' - name: '&bMessage: &f{name}' - lore: - - '&fStrings within this section:' - - '{message}' - Commands: - menuName: '&b&l{name} Editor' - selectedName: '&bCommand: &f{name} &a&l** Selected **' - name: '&bCommand: &f{name}' - lore: - - '&fCommands within this section:' - - '{commands}' - Taunts: - menuName: '&b&l{name} Editor' - Drops: - name: '&bDropTable: &f{name}' - lore: - - '&3Type: &7{type}' - - '&7' - - '&7Click here to select this drop' - - '&7table as the current one.' - Equipment: - name: '{name} &a&l** Selected **' - EntityType: - menuName: '&b&l{name} Editor' - selectedName: '&f{name} Entity &a&l** Selected **' - name: '&f{name} Entity' - List: - name: '&3{position} Entity' - lore: - - '&3Left Click &8»' - - '&7Edit the {targetType} for this' - - '&7entity in the section.' - - '&7' - - '&3Right Click &8»' - - '&7Remove this section, can be done' - - '&7to anything above the first one.' - Skills: - menuName: '&b&l{name} Editor' - selectedName: '&b&l{name} Skill &a&l** Selected **' - name: '&b&l{name} Skill' - lore: - - '&3Type: &7{type}' - - '&3Display Name: &7{displayName}' - - '&3Custom Message: &7{customMessage}' - - '&3Radius: &7{radius}' - - '&7' - - '&7Click to add/remove the skill to' - - '&7or from the boss skill list.' - AutoSpawns: - Main: - menuName: '&b&lEpicBosses &3&lAutoSpawns' - name: '&bAuto Spawn: &f{name}' - lore: - - '&3Editing: &f{enabled}' - - '&7' - - '&3Spawn Type: &f{type}' - - '&3Entities: &f{entities}' - - '&7' - - '&3Max Alive: &f{maxAlive}' - - '&3Amount per Spawn: &f{amountPerSpawn}' - - '&3When Chunk Isnt Loaded: &f{chunkIsntLoaded}' - - '&3Override Spawn Messages: &f{overrideSpawnMessages}' - - '&3Shuffle Entities: &f{shuffleEntities}' - - '&3Custom Spawn Message: &f{customSpawnMessage}' - Entities: - selectedName: '&bBoss: &f{name} &a** Selected **' - name: '&bBoss: &f{name}' - lore: - - '&3Editing: &f{editing}' - - '&3Targeting: &f{targeting}' - - '&3Drop Table: &f{dropTable}' - - '&7' - - '&7Click to select or deselect this boss.' - CustomSettings: - name: '&bCustom Setting: &f{name}' - lore: - - '&3Currently: &f{currently}' - - '{extraInformation}' - SpawnMessage: - menuName: '&b&l{name} AutoSpawn' - selectedName: '&bMessage: &f{name} &a** Selected **' - name: '&bMessage: &f{name}' - lore: - - '&fStrings within this section:' - - '{message}' - Bosses: - menuName: '&b&lEpicBosses &3&lBosses' - name: '&b&l{name}' - lore: - - '&3Editing: &f{enabled}' - - '&7' - - '&3Left Click &8»' - - '&7Get spawn item for custom' - - '&7boss.' - - '&7' - - '&3Right Click &8»' - - '&7Edit the custom boss.' - DropTable: - Main: - menuName: '&b&lEpicBosses &3&lDropTables' - name: '&b&l{name} Drop Table' - lore: - - '&3Type: &7{type}' - - '&7' - - '&7Click to edit the drop table.' - RewardList: - name: '&bReward Section' - lore: - - '&3Selected Item: &f{itemName}' - - '&3Chance: &f{chance}%' - - '&7' - - '&7Click to modify this reward.' - CommandRewardList: - name: '&bReward Section' - lore: - - '&3Selected Command: &f{commandName}' - - '&3Chance: &f{chance}%' - - '&7' - - '&7Click to modify this reward.' - GivePositionList: - name: '&bReward Section' - lore: - - '&3Position: &f{position}' - - '&3Drops: &f{dropAmount}' - - '&7' - - '&7Shift Right-Click to remove.' - - '&7Left-Click to edit.' - GiveRewardsList: - name: '&bReward Section' - lore: - - '&3Position: &f{position}' - - '&3Required Percentage: &f{percentage}%' - - '&7' - - '&3Item Drops: &f{items}' - - '&3Max Drops: &f{maxDrops}' - - '&3Random Drops: &f{randomDrops}' - - '&7' - - '&3Command Drops: &f{commands}' - - '&3Max Commands: &f{maxCommands}' - - '&3Random Commands: &f{randomCommands}' - - '&7' - - '&7Shift Right-Click to remove.' - - '&7Left-Click to edit.' - Shop: - name: '&b&lBuy {name}''s Egg' - lore: - - '&3Cost: &a$&f{price}' - Skills: - Main: - menuName: '&b&lEpicBosses &3&lSkills' - name: '&b&l{name} Skill' - lore: - - '&3Type: &7{type}' - - '&3Display Name: &7{displayName}' - - '&3Custom Message: &7{customMessage}' - - '&3Radius: &7{radius}' - - '&7' - - '&7Click to edit the custom skill.' - MainEdit: - menuName: '&b&l{name} Skill Editor' - Potions: - name: '&b&l{effect} Potion Effect' - lore: - - '&3Duration: &7{duration}' - - '&3Level: &7{level}' - - '&7' - - '&7Click to remove potion effect.' - CreatePotion: - menuName: '&b&lSelect Potion Effect Type' - name: '&bEffect: &f{effect}' - selectedName: '&bEffect: &f{effect} &a&l** Selected **' - Commands: - name: '&b&lCommand Section' - lore: - - '&3Chance &8» &f{chance}%' - - '&7' - - '&3Commands &8»' - - '&f{commands}' - - '&7' - - '&7Click to edit command section.' - CommandList: - menuName: '&b&l{name} Skill Editor' - selectedName: '&bCommand: &f{name} &a&l** Selected **' - name: '&bCommand: &f{name}' - lore: - - '&fCommands within this section:' - - '{commands}' - Group: - menuName: '&b&l{name} Skill Editor' - selectedName: '&bSkill: &f{name} &a&l** Selected **' - name: '&bSkill: &f{name}' - lore: - - '&3Mode: &7{mode}' - - '&3Type: &7{type}' - - '&3Display Name: &7{displayName}' - - '&3Custom Message: &7{customMessage}' - - '&3Radius: &7{radius}' - CustomType: - selectedName: '&bCustom Skill: &f{name} &a** Selected **' - name: '&bCustom Skill: &f{name}' - lore: - - '&3Uses Multiplier: &7{multiplier}' - - '&3Has Custom Data: &7{customData}' - Material: - menuName: '&b&lSelect Material' - selectedName: '&bMaterial: &f{type} &a** Selected **' - name: '&bMaterial: &f{type}' - MinionList: - menuName: '&b&lSelect Minion For Skill' - selectedName: '&bMinion: &f{name} &a** Selected **' - name: '&bMinion: &f{name}' - lore: - - '&3Editing: &7{editing}' - - '&3Targeting: &7{targeting}' - CustomSetting: - name: '&bSetting: &f{setting}' - lore: - - '&3Currently: &7{currently}' \ No newline at end of file diff --git a/plugin-modules/Core/resources-yml/legacy/editor.yml b/plugin-modules/Core/resources-yml/legacy/editor.yml deleted file mode 100644 index 50073ff..0000000 --- a/plugin-modules/Core/resources-yml/legacy/editor.yml +++ /dev/null @@ -1,2984 +0,0 @@ -# MainPanel: # panel name # -# name: '&b&l{boss} Editor' # panel display name # -# slots: 45 # panel size # -# Settings: # settings section # -# emptySpaceFiller: true # fill in empty space # -# fillTo: 0 # fill to slot # -# backButton: false # use back button # -# exitButton: false # use exit button # -# EmptySpaceFiller: # empty space filler itemstack # -# type: '160:0' # empty space filler type # -# name: '&7' # empty space filler name # -# Buttons: # buttons section # -# backButton: 9 # back button slot # -# exitButton: 9 # exit button slot # -MainMenu: - name: '&b&lEpicBosses' - slots: 18 - Settings: - emptySpaceFiller: true - EmptySpaceFiller: - type: STAINED_GLASS_PANE - name: '&7' - Items: - '2': - type: '383:54' - name: '&b&lCustom Bosses' - lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7custom bosses.' - - '&7' - - '&3Right Click »' - - '&7Create a new custom boss from' - - '&7scratch.' - Button: CustomBosses - '5': - type: DIAMOND - name: '&b&lCustom Items' - lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7custom items.' - - '&7' - - '&3Right Click »' - - '&7Create a new custom item from' - - '&7an item in your inventory.' - Button: CustomItems - '8': - type: '347:0' - name: '&b&lAuto Spawns' - lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7auto spawns.' - - '&7' - - '&3Right Click »' - - '&7Create a new auto spawn from' - - '&7scratch.' - Button: AutoSpawns - '12': - type: WOOD_PLATE - name: '&b&lDrop Tables' - lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7drop tables.' - - '&7' - - '&3Right Click »' - - '&7Create a new drop table from' - - '&7scratch.' - Button: DropTables - '16': - type: BLAZE_POWDER - name: '&b&lCustom Skills' - lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7custom skills.' - - '&7' - - '&3Right Click »' - - '&7Create a new custom skill from' - - '&7scratch.' - Button: CustomSkills -ShopListPanel: - name: '&b&lEpicBosses &3&lShop' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 50 - Items: - '46': - type: THIN_GLASS - name: '&7' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page.' - PreviousPage: true - '50': - type: THIN_GLASS - name: '&7' - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: THIN_GLASS - name: '&7' -ListPanel: - name: '{panelName}' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 50 - Items: - '46': - type: THIN_GLASS - name: '&7' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page.' - PreviousPage: true - '50': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back.' - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: THIN_GLASS - name: '&7' -CustomItemsMenu: - name: '&b&lEpicBosses &3&lCustom Items' - slots: 54 - Settings: - fillTo: 45 - Items: - '46': - type: BOOK - name: '&c&lCustom Items Guide' - lore: - - '&7In this menu you can view all the' - - '&7custom items for the plugin, as well' - - '&7as manipulate them to your liking.' - - '&7' - - '&3Left Click &8»' - - '&7Obtain ItemStack in your inventory.' - - '&7' - - '&3Middle Click &8» ' - - '&7Clone ItemStack section to a new section.' - - '&7' - - '&3Right Click &8» ' - - '&7Remove section from list if not bound.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of custom drops.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Item' - lore: - - '&7Click here to add a new' - - '&7item which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of custom drops.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: THIN_GLASS - name: '&7' -AddItemsMenu: - name: '&b&lAdd Item Menu' - slots: 27 - Settings: - emptySpaceFiller: true - EmptySpaceFiller: - name: '&7' - type: '160:3' - Items: - '11': - type: REDSTONE - name: '&c&lCancel' - lore: - - '&7Click here to cancel the transaction' - - '&7of adding the item to the EpicBosses' - - '&7database.' - Button: Cancel - '14': - type: AIR - Button: SelectedSlot - '17': - type: '351:10' - name: '&a&lAccept' - lore: - - '&7Click here to accept the transaction' - - '&7of adding the item to the EpicBosses' - - '&7database.' - Button: Accept -MainEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Items: - '12': - type: DIAMOND - name: '&a&lDrops Manager' - lore: - - '&7Click here to manage the drop table' - - '&7that is attached to this boss.' - Button: Drops - '14': - type: DIAMOND_HELMET - name: '&c&lEquipment Manager' - lore: - - '&7Click here to manage the equipment' - - '&7that the boss has equipped.' - Button: Equipment - '16': - type: BONE - name: '&a&lTargeting Manager' - lore: - - '&7Click here to edit how the boss handles' - - '&7targeting of players and mobs.' - Button: Targeting - '22': - type: BOW - name: '&c&lWeapon Manager' - lore: - - '&7Click here to manage the weapon(s)' - - '&7that the boss has equipped.' - Button: Weapon - '23': - type: BARRIER - name: '&c&l!&4&l!&c&l! &4&lWARNING &c&l!&4&l!&c&l!' - lore: - - '&7While editing is enabled for this boss' - - '&7no one will be able to spawn it, nor' - - '&7will it spawn naturally.' - '24': - type: '377:0' - name: '&c&lSkill Manager' - lore: - - '&7Click here to manage the assigned' - - '&7skill(s) the boss has and their occurrence' - - '&7chances.' - Button: Skill - '30': - type: STICK - name: '&a&lSpawn Item Manager' - lore: - - '&bCurrently: &f{spawnItem}' - - '&7' - - '&7Click here to select a spawn item for this' - - '&7boss section from all the current items saved' - - '&7in the plugin.' - Button: SpawnItem - '32': - type: '351:4' - name: '&a&lStatistics Manager' - lore: - - '&7Click here to edit the statistics of the' - - '&7boss, including things like: health,' - - '&7potion effects, commands on spawn, etc.' - Button: Stats - '34': - type: GOLD_BLOCK - name: '&a&lShop Manager' - lore: - - '&7Click here to modify the shop settings for' - - '&7this boss.' - Button: Shop - '39': - type: BOOK - name: '&a&lCommand Manager' - lore: - - '&7Click here to manage the commands that are' - - '&7called when the boss spawns, dies, etc.' - Button: Command - '41': - type: LEVER - name: '&a&lToggle Boss Editing' - lore: - - '&7Click here to edit how to toggle the boss' - - '&7editing mode.' - - '&7' - - '&bCurrently: &f{mode}' - Button: Editing - '43': - type: BOOK - name: '&a&lText Manager' - lore: - - '&7Click here to edit the taunts, sayings,' - - '&7etc. for this boss.' - Button: Text -BossShopEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - Buttons: - backButton: 5 - Items: - '3': - type: '289:0' - name: '&3&lBuyable' - lore: - - '&bCurrently: &f{buyable}' - - '&7' - - '&7If this is set to true then this' - - '&7boss spawn egg will be spawnable from' - - '&7the /boss shop while boss editing is' - - '&7disabled.' - Button: Buyable - '5': - type: REDSTONE - name: '&c&lGo Back' - lore: - - '&7Click here to go back to the' - - '&7main boss editor panel.' - '7': - type: GOLD_INGOT - name: '&3&lPrice' - lore: - - '&bCurrently: &a$&f{price}' - - '&7' - - '&7This is the price that the boss will' - - '&7be sold for in the /boss shop menu' - - '&7' - - '&7Click here to adjust the price.' - Button: Price -SpawnItemEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - backButton: true - Buttons: - backButton: 54 - Items: - '46': - type: DIAMOND - name: '&c&lRemove' - lore: - - '&7click here to remove the currently' - - '&7equipped spawn item.' - Button: Remove - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of spawn item.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Spawn Item' - lore: - - '&7Click here to add a new spawn' - - '&7item which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of spawn item.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -DropsMainEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '1': - type: BOOK - name: '&c&lDrops Guide' - lore: - - '&7Here you can configure the drop systems' - - '&7the boss has when he dies.' - '4': - type: '289:0' - name: '&e&lNatural Drops' - lore: - - '&bCurrently: &f{naturalDrops}' - - '&7' - - '&7Click to toggle the natural drops' - - '&7for this boss.' - Button: NaturalDrops - '5': - type: BOOK - name: '&e&lDrop Table' - lore: - - '&bCurrently: &f{dropTable}' - - '&7Click here to change the drop table' - - '&7assigned to this boss.' - Button: DropTable - '6': - type: REDSTONE - name: '&e&lNatural EXP' - lore: - - '&bCurrently: &f{naturalExp}' - - '&7' - - '&7Click to toggle the natural drop' - - '&7of exp for this boss.' - Button: NaturalEXP - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -DropsEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - Items: - '46': - type: DIAMOND - name: '&b&lSelected Drop Table' - lore: - - '&7The current selected drop' - - '&7table is: &b{dropTable}&7.' - - '&7' - - '&b&lHints' - - '&b&l* &7If this shows N/A it means' - - '&7 there was an issue loading the' - - '&7 previous table, or it doesn''t' - - '&7 have one selected.' - - '&b&l* &7Click here to go straight to the' - - '&7 editing screen of the drop table.' - Button: Selected - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of drop tables.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lCreate a new Drop Table' - lore: - - '&7Click here to create a new drop' - - '&7table. It will automatically be' - - '&7assigned to this boss when created.' - Button: CreateDropTable - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of drop tables.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: BOOK - name: '&c&lDrops Guide' - lore: - - '&7When selecting the drop table for this custom boss' - - '&7you can either choose from one of the above listed' - - '&7pre-configured drop tables or you can make a' - - '&7new one for this boss.' - - '&7' - - '&c&lHints' - - '&c&l* &7The currently selected drop table will be shown' - - '&7 with an emerald which states so.' - - '&c&l* &7Every drop table from every boss will be listed' - - '&7 here as an available drop table.' -BossListEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: '160:0' - name: '&7' - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: '160:0' - name: '&7' - '50': - type: DIAMOND_BLOCK - name: '&a&lCreate a new Entity' - lore: - - '&7Click here to create a new entity' - - '&7within this boss.' - Button: CreateEntity - '51': - type: '160:0' - name: '&7' - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -EquipmentEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 8 - Items: - '2': - type: DIAMOND_HELMET - name: '&c&lHelmet' - lore: - - '&7Click here to change the' - - '&7helmet for the &f{name}' - - '&7or add one from your' - - '&7inventory.' - Button: Helmet - '3': - type: DIAMOND_CHESTPLATE - name: '&c&lChestplate' - lore: - - '&7Click here to change the' - - '&7chestplate for the &f{name}' - - '&7or add one from your' - - '&7inventory.' - Button: Chestplate - '4': - type: DIAMOND_LEGGINGS - name: '&c&lLeggings' - lore: - - '&7Click here to change the' - - '&7leggings for the &f{name}' - - '&7or add one from your' - - '&7inventory.' - Button: Leggings - '5': - type: DIAMOND_BOOTS - name: '&c&lBoots' - lore: - - '&7Click here to change the' - - '&7boots for the &f{name}' - - '&7or add one from your' - - '&7inventory.' - Button: Boots - '8': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' - '9': - type: BOOK - name: '&c&lEquipment Guide' - lore: - - '&7here you can choose what equipment' - - '&7this boss has. To choose simply click' - - '&7the desired piece, then click one of' - - '&7the preset pieces or click the diamond' - - '&7block to add a new piece from your' - - '&7inventory.' -HelmetEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - backButton: true - Buttons: - backButton: 54 - Items: - '46': - type: DIAMOND - name: '&c&lRemove' - lore: - - '&7click here to remove the' - - '&7currently equipped helmet.' - Button: Remove - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of helmets.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Helmet' - lore: - - '&7Click here to add a new' - - '&7helmet which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of helmets.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -ChestplateEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - backButton: true - Buttons: - backButton: 54 - Items: - '46': - type: DIAMOND - name: '&c&lRemove' - lore: - - '&7click here to remove the' - - '&7currently equipped chestplate.' - Button: Remove - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of chestplates.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Chestplate' - lore: - - '&7Click here to add a new' - - '&7chestplate which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of chestplates.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -LeggingsEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - backButton: true - Buttons: - backButton: 54 - Items: - '46': - type: DIAMOND - name: '&c&lRemove' - lore: - - '&7click here to remove the' - - '&7currently equipped {type}.' - Button: Remove - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of leggings.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Leggings' - lore: - - '&7Click here to add a new' - - '&7leggings which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of leggings.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -BootsEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - backButton: true - Buttons: - backButton: 54 - Items: - '46': - type: DIAMOND - name: '&c&lRemove' - lore: - - '&7click here to remove the' - - '&7currently equipped {type}.' - Button: Remove - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of boots.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Boots' - lore: - - '&7Click here to add a new' - - '&7boots which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of boots.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -TargetingPanel: - name: '&b&l{name} Editor' - slots: 27 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 27 - Items: - '5': - type: REDSTONE_BLOCK - name: '&e&lNot Damaged Nearby' - lore: - - '&7This target system will target' - - '&7anyone who is nearby and hasn''t' - - '&7attacked the boss. If there is' - - '&7no one nearby who hasn''t attacked' - - '&7the boss then it will choose a random' - - '&7entity/player.' - TargetingSystem: NotDamagedNearby - '13': - type: REDSTONE_BLOCK - name: '&e&lClosest' - lore: - - '&7This target system will' - - '&7target the closest player' - - '&7to the boss.' - TargetingSystem: Closest - '14': - type: REDSTONE_BLOCK - name: '&e&lRandom Nearby' - lore: - - '&7This target system will' - - '&7target a random target who is' - - '&7within reach of the boss.' - TargetingSystem: RandomNearby - '15': - type: REDSTONE_BLOCK - name: '&e&lTop Damager' - lore: - - '&7This target system will' - - '&7target the player who has' - - '&7the most damage that is' - - '&7nearby.' - TargetingSystem: TopDamager - '19': - type: ARROW - name: '&b&lSelected' - lore: - - '&7You have currently got &f{selected}' - - '&7as your targeting system.' - '23': - type: BOOK - name: '&c&lTargeting Guide' - lore: - - '&7Here you can choose how' - - '&7the boss handles targeting' - - '&7of players.' - - '&7' - - '&7The default boss target range is' - - '&f50 blocks&7. However this can be' - - '&7adjusted in the config.yml.' - '27': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -WeaponEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '1': - type: BOOK - name: '&c&lWeapons Guide' - lore: - - '&7here you can choose what weapons' - - '&7this boss has. To choose simply click' - - '&7the desired hand, then click one of' - - '&7the preset weapons or click the diamond' - - '&7block to add a new weapon from your' - - '&7inventory.' - '4': - type: DIAMOND_SWORD - name: '&c&lMain Hand' - lore: - - '&7Click here to modify the' - - '&7main hand for the &f{name}&7.' - Button: MainHand - '6': - type: STICK - name: '&c&lOff Hand' - lore: - - '&7Click here to modify the' - - '&7off hand for the &f{name}&7.' - Button: OffHand - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -MainHandEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - backButton: true - Buttons: - backButton: 54 - Items: - '46': - type: DIAMOND - name: '&c&lRemove' - lore: - - '&7click here to remove the' - - '&7currently equipped main hand.' - Button: Remove - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of weapons.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Weapon' - lore: - - '&7Click here to add a new' - - '&7weapon which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of weapons.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -OffHandEditorPanel: - name: '&b&l{name} Editor' - slots: 54 - Settings: - fillTo: 45 - backButton: true - Buttons: - backButton: 54 - Items: - '46': - type: DIAMOND - name: '&c&lRemove' - lore: - - '&7click here to remove the' - - '&7currently equipped off hand.' - Button: Remove - '47': - type: '160:0' - name: '&7' - '48': - type: '160:0' - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of weapons.' - PreviousPage: true - '50': - type: DIAMOND_BLOCK - name: '&a&lAdd New Weapon' - lore: - - '&7Click here to add a new' - - '&7weapon which you have in your' - - '&7inventory.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of weapons.' - NextPage: true - '52': - type: '160:0' - name: '&7' - '53': - type: '160:0' - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -SkillMainEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '1': - type: BOOK - name: '&c&lSkill Guide' - lore: - - '&7Here you can configure the way the' - - '&7skill system handles for this boss.' - - '&7You can configure the overall chance,' - - '&7skill message and the list of skills' - - '&7that is assigned to this boss.' - '4': - type: '348:0' - name: '&e&lOverall Chance' - lore: - - '&7The current overall chance for' - - '&7skills to be procced each hit is' - - '&f{chance}%&7.' - - '&7' - - '&bLeft Click &8» &f+1.0' - - '&bShift Left-Click &8» &f+0.1' - - '&7' - - '&bRight Click &8» &f-1.0' - - '&bShift Right-Click &8» &f-0.1' - Button: OverallChance - '5': - type: BOOK - name: '&e&lSkills List' - lore: - - '&7Click here to select which skills' - - '&7are currently selected for this boss.' - Button: SkillList - '6': - type: PAPER - name: '&e&lMaster Message' - lore: - - '&7Click here to modify the' - - '&7master message for when a' - - '&7skill is proced. If the' - - '&7specific skill has got a' - - '&7customMessage dedicated' - - '&7to it, this message will' - - '&7be ignored.' - Button: Message - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -StatisticsMainEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '1': - type: BOOK - name: '&c&lStatistics Guide' - lore: - - '&7Here you can configure the way the' - - '&7skill system handles for this boss.' - - '&7You can configure the overall chance,' - - '&7skill message and the list of skills' - - '&7that is assigned to this boss.' - '4': - type: NAME_TAG - name: '&e&lChange the Display Name' - lore: - - '&7Here you can change the display name' - - '&7of the entity. It is currently:' - - '&f{displayName}' - - '&7' - - '&7When u click this it will close the' - - '&7GUI and suggest you to enter the new' - - '&7display name in chat.' - Button: DisplayName - '5': - type: '383:55' - name: '&e&lChange the Entity Type' - lore: - - '&7This will open a GUI and you can select' - - '&7your new entity type.' - Button: EntityType - '6': - type: REDSTONE - name: '&e&lChange the Health' - lore: - - '&7The current health for this entity' - - '&7is &c{health}' - - '&7' - - '&bLeft Click &8» &f+1.0' - - '&bShift Left-Click &8» &f+0.1' - - '&7' - - '&bRight Click &8» &f-1.0' - - '&bShift Right-Click &8» &f-0.1' - Button: Health - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -CommandsEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '1': - type: BOOK - name: '&c&lCommands Guide' - lore: - - '&7Here you can configure which command set' - - '&7the boss has for specific events.' - '4': - type: LONG_GRASS - name: '&e&lOn Spawn' - lore: - - '&7Here you can change the command for' - - '&7the spawn of the boss.' - - '&7' - - '&fCurrently Selected: &7{onSpawn}' - Button: OnSpawn - '6': - type: REDSTONE - name: '&e&lOn Death' - lore: - - '&7Here you can change the command' - - '&7the death of the boss.' - - '&7' - - '&fCurrently Selected: &7{onDeath}' - Button: OnDeath - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -TextEditorMainPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '1': - type: BOOK - name: '&c&lText Guide' - lore: - - '&7Here you can configure which command set' - - '&7the boss has for specific events.' - '4': - type: LONG_GRASS - name: '&e&lOn Spawn' - lore: - - '&7Here you can change the settings for' - - '&7the spawn messages of the boss.' - Button: OnSpawn - '5': - type: REDSTONE_TORCH - name: '&e&lTaunts' - lore: - - '&7Here you can adjust the settings for' - - '&7the taunts of the boss.' - Button: Taunts - '6': - type: REDSTONE - name: '&e&lOn Death' - lore: - - '&7Here you can change the settings for' - - '&7the death messages of the boss.' - Button: OnDeath - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -DeathTextEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 5 - Items: - '2': - type: LONG_GRASS - name: '&e&lMain Message' - lore: - - '&7Here you can change the main message that is' - - '&7currently selected.' - - '&7' - - '&bCurrent: &f{mainMessage}' - Button: MainMessage - '3': - type: '397:3' - name: '&e&lPosition Message' - lore: - - '&7Here you can change the position message that is' - - '&7currently selected.' - - '&7' - - '&bCurrent: &f{positionMessage}' - - '&7' - - '&7The position message is a message that is' - - '&7injected in to the main message to display' - - '&7the positions, damage and percentage of damage' - - '&7that the selected amount of people did to' - - '&7the boss.' - Button: PositionMessage - '5': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' - '7': - type: REDSTONE_BLOCK - name: '&e&lOnly Show' - lore: - - '&7Here you can change the amount of damaging' - - '&7users it will display on the main message' - - '&7with the position message injection.' - - '&7Currently it will show the top &f{onlyShow}' - - '&7players on the death message.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' - Button: OnlyShow - '8': - type: REDSTONE - name: '&e&lRadius' - lore: - - '&7Here you can change the radius for' - - '&7this message. It is currently: &f{radius}' - - '&7blocks. Set it to &f-1&7 if you want it' - - '&7to be a server-wide broadcast.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: Radius -SpawnTextEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 5 - Items: - '2': - type: LONG_GRASS - name: '&e&lSelect Message' - lore: - - '&7Here you can change the message that is' - - '&7currently selected.' - - '&7' - - '&bCurrent: &f{selected}' - Button: Select - '5': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' - '8': - type: REDSTONE - name: '&e&lRadius' - lore: - - '&7Here you can change the radius for' - - '&7this message. It is currently: &f{radius}' - - '&7blocks. Set it to &f-1&7 if you want it' - - '&7to be a server-wide broadcast.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: Radius -TauntEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '3': - type: REDSTONE - name: '&e&lRadius' - lore: - - '&7Here you can change the radius that players' - - '&7will see the taunts in. It is currently: &f{radius}' - - '&7blocks. Set it to &f-1&7 if you want it' - - '&7to be a server-wide broadcast.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: Radius - '5': - type: BOOK - name: '&e&lTaunts' - lore: - - '&7Here you can select the taunts that the boss' - - '&7will say while he is active. If this list is' - - '&7empty he won''t say anything.' - - '&7' - - '&bCurrently Selected:' - - '&f{taunts}' - Button: Taunts - '7': - type: '347:0' - name: '&e&lDelay' - lore: - - '&7Here you can change the delay between each' - - '&7taunt that the boss says. The delay is' - - '&7currently set to &f{delay}s&7. This time is in' - - '&7seconds. Once the boss has gone through the' - - '&7list of taunts he will start again at the' - - '&7beginning until he''s dead.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: Delay - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -SkillEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 18 - Settings: - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Items: - '2': - type: BOOK - name: '&e&lCustom Message' - lore: - - '&7Click here to change the custom message' - - '&7assigned to the skill. This will override' - - '&7the master message assigned to the boss when' - - '&7this skill is called.' - - '&7' - - '&bCurrently: &f{customMessage}' - - '&7' - - '&7To remove this message simply right click' - - '&7and it will then remove this and go back' - - '&7to using the master message assigned to the' - - '&7boss.' - Button: CustomMessage - '3': - type: REDSTONE - name: '&e&lRadius' - lore: - - '&7Here you can change the radius that the skill' - - '&7will see be called to within. It is currently' - - '&7set to &f{radius} blocks.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: Radius - '5': - type: DIAMOND - name: '&e&lCustom Data' - lore: - - '&7Click here to edit the custom data related' - - '&7to this skill. If it is a Potion skill you' - - '&7can modify the potions, etc. etc.' - Button: CustomData - '7': - type: TORCH - name: '&e&lMode' - lore: - - '&bCurrently: &f{mode}' - - '&7' - - '&7Click here to change the mode of the custom' - - '&7skill. It will cycle between all different' - - '&7types so when you find the right mode you can' - - '&7leave it and it will automatically save to' - - '&7that mode.' - Button: Mode - '8': - type: PAPER - name: '&e&lDisplay Name' - lore: - - '&bCurrently: &f{displayName}' - - '&7' - - '&7This is the skill display name. It is used' - - '&7in many things, from the in-game display of' - - '&7the skill, to the debug messages. So make' - - '&7sure it stands out and is unique, or not.' - Button: DisplayName - '14': - type: '289:0' - name: '&e&lType' - lore: - - '&bCurrently: &f{type}' - - '&7Click this to change the skill type. Keep' - - '&7in mind that when you change your skill' - - '&7type the previous custom data will be erased' - - '&7to make room for the new custom data.' - Button: Type -SkillTypeEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 5 - Items: - '2': - type: BOOK - name: '&e&lCommand Skill Type' - lore: - - '&7If you set this to the skill type' - - '&7then you will be able to set commands' - - '&7to be applied to the targeted players' - - '&7when this skill is called.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' - Button: Command - '3': - type: EMERALD - name: '&e&lCustom Skill Type' - lore: - - '&7If you want to use a custom skill for' - - '&7this skill, select this skill type then' - - '&7in your custom data configuration you' - - '&7can select which custom skill it is' - - '&7assigned to.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' - Button: Custom - '5': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' - '7': - type: '373:16453' - name: '&e&lPotion Skill Type' - lore: - - '&7If you want to apply potions to' - - '&7the targeted players when this skill is' - - '&7called you can use this skill type.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' - Button: Potion - '8': - type: '397:4' - name: '&e&lGroup Skill Type' - lore: - - '&7If you want to have multiple skills under' - - '&7one skill select this skill type and you' - - '&7can connect it to some of the already existing' - - '&7skills so you can have more then one go off' - - '&7from one skill calling. Only this displayName' - - '&7and customMessage will be used, the connected' - - '&7skill displayName and customMessage will be' - - '&7ignored.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' - Button: Group -PotionSkillEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&e&lPotion Guide' - lore: - - '&7Here you can adjust the potion effects' - - '&7that are applied when the skill is' - - '&7called. If you want to remove a potion' - - '&7effect simply click on the potion and' - - '&7it will removed from the skill. If you' - - '&7want to add a new potion effect click' - - '&7on the green emerald block.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of custom potion effects.' - PreviousPage: true - '50': - type: EMERALD_BLOCK - name: '&e&lCreate a new Potion Effect' - lore: - - '&7Click here to create a new potion' - - '&7effect.' - Button: PotionEffect - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of custom potion effects.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -CreatePotionEffectEditorPanel: - name: '&b&lCreate Potion Effect' - slots: 9 - Settings: - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Items: - '1': - type: GRAY_DYE - name: '&c&lCancel Potion Effect' - lore: - - '&7Click here to cancel the creation' - - '&7of this potion effect.' - Button: Cancel - '4': - type: EMERALD - name: '&e&lLevel' - lore: - - '&bCurrently: &f{level}' - - '&7' - - '&7Click here to change the level' - - '&7of the potion effect.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' - Button: Level - '5': - type: '289:0' - name: '&e&lPotion Effect Type' - lore: - - '&bCurrently: &f{effect}' - - '&7' - - '&7Click here to change the potion' - - '&7effect type.' - Button: Effect - '6': - type: '347:0' - name: '&e&lDuration' - lore: - - '&bCurrently: &f{duration}s' - - '&7' - - '&7Click here to change the duration' - - '&7of the potion effect.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: Duration - '9': - type: '351:10' - name: '&b&lConfirm' - lore: - - '&7Click here to confirm the creation' - - '&7of the potion effect with data:' - - '&7' - - '&bDuration: &f{duration}s' - - '&bEffect: &f{effect}' - - '&bLevel: &f{level}' - Button: Confirm -CommandSkillEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&e&lCommand Guide' - lore: - - '&7Here you can adjust the commands that' - - '&7are applied when the skill is called.' - - '&7If you want to remove a command section' - - '&7simply just shift left click the section' - - '&7and it will be deleted.' - - '&7To create a new section click the green' - - '&7emerald block at the bottom middle of the' - - '&7GUI.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of command sections.' - PreviousPage: true - '50': - type: EMERALD_BLOCK - name: '&e&lAdd a new Command Section' - lore: - - '&7Click here to add a new command section' - - '&7to the list.' - Button: AddNew - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of command sections.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -ModifyCommandEditorPanel: - name: '&b&lCommand Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 5 - Items: - '3': - type: BOOK - name: '&e&lCommands' - lore: - - '&fCurrently selected commands:' - - '&7{commands}' - Button: Commands - '5': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' - '7': - type: '289:0' - name: '&e&lChance' - lore: - - '&bCurrently: &f{chance}%' - - '&7' - - '&7Click here to modify the chance' - - '&7value for this boss.' - - '&7' - - '&bLeft Click &8» &f+1.0%' - - '&bShift Left-Click &8» &f+0.1%' - - '&7' - - '&bRight Click &8» &f-1.0%' - - '&bShift Right-Click &8» &f-0.1%' - Button: Chance -CustomSkillEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '4': - type: BOOK - name: '&e&lCustom Skill Type' - lore: - - '&bCurrently: &f{type}' - - '&7' - - '&7Click here to choose from one' - - '&7of the connected and set up' - - '&7custom skill types. This will' - - '&7also display any of the external' - - '&7custom skill types that are properly' - - '&7connected to the plugin.' - Button: Type - '5': - type: DIAMOND - name: '&e&lSpecial Settings' - lore: - - '&7Click here to edit any special settings that' - - '&7are also included in this custom skill. If' - - '&7there is none then this button will not open' - - '&7another GUI.' - Button: SpecialSettings - '6': - type: REDSTONE - name: '&e&lMultiplier' - lore: - - '&bCurrently: &f{multiplier}' - - '&7' - - '&7Click here to adjust the multiplier' - - '&7for the custom skill. Some skills will' - - '&7use this option, but some won''t. This' - - '&7custom skill &f{usesMultiplier}&7 use' - - '&7multiplier option.' - - '&7' - - '&bLeft Click &8» &f+1.0' - - '&bShift Left-Click &8» &f+0.1' - - '&7' - - '&bMiddle Click &8» &7Removes multiplier' - - '&7' - - '&bRight Click &8» &f-1.0' - - '&bShift Right-Click &8» &f-0.1' - Button: Multiplier - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -CustomSkillTypeEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&c&lSkill Type Guide' - lore: - - '&7When selecting the custom skill type' - - '&7it is easiest to know what it is if' - - '&7you keep it related to the name of the' - - '&7skill. All you need to change the type' - - '&7is click on a new type from within this' - - '&7menu.' - - '&7' - - '&7To import new custom skill types you' - - '&7can get them custom made and injected' - - '&7in to the plugin or you can suggest them' - - '&7to be added in to the plugin.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of custom skill types.' - PreviousPage: true - '50': - type: EMERALD_BLOCK - name: '&b&lSelected Custom Skill Type' - lore: - - '&bCurrently: &f{selected}' - - '&7' - - '&7This is the currently assigned' - - '&7custom skill type to the skill.' - - '&7If you would like to change this' - - '&7simply click another one in this' - - '&7menu.' - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of custom skill types.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the skill editor panel to configure' - - '&7the general skill options.' -SpecialSettingsEditorPanel: - name: '&b&l{name} Special Settings' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&c&lSpecial Settings Guide' - lore: - - '&7Here any special settings that have' - - '&7been assigned to a skill type will' - - '&7show up. If this GUI is empty then there' - - '&7is no special settings related to the' - - '&7skill.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of special settings.' - PreviousPage: true - '50': - type: EMERALD_BLOCK - name: '&b&lSelected Custom Skill Type' - lore: - - '&bCurrently: &f{selected}' - - '&7' - - '&7This is the currently assigned' - - '&7custom skill type to the skill.' - - '&7If you would like to change this' - - '&7simply click another one in the' - - '&7skill type menu.' - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of special settings.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the skill editor panel to configure' - - '&7the general skill options.' -DropTableMainEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - emptySpaceFiller: true - backButton: true - Buttons: - backButton: 9 - EmptySpaceFiller: - type: '160:0' - name: '&7' - Items: - '1': - type: BOOK - name: '&c&lDrop Table Guide' - lore: - - '&7Here you are able to configure' - - '&7each aspect of the drop table to' - - '&7your liking. Remember that the moment' - - '&7something changes then it will also' - - '&7change for any live bosses.' - '4': - type: '289:0' - name: '&e&lType' - lore: - - '&bCurrently: &f{type}' - - '&7Click this to change the drop table type. Keep' - - '&7in mind that when you change your drop table' - - '&7type the previous table data will be erased' - - '&7to make room for the new table format.' - Button: Type - '6': - type: DIAMOND - name: '&e&lRewards' - lore: - - '&7Click here to edit the rewards related to' - - '&7this drop table. The menu that appears will' - - '&7be relevant to the drop table type.' - Button: Rewards - '9': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the drop table list page.' -DropTableTypeEditorPanel: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '3': - type: '373:16453' - name: '&e&lSpray Drop Table Type' - lore: - - '&7If you set this to the drop table type' - - '&7then you will be able to set rewards that' - - '&7will be sprayed out from the bosses' - - '&7location in to random locations around him.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom reward data.' - Button: Spray - '5': - type: HOPPER - name: '&e&lDrop Drop Table Type' - lore: - - '&7If you set this to the drop table type' - - '&7then you will be able to set rewards that' - - '&7will be drop on the bosses death location' - - '&7for players to loot.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom reward data.' - Button: Drop - '7': - type: EMERALD - name: '&e&lGive Drop Table Type' - lore: - - '&7If you set this to the drop table type' - - '&7then you will be able to set rewards that' - - '&7will be given to the specified damaging' - - '&7positions on the boss damage map.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom reward data.' - Button: Give - '9': - type: PAPER - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -SprayDropTableMainEditMenu: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 5 - Items: - '2': - type: DIAMOND - name: '&e&lRewards' - lore: - - '&7Click here to modify the rewards and their' - - '&7assigned drop chances. You can add more by' - - '&7clicking the emerald block at the middle' - - '&7bottom of the rewards menu.' - Button: Rewards - '3': - type: '289:0' - name: '&e&lRandom Drops' - lore: - - '&bCurrently: &f{randomDrops}' - - '&7Click here to toggle the random drop mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7drop table is called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7drop table is called it will go from top to' - - '&7bottom through the list.' - Button: RandomDrops - '5': - type: REDSTONE - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' - '7': - type: PAPER - name: '&e&lMax Distance' - lore: - - '&bCurrently: &f{maxDistance}' - - '&7Click here to modify the maximum distance' - - '&7an item can be thrown from the bosses death' - - '&7location when the drop table is called.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: MaxDistance - '8': - type: EMERALD - name: '&e&lMax Drops' - lore: - - '&bCurrently: &f{maxDrops}' - - '&7Click here to modify the maximum amount of' - - '&7drops this drop table can have. Keep in mind' - - '&7that when getting drops the drop table will' - - '&7only cycle through the list once. Not until' - - '&7this amount of drops has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: MaxDrops -DropDropTableMainEditMenu: - name: '&b&l{name} Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '3': - type: DIAMOND - name: '&e&lRewards' - lore: - - '&7Click here to modify the rewards and their' - - '&7assigned drop chances. You can add more by' - - '&7clicking the emerald block at the middle' - - '&7bottom of the rewards menu.' - Button: Rewards - '4': - type: '289:0' - name: '&e&lRandom Drops' - lore: - - '&bCurrently: &f{randomDrops}' - - '&7Click here to toggle the random drop mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7drop table is called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7drop table is called it will go from top to' - - '&7bottom through the list.' - Button: RandomDrops - '5': - type: EMERALD - name: '&e&lMax Drops' - lore: - - '&bCurrently: &f{maxDrops}' - - '&7Click here to modify the maximum amount of' - - '&7drops this drop table can have. Keep in mind' - - '&7that when getting drops the drop table will' - - '&7only cycle through the list once. Not until' - - '&7this amount of drops has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: MaxDrops - '9': - type: REDSTONE - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -GiveRewardPositionListMenu: - name: '&b&l{name} DropTable' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&c&lGive Position Reward Guide' - lore: - - '&7In this list it displays the position' - - '&7sections for the selected drop table.' - - '&7If you want to add a new position section' - - '&7then simply click the EmeraldBlock and' - - '&7the next available position will be' - - '&7created.' - - '&7To remove a position simply shift-right' - - '&7click the position you want to remove.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of damage positions.' - PreviousPage: true - '50': - type: EMERALD_BLOCK - name: '&e&lAdd new Position' - lore: - - '&7Click here to add a new position' - - '&7to the drop table. This will find' - - '&7the next available position and' - - '&7create a new reward section for' - - '&7that position.' - Button: NewPosition - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of damage positions.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the drop table main edit menu.' -GiveRewardRewardsListMenu: - name: '&b&l{name} DropTable' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&c&lGive Reward Rewards Guide' - lore: - - '&7In this list it displays the drop sections' - - '&7assigned to the drop position of &f{position}&7.' - - '&7To edit the drops simply click on the drop' - - '&7section you wish to edit and then you can' - - '&7modify the data there.' - - '&7To remove a drop section simply shift-right' - - '&7click the section you want to remove.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of drop sections.' - PreviousPage: true - '50': - type: EMERALD_BLOCK - name: '&e&lAdd new Drop Section' - lore: - - '&7Click here to add a new drop section' - - '&7to the drop table. This will find' - - '&7the next available drop section and' - - '&7create a new drop section for' - - '&7that position.' - Button: NewRewardSection - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of drop sections.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the reward position list menu.' -GiveRewardMainEditMenu: - name: '&b&l{name} DropTable' - slots: 27 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 23 - Items: - '5': - type: DIAMOND - name: '&b&lPosition: &f{position}' - '11': - type: '289:0' - name: '&e&lRandom Drops' - lore: - - '&bCurrently: &f{randomDrops}' - - '&7Click here to toggle the random drop mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7drop table is called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7drop table is called it will go from top to' - - '&7bottom through the list.' - Button: RandomDrops - '12': - type: EMERALD - name: '&e&lMax Drops' - lore: - - '&bCurrently: &f{maxDrops}' - - '&7Click here to modify the maximum amount of' - - '&7drops this drop section can have. Keep in mind' - - '&7that when getting drops the drop section will' - - '&7only cycle through the list once. Not until' - - '&7this amount of drops has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: MaxDrops - '13': - type: CHEST - name: '&e&lItem Drops' - lore: - - '&7Click here to modify the custom item drops' - - '&7and their drop chance for this drop section.' - - '&7There is currently &f{drops}&7 drops set up.' - Button: ItemDrops - '14': - type: '348:0' - name: '&e&lRequired Percentage' - lore: - - '&bCurrently: &f{requiredPercentage}%' - - '&7Click here to modify the required percentage to' - - '&7receive this drop section. If the percentage is' - - '&75% then you need to do 5% damage to the boss to' - - '&7get the rewards in this drop section.' - - '&7' - - '&bLeft Click &8» &f+1%' - - '&bShift Left-Click &8» &f+10%' - - '&7' - - '&bRight Click &8» &f-1%' - - '&bShift Right-Click &8» &f-10%' - Button: RequiredPercentage - '15': - type: CHEST - name: '&e&lCommand Drops' - lore: - - '&7Click here to modify the custom command drops' - - '&7and their drop chance for this drop section.' - - '&7There is currently &f{commands}&7 commands' - - '&7set up.' - Button: CommandDrops - '16': - type: EMERALD - name: '&e&lMax Commands' - lore: - - '&bCurrently: &f{maxCommands}' - - '&7Click here to modify the maximum amount of' - - '&7commands this drop section can have. Keep in mind' - - '&7that when getting drops the drop section will' - - '&7only cycle through the list once. Not until' - - '&7this amount of commands has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' - Button: MaxCommands - '17': - type: '289:0' - name: '&e&lRandom Commands' - lore: - - '&bCurrently: &f{randomCommands}' - - '&7Click here to toggle the random command mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7commands are called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7commands are called it will go from top to' - - '&7bottom through the list.' - Button: RandomDrops - '23': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the reward drop section list menu.' -DropTableRewardsListEditMenu: - name: '&b&l{name} DropTable' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&c&lDrop Rewards Guide' - lore: - - '&7Here you can adjust the rewards for' - - '&7the skill with the drop layout. To' - - '&7adjust the chance of a section or to' - - '&7remove a section, then all you have' - - '&7to do is click on the section you''d' - - '&7like to modify and then click the' - - '&7corresponding button.' - - '&7To add a new section click on the' - - '&7emerald block in the bottom middle of' - - '&7the menu in between the page buttons.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of rewards.' - PreviousPage: true - '50': - type: EMERALD_BLOCK - name: '&b&lAdd a New Reward Section' - lore: - - '&7Click here if you would like to add' - - '&7a new reward section to this drop' - - '&7table.' - Button: NewReward - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of rewards.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the drop table main edit menu.' -DropTableNewRewardEditMenu: - name: '&b&lNew Reward for DropTable' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 54 - Items: - '46': - type: BOOK - name: '&c&lNew Drop Reward Guide' - lore: - - '&7Once you click an item within this' - - '&7menu it will create a new reward' - - '&7section with that selected item' - - '&7to the drop table you were working' - - '&7on. From there you can adjust the' - - '&7chance for it to be sprayed.' - - '&7' - - '&c&lWARNING' - - '&7At this moment you cannot have' - - '&7two sections for the same item,' - - '&7an easy way to bypass this is to' - - '&7add a new Item with the same' - - '&7itemstack, therefore giving it' - - '&7a new name, and allowing for' - - '&7another new section of the same' - - '&7item.' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page of itemstacks.' - PreviousPage: true - '50': - type: THIN_GLASS - name: '&7' - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page of itemstacks.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back to' - - '&7the drop table reward list menu.' -DropTableRewardMainEditMenu: - name: '&b&l{name} DropTable' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '3': - type: '289:0' - name: '&e&lSelected ItemStack' - lore: - - '&bCurrently: &f{itemStack}' - - '&7This is the selected itemStack for this' - - '&7reward section.' - '4': - type: EMERALD - name: '&e&lChance' - lore: - - '&bCurrently: &f{chance}' - - '&7Click here to modify the chance of this' - - '&7reward ' - - '&7' - - '&bLeft Click &8» &f+1%' - - '&bShift Left-Click &8» &f+0.1%' - - '&7' - - '&bRight Click &8» &f-1%' - - '&bShift Right-Click &8» &f-0.1%' - Button: Chance - '5': - type: BARRIER - name: '&e&lClick here to remove' - lore: - - '&7Click here to remove this rewards section.' - - '&7You can always re-create this section if' - - '&7was a mistake.' - Button: Remove - '9': - type: REDSTONE - name: '&e&lGo Back' - lore: - - '&7Click here to go back.' -MainAutoSpawnEditMenu: - name: '&b&l{name} AutoSpawn' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '2': - type: DIAMOND - name: '&e&lSpecial Settings' - lore: - - '&7Click here to edit the finer settings' - - '&7related to this auto spawn section.' - Button: SpecialSettings - '3': - type: '289:0' - name: '&e&lType' - lore: - - '&bCurrently: &f{type}' - - '&7This is the current auto spawn' - - '&7section type. Click here to open' - - '&7a menu to select the type.' - Button: Type - '5': - type: LEVER - name: '&e&lToggle Editing' - lore: - - '&7Click here to toggle the auto spawn' - - '&7editing mode.' - - '&7This will disable the auto spawn until' - - '&7it is enabled again.' - - '&7' - - '&bCurrently Disabled for Editing: &f{editing}' - Button: Editing - '7': - type: PAPER - name: '&e&lEntities' - lore: - - '&7Click here to edit the assigned boss' - - '&7entities to this auto spawn section.' - - '&7' - - '&bCurrently:' - - '&f{entities}' - Button: Entities - '8': - type: EMERALD - name: '&e&lCustom Settings' - lore: - - '&7Click here to edit any custom settings that' - - '&7are also included in this auto spawn type. If' - - '&7there is none then the GUI up next will be empty.' - Button: CustomSettings -AutoSpawnEntitiesEditMenu: - name: '&b&l{name} AutoSpawn' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 50 - Items: - '46': - type: THIN_GLASS - name: '&7' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page.' - PreviousPage: true - '50': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back.' - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: THIN_GLASS - name: '&7' -AutoSpawnCustomSettingsEditMenu: - name: '&b&l{name} AutoSpawn' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 50 - Items: - '46': - type: THIN_GLASS - name: '&7' - '47': - type: THIN_GLASS - name: '&7' - '48': - type: THIN_GLASS - name: '&7' - '49': - type: ARROW - name: '&e&l&m<-&e&l Previous Page' - lore: - - '&7Click here to go to the previous' - - '&7page.' - PreviousPage: true - '50': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back.' - '51': - type: ARROW - name: '&e&lNext Page &e&l&m->' - lore: - - '&7Click here to go to the next' - - '&7page.' - NextPage: true - '52': - type: THIN_GLASS - name: '&7' - '53': - type: THIN_GLASS - name: '&7' - '54': - type: THIN_GLASS - name: '&7' -AutoSpawnSpecialSettingsEditMenu: - name: '&b&l{name} AutoSpawn' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 5 - Items: - '1': - type: DIAMOND - name: '&e&lShuffle Entities' - lore: - - '&bCurrently: &f{shuffleEntities}' - - '&7' - - '&7Click here to toggle the entities being' - - '&7shuffled before being called.' - Button: ShuffleEntities - '2': - type: '289:0' - name: '&e&lMax Alive Entities At Once' - lore: - - '&bCurrently: &f{maxAliveEntities}' - - '&7' - - '&7This is the max alive entities from this' - - '&7auto spawn section at once. If more then' - - '&7this amount of entities is spawned at once' - - '&7then you will have to kill all entities' - - '&7before another can spawn.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' - Button: MaxAliveEntities - '3': - type: '385:0' - name: '&e&lAmount of Bosses Per Spawn' - lore: - - '&bCurrently: &f{amountPerSpawn}' - - '&7' - - '&7This is the amount of bosses to be spawned' - - '&7at one interval. This can be higher then the' - - '&7max alive entities at once but you will need' - - '&7to kill the amount of bosses till it the currently' - - '&7active amount is less then the max amount so' - - '&7it can spawn again.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' - Button: AmountPerSpawn - '5': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back.' - '7': - type: PAPER - name: '&e&lSpawn When Chunk Isn''t Loaded' - lore: - - '&bCurrently: &f{chunkIsntLoaded}' - - '&7' - - '&7This will determine if the boss can spawn' - - '&7even when the chunk is unloaded. This will' - - '&7load the chunk and keep it loaded while the' - - '&7boss is alive if this is set to true.' - Button: ChunkIsntLoaded - '8': - type: EMERALD - name: '&e&lOverride Default Spawn Message' - lore: - - '&bCurrently: &f{overrideDefaultMessage}' - - '&7' - - '&7Click here to toggle the overriding of the' - - '&7default spawn messages. If this is set to' - - '&7true it won''t use the default boss spawn' - - '&7messages and it will use the one assigned' - - '&7to this auto spawn section.' - Button: OverrideSpawnMessage - '9': - type: CHEST - name: '&e&lSpawn Message' - lore: - - '&bCurrently: &f{spawnMessage}' - - '&7' - - '&7Click here to change which spawn message' - - '&7is used for the auto spawn section. If the' - - '&7overriding of the default message is true' - - '&7only then will this message be used.' - Button: SpawnMessage -AutoSpawnTypeEditMenu: - name: '&b&l{name} AutoSpawn' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: '160:0' - name: '&7' - Buttons: - backButton: 9 - Items: - '2': - type: '347:0' - name: '&e&lInterval Spawn System' - lore: - - '&7Select this spawn system if you want to make' - - '&7the bosses spawn at a certain interval at a' - - '&7specific location.' - Button: IntervalSystem - '3': - type: GRASS - name: '&e&lWilderness Spawn System' - lore: - - '&7Select this spawn system if you want to make' - - '&7the boss(es) spawn randomly in the wilderness' - - '&7as players load the chunks.' - - '&7' - - '&c&lComing soon...' - Button: WildernessSystem - '4': - type: MAGMA_CREAM - name: '&e&lBiome Spawn System' - lore: - - '&7Select this spawn system if you want to make' - - '&7the boss(es) spawn randomly in specific biomes' - - '&7as players load and unload the chunks which are' - - '&7the selected biome.' - - '&7' - - '&c&lComing soon...' - Button: BiomeSystem - '5': - type: MOB_SPAWNER - name: '&e&lMob Spawner Spawn System' - lore: - - '&7Select this spawn system if you want to make' - - '&7the boss(es) spawn randomly within the selected' - - '&7spawner types.' - - '&7' - - '&c&lComing soon...' - Button: SpawnerSystem - '9': - type: REDSTONE - name: '&cClick here to go back' - lore: - - '&7Click this button to go back.' \ No newline at end of file diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/CustomBosses.java b/plugin-modules/Core/src/com/songoda/epicbosses/CustomBosses.java deleted file mode 100644 index d6f223b..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/CustomBosses.java +++ /dev/null @@ -1,244 +0,0 @@ -package com.songoda.epicbosses; - -import com.songoda.epicbosses.container.MinionEntityContainer; -import com.songoda.epicbosses.utils.*; -import com.songoda.epicbosses.utils.dependencies.HolographicDisplayHelper; -import com.songoda.epicbosses.utils.dependencies.VaultHelper; -import lombok.Getter; -import com.songoda.epicbosses.api.BossAPI; -import com.songoda.epicbosses.commands.BossCmd; -import com.songoda.epicbosses.container.BossEntityContainer; -import com.songoda.epicbosses.file.ConfigFileHandler; -import com.songoda.epicbosses.file.EditorFileHandler; -import com.songoda.epicbosses.file.LangFileHandler; -import com.songoda.epicbosses.managers.*; -import com.songoda.epicbosses.managers.files.*; -import com.songoda.epicbosses.utils.file.YmlFileHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; -import org.bstats.bukkit.Metrics; -import org.bukkit.Bukkit; -import org.bukkit.World; -import org.bukkit.command.ConsoleCommandSender; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.plugin.java.JavaPlugin; - -/** - * @author AMinecraftDev - * @version 1.0.0 - * @since 06-Sep-17 - */ -public class CustomBosses extends JavaPlugin implements IReloadable { - - private static CustomBosses instance; - - @Getter private MessagesFileManager bossMessagesFileManager; - @Getter private CommandsFileManager bossCommandFileManager; - @Getter private AutoSpawnFileManager autoSpawnFileManager; - @Getter private DropTableFileManager dropTableFileManager; - @Getter private MinionsFileManager minionsFileManager; - @Getter private BossesFileManager bossesFileManager; - @Getter private SkillsFileManager skillsFileManager; - @Getter private ItemsFileManager itemStackManager; - - @Getter private BossDropTableManager bossDropTableManager; - @Getter private BossEntityContainer bossEntityContainer; - @Getter private BossMechanicManager bossMechanicManager; - @Getter private BossLocationManager bossLocationManager; - @Getter private BossListenerManager bossListenerManager; - @Getter private BossCommandManager bossCommandManager; - @Getter private BossEntityManager bossEntityManager; - @Getter private BossTargetManager bossTargetManager; - @Getter private BossPanelManager bossPanelManager; - @Getter private BossSkillManager bossSkillManager; - @Getter private BossTauntManager bossTauntManager; - @Getter private BossHookManager bossHookManager; - - @Getter private AutoSpawnManager autoSpawnManager; - @Getter private PlaceholderManager placeholderManager; - - @Getter private MinionMechanicManager minionMechanicManager; - @Getter private MinionEntityContainer minionEntityContainer; - - @Getter private VersionHandler versionHandler = new VersionHandler(); - @Getter private DebugManager debugManager = new DebugManager(); - - @Getter private YmlFileHandler langFileHandler, editorFileHandler, configFileHandler; - @Getter private FileConfiguration lang, editor, config; - - @Getter private HolographicDisplayHelper holographicDisplayHelper; - @Getter private VaultHelper vaultHelper; - - @Getter private boolean debug = true; - - @Override - public void onDisable() { - ConsoleCommandSender console = Bukkit.getConsoleSender(); - - console.sendMessage(StringUtils.get().translateColor("&a=============================")); - console.sendMessage(StringUtils.get().translateColor("&7EpicBosses " + getDescription().getVersion() + " by &5Songoda <3&7!")); - console.sendMessage(StringUtils.get().translateColor("&7Action: &aDisabling&7...")); - - this.autoSpawnManager.stopIntervalSystems(); - this.bossEntityManager.killAllHolders((World) null); - - console.sendMessage(StringUtils.get().translateColor("&a=============================")); - } - - @Override - public void onEnable() { - ConsoleCommandSender console = Bukkit.getConsoleSender(); - - console.sendMessage(StringUtils.get().translateColor("&a=============================")); - console.sendMessage(StringUtils.get().translateColor("&7EpicBosses " + getDescription().getVersion() + " by &5Songoda <3&7!")); - console.sendMessage(StringUtils.get().translateColor("&7Action: &aEnabling&7...")); - - if (!this.getDataFolder().exists()) - this.getDataFolder().mkdir(); - - Debug.setPlugin(this); - - instance = this; - - this.vaultHelper = new VaultHelper(); - this.holographicDisplayHelper = new HolographicDisplayHelper(); - - long beginMs = System.currentTimeMillis(); - - if(!this.vaultHelper.isConnected()) { - Debug.FAILED_TO_CONNECT_TO_VAULT.debug(); - Bukkit.getPluginManager().disablePlugin(this); - return; - } - - new BossAPI(this); - new Metrics(this); - new ServerUtils(this); - - this.bossSkillManager = new BossSkillManager(this); - this.bossHookManager = new BossHookManager(this); - this.bossTauntManager = new BossTauntManager(this); - this.bossTargetManager = new BossTargetManager(this); - this.bossEntityContainer = new BossEntityContainer(); - this.minionEntityContainer = new MinionEntityContainer(); - this.bossMechanicManager = new BossMechanicManager(this); - this.minionMechanicManager = new MinionMechanicManager(this); - this.bossLocationManager = new BossLocationManager(this); - - loadFileManagersAndHandlers(); - - //Managers that rely on Files - this.bossDropTableManager = new BossDropTableManager(this); - this.bossPanelManager = new BossPanelManager(this); - this.bossEntityManager = new BossEntityManager(this); - - this.autoSpawnManager = new AutoSpawnManager(this); - - if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { - this.placeholderManager = new PlaceholderManager(this); - this.placeholderManager.register(); - } - - createFiles(); - reloadFiles(); - - this.debug = getConfig().getBoolean("Settings.debug", false); - - this.itemStackManager.reload(); - this.bossesFileManager.reload(); - this.minionsFileManager.reload(); - this.skillsFileManager.reload(); - this.bossCommandFileManager.reload(); - this.bossMessagesFileManager.reload(); - this.dropTableFileManager.reload(); - this.autoSpawnFileManager.reload(); - - this.bossCommandManager = new BossCommandManager(new BossCmd(), this); - this.bossListenerManager = new BossListenerManager(this); - - this.bossPanelManager.load(); - - //RELOAD/LOAD ALL MANAGERS - this.bossSkillManager.load(); - this.bossHookManager.reload(); - this.bossLocationManager.reload(); - this.bossMechanicManager.load(); - this.minionMechanicManager.load(); - - saveMessagesToFile(); - - this.bossCommandManager.load(); - this.bossListenerManager.load(); - - this.autoSpawnManager.startIntervalSystems(); - - ServerUtils.get().logDebug("Loaded all fields and managers, saved messages and plugin is initialized and ready to go. (took " + (System.currentTimeMillis() - beginMs) + "ms)."); - console.sendMessage(StringUtils.get().translateColor("&a=============================")); - } - - @Override - public void reload() { - this.itemStackManager.reload(); - this.bossesFileManager.reload(); - this.minionsFileManager.reload(); - this.skillsFileManager.reload(); - this.bossCommandFileManager.reload(); - this.bossMessagesFileManager.reload(); - this.dropTableFileManager.reload(); - this.autoSpawnFileManager.reload(); - - this.bossMechanicManager.load(); - - reloadFiles(); - - this.bossPanelManager.reload(); - this.bossHookManager.reload(); - this.bossLocationManager.reload(); - this.debug = getConfig().getBoolean("Settings.debug", false); - - Message.setFile(getLang()); - } - - private void loadFileManagersAndHandlers() { - this.itemStackManager = new ItemsFileManager(this); - this.bossesFileManager = new BossesFileManager(this); - this.minionsFileManager = new MinionsFileManager(this); - this.bossCommandFileManager = new CommandsFileManager(this); - this.bossMessagesFileManager = new MessagesFileManager(this); - this.dropTableFileManager = new DropTableFileManager(this); - this.skillsFileManager = new SkillsFileManager(this); - this.autoSpawnFileManager = new AutoSpawnFileManager(this); - - this.langFileHandler = new LangFileHandler(this); - this.editorFileHandler = new EditorFileHandler(this); - this.configFileHandler = new ConfigFileHandler(this); - } - - private void reloadFiles() { - this.lang = this.langFileHandler.loadFile(); - this.editor = this.editorFileHandler.loadFile(); - this.config = this.configFileHandler.loadFile(); - } - - private void createFiles() { - this.editorFileHandler.createFile(); - this.langFileHandler.createFile(); - this.configFileHandler.createFile(); - } - - private void saveMessagesToFile() { - FileConfiguration lang = getLang(); - - for(Message message : Message.values()) { - if(!lang.contains(message.getPath())) { - lang.set(message.getPath(), message.getDefault()); - } - } - - this.langFileHandler.saveFile(lang); - Message.setFile(lang); - } - - public static CustomBosses get() { - return instance; - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java new file mode 100644 index 0000000..d00cc17 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java @@ -0,0 +1,384 @@ +package com.songoda.epicbosses; + +import com.songoda.core.SongodaCore; +import com.songoda.core.SongodaPlugin; +import com.songoda.core.compatibility.CompatibleMaterial; +import com.songoda.core.configuration.Config; +import com.songoda.core.hooks.EconomyManager; +import com.songoda.core.hooks.WorldGuardHook; +import com.songoda.epicbosses.api.BossAPI; +import com.songoda.epicbosses.commands.BossCmd; +import com.songoda.epicbosses.container.BossEntityContainer; +import com.songoda.epicbosses.container.MinionEntityContainer; +import com.songoda.epicbosses.file.DisplayFileHandler; +import com.songoda.epicbosses.file.EditorFileHandler; +import com.songoda.epicbosses.file.LangFileHandler; +import com.songoda.epicbosses.managers.*; +import com.songoda.epicbosses.managers.files.*; +import com.songoda.epicbosses.settings.Settings; +import com.songoda.epicbosses.utils.Debug; +import com.songoda.epicbosses.utils.IReloadable; +import com.songoda.epicbosses.utils.Message; +import com.songoda.epicbosses.utils.ServerUtils; +import com.songoda.epicbosses.utils.file.YmlFileHandler; +import com.songoda.epicbosses.utils.version.VersionHandler; +import org.bukkit.Bukkit; +import org.bukkit.World; +import org.bukkit.configuration.file.FileConfiguration; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author AMinecraftDev + * @version 1.0.0 + * @since 06-Sep-17 + */ +public class EpicBosses extends SongodaPlugin implements IReloadable { + + private static EpicBosses INSTANCE; + + private MessagesFileManager bossMessagesFileManager; + private CommandsFileManager bossCommandFileManager; + private AutoSpawnFileManager autoSpawnFileManager; + private DropTableFileManager dropTableFileManager; + private MinionsFileManager minionsFileManager; + private BossesFileManager bossesFileManager; + private SkillsFileManager skillsFileManager; + private ItemsFileManager itemStackManager; + + private BossDropTableManager bossDropTableManager; + private BossEntityContainer bossEntityContainer; + private BossMechanicManager bossMechanicManager; + private BossLocationManager bossLocationManager; + private BossListenerManager bossListenerManager; + private BossCommandManager bossCommandManager; + private BossEntityManager bossEntityManager; + private BossTargetManager bossTargetManager; + private BossPanelManager bossPanelManager; + private BossSkillManager bossSkillManager; + private BossTauntManager bossTauntManager; + private BossHookManager bossHookManager; + + private AutoSpawnManager autoSpawnManager; + private PlaceholderManager placeholderManager; + + private MinionMechanicManager minionMechanicManager; + private MinionEntityContainer minionEntityContainer; + + private VersionHandler versionHandler = new VersionHandler(); + private DebugManager debugManager = new DebugManager(); + + private YmlFileHandler langFileHandler, editorFileHandler, displayFileHandler; + private FileConfiguration lang, editor, display; + + private boolean debug = true; + + @Override + public void onPluginLoad() { + INSTANCE = this; + + // Register WorldGuard + WorldGuardHook.addHook("boss-spawn-region", true); + WorldGuardHook.addHook("boss-blocked-region", false); + } + + @Override + public void onPluginDisable() { + this.autoSpawnManager.stopIntervalSystems(); + this.bossEntityManager.killAllHolders((World) null); + } + + @Override + public void onPluginEnable() { + // Run Songoda Updater + SongodaCore.registerPlugin(this, 19, CompatibleMaterial.ZOMBIE_SPAWN_EGG); + + // Load Economy + EconomyManager.load(); + + // Setup Config + Settings.setupConfig(); + + // Set economy preference + EconomyManager.getManager().setPreferredHook(Settings.ECONOMY_PLUGIN.getString()); + + if (!this.getDataFolder().exists()) + this.getDataFolder().mkdir(); + + Debug.setPlugin(this); + + long beginMs = System.currentTimeMillis(); + + new BossAPI(this); + new ServerUtils(this); + + this.bossSkillManager = new BossSkillManager(this); + this.bossHookManager = new BossHookManager(this); + this.bossTauntManager = new BossTauntManager(this); + this.bossTargetManager = new BossTargetManager(this); + this.bossEntityContainer = new BossEntityContainer(); + this.minionEntityContainer = new MinionEntityContainer(); + this.bossMechanicManager = new BossMechanicManager(this); + this.minionMechanicManager = new MinionMechanicManager(this); + this.bossLocationManager = new BossLocationManager(this); + + loadFileManagersAndHandlers(); + + //Managers that rely on Files + this.bossDropTableManager = new BossDropTableManager(this); + this.bossPanelManager = new BossPanelManager(this); + this.bossEntityManager = new BossEntityManager(this); + + this.autoSpawnManager = new AutoSpawnManager(this); + + if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { + this.placeholderManager = new PlaceholderManager(this); + this.placeholderManager.register(); + } + + createFiles(); + reloadFiles(); + + this.debug = getConfig().getBoolean("Settings.debug", false); + + this.itemStackManager.reload(); + this.bossesFileManager.reload(); + this.minionsFileManager.reload(); + this.skillsFileManager.reload(); + this.bossCommandFileManager.reload(); + this.bossMessagesFileManager.reload(); + this.dropTableFileManager.reload(); + this.autoSpawnFileManager.reload(); + + this.bossCommandManager = new BossCommandManager(new BossCmd(), this); + this.bossListenerManager = new BossListenerManager(this); + + this.bossPanelManager.load(); + + //RELOAD/LOAD ALL MANAGERS + this.bossSkillManager.load(); + this.bossHookManager.reload(); + this.bossLocationManager.reload(); + this.bossMechanicManager.load(); + this.minionMechanicManager.load(); + + saveMessagesToFile(); + + this.bossCommandManager.load(); + this.bossListenerManager.load(); + + this.autoSpawnManager.startIntervalSystems(); + + ServerUtils.get().logDebug("Loaded all fields and managers, saved messages and plugin is initialized and ready to go. (took " + (System.currentTimeMillis() - beginMs) + "ms)."); + } + + @Override + public List getExtraConfig() { + return new ArrayList<>(); + } + + @Override + public void onConfigReload() { + this.itemStackManager.reload(); + this.bossesFileManager.reload(); + this.minionsFileManager.reload(); + this.skillsFileManager.reload(); + this.bossCommandFileManager.reload(); + this.bossMessagesFileManager.reload(); + this.dropTableFileManager.reload(); + this.autoSpawnFileManager.reload(); + + this.bossMechanicManager.load(); + + reloadFiles(); + + this.bossPanelManager.reload(); + this.bossHookManager.reload(); + this.bossLocationManager.reload(); + this.debug = getConfig().getBoolean("Settings.debug", false); + + Message.setFile(getLang()); + } + + private void loadFileManagersAndHandlers() { + this.itemStackManager = new ItemsFileManager(this); + this.bossesFileManager = new BossesFileManager(this); + this.minionsFileManager = new MinionsFileManager(this); + this.bossCommandFileManager = new CommandsFileManager(this); + this.bossMessagesFileManager = new MessagesFileManager(this); + this.dropTableFileManager = new DropTableFileManager(this); + this.skillsFileManager = new SkillsFileManager(this); + this.autoSpawnFileManager = new AutoSpawnFileManager(this); + + this.langFileHandler = new LangFileHandler(this); + this.editorFileHandler = new EditorFileHandler(this); + this.displayFileHandler = new DisplayFileHandler(this); + } + + private void reloadFiles() { + this.lang = this.langFileHandler.loadFile(); + this.editor = this.editorFileHandler.loadFile(); + this.display = this.displayFileHandler.loadFile(); + } + + private void createFiles() { + this.editorFileHandler.createFile(); + this.langFileHandler.createFile(); + this.displayFileHandler.createFile(); + } + + private void saveMessagesToFile() { + FileConfiguration lang = getLang(); + + for (Message message : Message.values()) { + if (!lang.contains(message.getPath())) { + lang.set(message.getPath(), message.getDefault()); + } + } + + this.langFileHandler.saveFile(lang); + Message.setFile(lang); + } + + public static EpicBosses getInstance() { + return INSTANCE; + } + + public MessagesFileManager getBossMessagesFileManager() { + return this.bossMessagesFileManager; + } + + public CommandsFileManager getBossCommandFileManager() { + return this.bossCommandFileManager; + } + + public AutoSpawnFileManager getAutoSpawnFileManager() { + return this.autoSpawnFileManager; + } + + public DropTableFileManager getDropTableFileManager() { + return this.dropTableFileManager; + } + + public MinionsFileManager getMinionsFileManager() { + return this.minionsFileManager; + } + + public BossesFileManager getBossesFileManager() { + return this.bossesFileManager; + } + + public SkillsFileManager getSkillsFileManager() { + return this.skillsFileManager; + } + + public ItemsFileManager getItemStackManager() { + return this.itemStackManager; + } + + public BossDropTableManager getBossDropTableManager() { + return this.bossDropTableManager; + } + + public BossEntityContainer getBossEntityContainer() { + return this.bossEntityContainer; + } + + public BossMechanicManager getBossMechanicManager() { + return this.bossMechanicManager; + } + + public BossLocationManager getBossLocationManager() { + return this.bossLocationManager; + } + + public BossListenerManager getBossListenerManager() { + return this.bossListenerManager; + } + + public BossCommandManager getBossCommandManager() { + return this.bossCommandManager; + } + + public BossEntityManager getBossEntityManager() { + return this.bossEntityManager; + } + + public BossTargetManager getBossTargetManager() { + return this.bossTargetManager; + } + + public BossPanelManager getBossPanelManager() { + return this.bossPanelManager; + } + + public BossSkillManager getBossSkillManager() { + return this.bossSkillManager; + } + + public BossTauntManager getBossTauntManager() { + return this.bossTauntManager; + } + + public BossHookManager getBossHookManager() { + return this.bossHookManager; + } + + public AutoSpawnManager getAutoSpawnManager() { + return this.autoSpawnManager; + } + + public PlaceholderManager getPlaceholderManager() { + return this.placeholderManager; + } + + public MinionMechanicManager getMinionMechanicManager() { + return this.minionMechanicManager; + } + + public MinionEntityContainer getMinionEntityContainer() { + return this.minionEntityContainer; + } + + public VersionHandler getVersionHandler() { + return this.versionHandler; + } + + public DebugManager getDebugManager() { + return this.debugManager; + } + + public YmlFileHandler getLangFileHandler() { + return this.langFileHandler; + } + + public YmlFileHandler getEditorFileHandler() { + return this.editorFileHandler; + } + + public YmlFileHandler getDisplayFileHandler() { + return this.displayFileHandler; + } + + public FileConfiguration getLang() { + return this.lang; + } + + public FileConfiguration getEditor() { + return this.editor; + } + + public FileConfiguration getDisplay() { + return this.display; + } + + public boolean isDebug() { + return this.debug; + } + + @Override + public void reload() { + reloadConfig(); + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java b/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java index 9997ef8..53a0e45 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java @@ -2,7 +2,7 @@ package com.songoda.epicbosses.api; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings; import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement; @@ -16,13 +16,11 @@ import com.songoda.epicbosses.entity.elements.*; import com.songoda.epicbosses.events.PreBossSpawnEvent; import com.songoda.epicbosses.events.PreBossSpawnItemEvent; import com.songoda.epicbosses.holder.ActiveBossHolder; -import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.managers.files.CommandsFileManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.managers.files.MessagesFileManager; import com.songoda.epicbosses.skills.CustomSkillHandler; import com.songoda.epicbosses.skills.Skill; -import com.songoda.epicbosses.skills.custom.Minions; import com.songoda.epicbosses.skills.elements.CustomMinionSkillElement; import com.songoda.epicbosses.skills.elements.SubCustomSkillElement; import com.songoda.epicbosses.skills.types.CommandSkillElement; @@ -51,7 +49,7 @@ import java.util.Map; */ public class BossAPI { - private static CustomBosses PLUGIN; + private static EpicBosses PLUGIN; /** * Used to update the variable to the @@ -64,7 +62,7 @@ public class BossAPI { * * @param plugin - the plugin instance. */ - public BossAPI(CustomBosses plugin) { + public BossAPI(EpicBosses plugin) { if(PLUGIN != null) { Debug.ATTEMPTED_TO_UPDATE_PLUGIN.debug(); return; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java index 2ae090c..28e8c4e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java @@ -5,8 +5,6 @@ import com.google.gson.annotations.Expose; import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings; import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement; import com.songoda.epicbosses.utils.BossesGson; -import lombok.Getter; -import lombok.Setter; import java.util.List; @@ -17,11 +15,16 @@ import java.util.List; */ public class AutoSpawn { - @Expose @Getter @Setter private boolean editing; - @Expose @Getter @Setter private String type; - @Expose @Getter @Setter private List entities; - @Expose @Getter @Setter private AutoSpawnSettings autoSpawnSettings; - @Expose @Getter @Setter private JsonObject customData; + @Expose + private boolean editing; + @Expose + private String type; + @Expose + private List entities; + @Expose + private AutoSpawnSettings autoSpawnSettings; + @Expose + private JsonObject customData; public AutoSpawn(boolean editing, List entities, AutoSpawnSettings autoSpawnSettings) { this.editing = editing; @@ -47,4 +50,43 @@ public class AutoSpawn { return true; } + public boolean isEditing() { + return this.editing; + } + + public String getType() { + return this.type; + } + + public List getEntities() { + return this.entities; + } + + public AutoSpawnSettings getAutoSpawnSettings() { + return this.autoSpawnSettings; + } + + public JsonObject getCustomData() { + return this.customData; + } + + public void setEditing(boolean editing) { + this.editing = editing; + } + + public void setType(String type) { + this.type = type; + } + + public void setEntities(List entities) { + this.entities = entities; + } + + public void setAutoSpawnSettings(AutoSpawnSettings autoSpawnSettings) { + this.autoSpawnSettings = autoSpawnSettings; + } + + public void setCustomData(JsonObject customData) { + this.customData = customData; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java index 3cbbc5e..dd78d44 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java @@ -1,20 +1,24 @@ package com.songoda.epicbosses.autospawns.handlers; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement; import com.songoda.epicbosses.handlers.AutoSpawnVariableHandler; import com.songoda.epicbosses.handlers.variables.AutoSpawnLocationVariableHandler; import com.songoda.epicbosses.handlers.variables.AutoSpawnPlaceholderVariableHandler; -import com.songoda.epicbosses.utils.*; +import com.songoda.epicbosses.utils.Message; +import com.songoda.epicbosses.utils.NumberUtils; +import com.songoda.epicbosses.utils.ObjectUtils; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * @author Charles Cullen @@ -29,7 +33,7 @@ public class IntervalSpawnHandler { intervalSpawnElement.setSpawnAfterLastBossIsKilled(!ObjectUtils.getValue(intervalSpawnElement.getSpawnAfterLastBossIsKilled(), false)); autoSpawn.setCustomData(BossAPI.convertObjectToJsonObject(intervalSpawnElement)); - CustomBosses.get().getAutoSpawnFileManager().save(); + EpicBosses.getInstance().getAutoSpawnFileManager().save(); panelHandler.openFor(player, autoSpawn); }; @@ -42,7 +46,7 @@ public class IntervalSpawnHandler { public ClickAction getLocationAction(IntervalSpawnElement intervalSpawnElement, AutoSpawn autoSpawn, VariablePanelHandler variablePanelHandler) { return event -> { Player player = (Player) event.getWhoClicked(); - AutoSpawnVariableHandler autoSpawnVariableHandler = new AutoSpawnLocationVariableHandler(player, autoSpawn, intervalSpawnElement, CustomBosses.get().getAutoSpawnFileManager(), variablePanelHandler); + AutoSpawnVariableHandler autoSpawnVariableHandler = new AutoSpawnLocationVariableHandler(player, autoSpawn, intervalSpawnElement, EpicBosses.getInstance().getAutoSpawnFileManager(), variablePanelHandler); Message.Boss_AutoSpawn_SetLocation.msg(player); autoSpawnVariableHandler.handle(); @@ -57,7 +61,7 @@ public class IntervalSpawnHandler { public ClickAction getPlaceholderAction(IntervalSpawnElement intervalSpawnElement, AutoSpawn autoSpawn, VariablePanelHandler variablePanelHandler) { return event -> { Player player = (Player) event.getWhoClicked(); - AutoSpawnVariableHandler autoSpawnVariableHandler = new AutoSpawnPlaceholderVariableHandler(player, autoSpawn, intervalSpawnElement, CustomBosses.get().getAutoSpawnFileManager(), variablePanelHandler); + AutoSpawnVariableHandler autoSpawnVariableHandler = new AutoSpawnPlaceholderVariableHandler(player, autoSpawn, intervalSpawnElement, EpicBosses.getInstance().getAutoSpawnFileManager(), variablePanelHandler); Message.Boss_AutoSpawn_SetPlaceholder.msg(player); autoSpawnVariableHandler.handle(); @@ -105,7 +109,7 @@ public class IntervalSpawnHandler { JsonObject jsonObject = BossAPI.convertObjectToJsonObject(intervalSpawnElement); autoSpawn.setCustomData(jsonObject); - CustomBosses.get().getAutoSpawnFileManager().save(); + EpicBosses.getInstance().getAutoSpawnFileManager().save(); Message.Boss_AutoSpawn_SpawnRate.msg(event.getWhoClicked(), modifyValue, NumberUtils.get().formatDouble(newAmount)); panelHandler.openFor((Player) event.getWhoClicked(), autoSpawn); }; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java index df2ee7e..0e6aa05 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.autospawns.settings; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,9 +9,12 @@ import lombok.Setter; */ public class AutoSpawnSettings { - @Expose @Getter @Setter private Integer maxAliveAtOnce, amountPerSpawn; - @Expose @Getter @Setter private Boolean spawnWhenChunkIsntLoaded, overrideDefaultSpawnMessage, shuffleEntitiesList; - @Expose @Getter @Setter private String spawnMessage; + @Expose + private Integer maxAliveAtOnce, amountPerSpawn; + @Expose + private Boolean spawnWhenChunkIsntLoaded, overrideDefaultSpawnMessage, shuffleEntitiesList; + @Expose + private String spawnMessage; public AutoSpawnSettings(int maxAliveAtOnce, int amountPerSpawn, boolean spawnWhenChunkIsntLoaded, boolean shuffleEntitiesList) { this.maxAliveAtOnce = maxAliveAtOnce; @@ -22,4 +23,51 @@ public class AutoSpawnSettings { this.shuffleEntitiesList = shuffleEntitiesList; } + public Integer getMaxAliveAtOnce() { + return this.maxAliveAtOnce; + } + + public Integer getAmountPerSpawn() { + return this.amountPerSpawn; + } + + public Boolean getSpawnWhenChunkIsntLoaded() { + return this.spawnWhenChunkIsntLoaded; + } + + public Boolean getOverrideDefaultSpawnMessage() { + return this.overrideDefaultSpawnMessage; + } + + public Boolean getShuffleEntitiesList() { + return this.shuffleEntitiesList; + } + + public String getSpawnMessage() { + return this.spawnMessage; + } + + public void setMaxAliveAtOnce(Integer maxAliveAtOnce) { + this.maxAliveAtOnce = maxAliveAtOnce; + } + + public void setAmountPerSpawn(Integer amountPerSpawn) { + this.amountPerSpawn = amountPerSpawn; + } + + public void setSpawnWhenChunkIsntLoaded(Boolean spawnWhenChunkIsntLoaded) { + this.spawnWhenChunkIsntLoaded = spawnWhenChunkIsntLoaded; + } + + public void setOverrideDefaultSpawnMessage(Boolean overrideDefaultSpawnMessage) { + this.overrideDefaultSpawnMessage = overrideDefaultSpawnMessage; + } + + public void setShuffleEntitiesList(Boolean shuffleEntitiesList) { + this.shuffleEntitiesList = shuffleEntitiesList; + } + + public void setSpawnMessage(String spawnMessage) { + this.spawnMessage = spawnMessage; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java index 6dd8f26..aaffec9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java @@ -16,8 +16,6 @@ import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; import com.songoda.epicbosses.utils.*; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -31,9 +29,12 @@ import java.util.*; */ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { - @Expose @Getter @Setter private Boolean spawnAfterLastBossIsKilled; - @Expose @Getter @Setter private String location, placeholder; - @Expose @Getter @Setter private Integer spawnRate; + @Expose + private Boolean spawnAfterLastBossIsKilled; + @Expose + private String location, placeholder; + @Expose + private Integer spawnRate; public IntervalSpawnElement(String location, String placeholder, Integer spawnRate, boolean spawnAfterLastBossIsKilled) { this.location = location; @@ -117,4 +118,36 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { public Location getSpawnLocation() { return StringUtils.get().fromStringToLocation(this.location); } + + public Boolean getSpawnAfterLastBossIsKilled() { + return this.spawnAfterLastBossIsKilled; + } + + public String getLocation() { + return this.location; + } + + public String getPlaceholder() { + return this.placeholder; + } + + public Integer getSpawnRate() { + return this.spawnRate; + } + + public void setSpawnAfterLastBossIsKilled(Boolean spawnAfterLastBossIsKilled) { + this.spawnAfterLastBossIsKilled = spawnAfterLastBossIsKilled; + } + + public void setLocation(String location) { + this.location = location; + } + + public void setPlaceholder(String placeholder) { + this.placeholder = placeholder; + } + + public void setSpawnRate(Integer spawnRate) { + this.spawnRate = spawnRate; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java index 4158d95..b8ba412 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java @@ -9,7 +9,6 @@ import com.songoda.epicbosses.utils.Permission; import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.command.CommandSender; -import org.bukkit.entity.EntityType; import java.util.ArrayList; import java.util.Arrays; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java index 2edbb8f..be1e5b7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.commands.boss; -import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.container.BossEntityContainer; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java index beef297..146fade 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.commands.boss; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.Permission; @@ -49,7 +49,7 @@ public class BossHelpCmd extends SubCommand { return; } - sender.sendMessage(StringUtils.get().translateColor("EpicBosses &7Version " + CustomBosses.get().getDescription().getVersion() + " Created with <3 by &5&l&oSongoda")); + sender.sendMessage(StringUtils.get().translateColor("EpicBosses &7Version " + EpicBosses.getInstance().getDescription().getVersion() + " Created with <3 by &5&l&oSongoda")); Message.Boss_Help_NoPermission.msg(sender); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java index 8751b1a..59fd569 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.commands.boss; -import com.songoda.epicbosses.CustomBosses; -import com.songoda.epicbosses.file.ConfigFileHandler; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.utils.*; import com.songoda.epicbosses.utils.command.SubCommand; @@ -20,9 +19,9 @@ import java.util.Map; */ public class BossNearbyCmd extends SubCommand { - private CustomBosses plugin; + private EpicBosses plugin; - public BossNearbyCmd(CustomBosses plugin) { + public BossNearbyCmd(EpicBosses plugin) { super("nearby"); this.plugin = plugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java index a354b9d..d039c08 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java @@ -1,9 +1,8 @@ package com.songoda.epicbosses.commands.boss; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; -import com.songoda.epicbosses.autospawns.SpawnType; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossDropTableManager; import com.songoda.epicbosses.managers.BossSkillManager; @@ -40,7 +39,7 @@ public class BossNewCmd extends SubCommand { private SkillsFileManager skillsFileManager; private BossSkillManager bossSkillManager; - public BossNewCmd(CustomBosses plugin) { + public BossNewCmd(EpicBosses plugin) { super("new"); this.bossSkillManager = plugin.getBossSkillManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java index 03ee346..67aa097 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.commands.boss; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.Message; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java index dfd4746..0cf0dea 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.commands.boss; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.Permission; import com.songoda.epicbosses.utils.command.SubCommand; @@ -14,9 +14,9 @@ import org.bukkit.entity.Player; */ public class BossShopCmd extends SubCommand { - private CustomBosses plugin; + private EpicBosses plugin; - public BossShopCmd(CustomBosses plugin) { + public BossShopCmd(EpicBosses plugin) { super("shop", "buy", "store"); this.plugin = plugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java index 769235d..ab579ce 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.commands.boss; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveAutoSpawnHolder; import com.songoda.epicbosses.holder.autospawn.ActiveIntervalAutoSpawnHolder; import com.songoda.epicbosses.managers.AutoSpawnManager; @@ -23,7 +23,7 @@ public class BossTimeCmd extends SubCommand { private AutoSpawnManager autoSpawnManager; - public BossTimeCmd(CustomBosses plugin) { + public BossTimeCmd(EpicBosses plugin) { super("time"); this.autoSpawnManager = plugin.getAutoSpawnManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java index b352cfb..8b41776 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java @@ -6,8 +6,6 @@ import com.songoda.epicbosses.droptable.elements.DropTableElement; import com.songoda.epicbosses.droptable.elements.GiveTableElement; import com.songoda.epicbosses.droptable.elements.SprayTableElement; import com.songoda.epicbosses.utils.BossesGson; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -16,8 +14,10 @@ import lombok.Setter; */ public class DropTable { - @Expose @Getter @Setter private String dropType; - @Expose @Getter @Setter private JsonObject rewards; + @Expose + private String dropType; + @Expose + private JsonObject rewards; public DropTable(String dropType, JsonObject rewards) { this.dropType = dropType; @@ -48,4 +48,19 @@ public class DropTable { return null; } + public String getDropType() { + return this.dropType; + } + + public JsonObject getRewards() { + return this.rewards; + } + + public void setDropType(String dropType) { + this.dropType = dropType; + } + + public void setRewards(JsonObject rewards) { + this.rewards = rewards; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java index 44f0f10..e6f7e6e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.droptable.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import java.util.Map; @@ -13,9 +11,12 @@ import java.util.Map; */ public class DropTableElement { - @Expose @Getter @Setter private Map dropRewards; - @Expose @Getter @Setter private Boolean randomDrops; - @Expose @Getter @Setter private Integer dropMaxDrops; + @Expose + private Map dropRewards; + @Expose + private Boolean randomDrops; + @Expose + private Integer dropMaxDrops; public DropTableElement(Map dropRewards, Boolean randomDrops, Integer dropMaxDrops) { this.dropRewards = dropRewards; @@ -23,4 +24,27 @@ public class DropTableElement { this.dropMaxDrops = dropMaxDrops; } + public Map getDropRewards() { + return this.dropRewards; + } + + public Boolean getRandomDrops() { + return this.randomDrops; + } + + public Integer getDropMaxDrops() { + return this.dropMaxDrops; + } + + public void setDropRewards(Map dropRewards) { + this.dropRewards = dropRewards; + } + + public void setRandomDrops(Boolean randomDrops) { + this.randomDrops = randomDrops; + } + + public void setDropMaxDrops(Integer dropMaxDrops) { + this.dropMaxDrops = dropMaxDrops; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableElement.java index 620f66e..1a22c84 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.droptable.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import java.util.Map; @@ -13,10 +11,18 @@ import java.util.Map; */ public class GiveTableElement { - @Expose @Getter @Setter private Map> giveRewards; + @Expose + private Map> giveRewards; public GiveTableElement(Map> giveRewards) { this.giveRewards = giveRewards; } + public Map> getGiveRewards() { + return this.giveRewards; + } + + public void setGiveRewards(Map> giveRewards) { + this.giveRewards = giveRewards; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java index 582ad49..4787444 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.droptable.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import java.util.Map; @@ -13,10 +11,14 @@ import java.util.Map; */ public class GiveTableSubElement { - @Expose @Getter @Setter private Map items, commands; - @Expose @Getter @Setter private Integer maxDrops, maxCommands; - @Expose @Getter @Setter private Boolean randomDrops, randomCommands; - @Expose @Getter @Setter private Double requiredPercentage; + @Expose + private Map items, commands; + @Expose + private Integer maxDrops, maxCommands; + @Expose + private Boolean randomDrops, randomCommands; + @Expose + private Double requiredPercentage; public GiveTableSubElement(Map items, Map commands, Integer maxDrops, Integer maxCommands, Boolean randomDrops, Boolean randomCommands, Double requiredPercentage) { this.items = items; @@ -28,4 +30,59 @@ public class GiveTableSubElement { this.requiredPercentage = requiredPercentage; } + public Map getItems() { + return this.items; + } + + public Map getCommands() { + return this.commands; + } + + public Integer getMaxDrops() { + return this.maxDrops; + } + + public Integer getMaxCommands() { + return this.maxCommands; + } + + public Boolean getRandomDrops() { + return this.randomDrops; + } + + public Boolean getRandomCommands() { + return this.randomCommands; + } + + public Double getRequiredPercentage() { + return this.requiredPercentage; + } + + public void setItems(Map items) { + this.items = items; + } + + public void setCommands(Map commands) { + this.commands = commands; + } + + public void setMaxDrops(Integer maxDrops) { + this.maxDrops = maxDrops; + } + + public void setMaxCommands(Integer maxCommands) { + this.maxCommands = maxCommands; + } + + public void setRandomDrops(Boolean randomDrops) { + this.randomDrops = randomDrops; + } + + public void setRandomCommands(Boolean randomCommands) { + this.randomCommands = randomCommands; + } + + public void setRequiredPercentage(Double requiredPercentage) { + this.requiredPercentage = requiredPercentage; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java index 9dc12a6..706a537 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.droptable.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import java.util.Map; @@ -13,9 +11,12 @@ import java.util.Map; */ public class SprayTableElement { - @Expose @Getter @Setter private Map sprayRewards; - @Expose @Getter @Setter private Boolean randomSprayDrops; - @Expose @Getter @Setter private Integer sprayMaxDistance, sprayMaxDrops; + @Expose + private Map sprayRewards; + @Expose + private Boolean randomSprayDrops; + @Expose + private Integer sprayMaxDistance, sprayMaxDrops; public SprayTableElement(Map sprayRewards, Boolean randomSprayDrops, Integer sprayMaxDistance, Integer sprayMaxDrops) { this.sprayRewards = sprayRewards; @@ -24,4 +25,35 @@ public class SprayTableElement { this.sprayMaxDrops = sprayMaxDrops; } + public Map getSprayRewards() { + return this.sprayRewards; + } + + public Boolean getRandomSprayDrops() { + return this.randomSprayDrops; + } + + public Integer getSprayMaxDistance() { + return this.sprayMaxDistance; + } + + public Integer getSprayMaxDrops() { + return this.sprayMaxDrops; + } + + public void setSprayRewards(Map sprayRewards) { + this.sprayRewards = sprayRewards; + } + + public void setRandomSprayDrops(Boolean randomSprayDrops) { + this.randomSprayDrops = randomSprayDrops; + } + + public void setSprayMaxDistance(Integer sprayMaxDistance) { + this.sprayMaxDistance = sprayMaxDistance; + } + + public void setSprayMaxDrops(Integer sprayMaxDrops) { + this.sprayMaxDrops = sprayMaxDrops; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java index b658c9b..e23cc93 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java @@ -1,11 +1,7 @@ package com.songoda.epicbosses.entity; import com.google.gson.annotations.Expose; -import com.songoda.epicbosses.utils.StringUtils; -import lombok.Getter; -import lombok.Setter; import com.songoda.epicbosses.entity.elements.*; -import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder; import java.util.ArrayList; import java.util.List; @@ -17,15 +13,23 @@ import java.util.List; */ public class BossEntity { - @Expose @Getter @Setter private String spawnItem, targeting; - @Expose @Getter @Setter private boolean editing, buyable; - @Expose @Getter @Setter private Double price; + @Expose + private String spawnItem, targeting; + @Expose + private boolean editing, buyable; + @Expose + private Double price; - @Expose @Getter private final List entityStats; - @Expose @Getter private final MessagesElement messages; - @Expose @Getter private final CommandsElement commands; - @Expose @Getter private final SkillsElement skills; - @Expose @Getter private final DropsElement drops; + @Expose + private final List entityStats; + @Expose + private final MessagesElement messages; + @Expose + private final CommandsElement commands; + @Expose + private final SkillsElement skills; + @Expose + private final DropsElement drops; public BossEntity(boolean editing, String spawnItem, String targeting, boolean buyable, Double price, List entityStats, SkillsElement skills, DropsElement drops, MessagesElement messages, CommandsElement commands) { this.editing = editing; @@ -101,4 +105,64 @@ public class BossEntity { public boolean canBeBought() { return !isEditing() && isBuyable() && (getPrice() != null) && isCompleteEnoughToSpawn(); } + + public String getSpawnItem() { + return this.spawnItem; + } + + public String getTargeting() { + return this.targeting; + } + + public boolean isEditing() { + return this.editing; + } + + public boolean isBuyable() { + return this.buyable; + } + + public Double getPrice() { + return this.price; + } + + public List getEntityStats() { + return this.entityStats; + } + + public MessagesElement getMessages() { + return this.messages; + } + + public CommandsElement getCommands() { + return this.commands; + } + + public SkillsElement getSkills() { + return this.skills; + } + + public DropsElement getDrops() { + return this.drops; + } + + public void setSpawnItem(String spawnItem) { + this.spawnItem = spawnItem; + } + + public void setTargeting(String targeting) { + this.targeting = targeting; + } + + public void setEditing(boolean editing) { + this.editing = editing; + } + + public void setBuyable(boolean buyable) { + this.buyable = buyable; + } + + public void setPrice(Double price) { + this.price = price; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java index 02c24b1..a6103c8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java @@ -1,9 +1,7 @@ package com.songoda.epicbosses.entity; import com.google.gson.annotations.Expose; -import com.songoda.epicbosses.entity.elements.*; -import lombok.Getter; -import lombok.Setter; +import com.songoda.epicbosses.entity.elements.EntityStatsElement; import java.util.List; @@ -14,13 +12,36 @@ import java.util.List; */ public class MinionEntity { - @Expose @Getter private final List entityStats; + @Expose + private final List entityStats; - @Expose @Getter @Setter private String targeting; - @Expose @Getter @Setter private boolean editing; + @Expose + private String targeting; + @Expose + private boolean editing; public MinionEntity(boolean editing, List entityStats) { this.editing = editing; this.entityStats = entityStats; } + + public List getEntityStats() { + return this.entityStats; + } + + public String getTargeting() { + return this.targeting; + } + + public boolean isEditing() { + return this.editing; + } + + public void setTargeting(String targeting) { + this.targeting = targeting; + } + + public void setEditing(boolean editing) { + this.editing = editing; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java index 2db9fb0..ca7cc33 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,11 +9,27 @@ import lombok.Setter; */ public class CommandsElement { - @Expose @Getter @Setter private String onSpawn, onDeath; + @Expose + private String onSpawn, onDeath; public CommandsElement(String onSpawn, String onDeath) { this.onDeath = onDeath; this.onSpawn = onSpawn; } + public String getOnSpawn() { + return this.onSpawn; + } + + public String getOnDeath() { + return this.onDeath; + } + + public void setOnSpawn(String onSpawn) { + this.onSpawn = onSpawn; + } + + public void setOnDeath(String onDeath) { + this.onDeath = onDeath; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java index 55c0b77..cc91d83 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,8 +9,10 @@ import lombok.Setter; */ public class DropsElement { - @Expose @Getter @Setter private Boolean naturalDrops, dropExp; - @Expose @Getter @Setter private String dropTable; + @Expose + private Boolean naturalDrops, dropExp; + @Expose + private String dropTable; public DropsElement(Boolean naturalDrops, Boolean dropExp, String dropTable) { this.naturalDrops = naturalDrops; @@ -20,4 +20,27 @@ public class DropsElement { this.dropTable = dropTable; } + public Boolean getNaturalDrops() { + return this.naturalDrops; + } + + public Boolean getDropExp() { + return this.dropExp; + } + + public String getDropTable() { + return this.dropTable; + } + + public void setNaturalDrops(Boolean naturalDrops) { + this.naturalDrops = naturalDrops; + } + + public void setDropExp(Boolean dropExp) { + this.dropExp = dropExp; + } + + public void setDropTable(String dropTable) { + this.dropTable = dropTable; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java index b85c801..b439959 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder; import java.util.List; @@ -14,10 +12,14 @@ import java.util.List; */ public class EntityStatsElement { - @Expose @Getter @Setter private MainStatsElement mainStats; - @Expose @Getter @Setter private EquipmentElement equipment; - @Expose @Getter @Setter private HandsElement hands; - @Expose @Getter @Setter private List potions; + @Expose + private MainStatsElement mainStats; + @Expose + private EquipmentElement equipment; + @Expose + private HandsElement hands; + @Expose + private List potions; public EntityStatsElement(MainStatsElement mainStatsElement, EquipmentElement equipmentElement, HandsElement handsElement, List potionEffectHolders) { this.mainStats = mainStatsElement; @@ -26,4 +28,35 @@ public class EntityStatsElement { this.potions = potionEffectHolders; } + public MainStatsElement getMainStats() { + return this.mainStats; + } + + public EquipmentElement getEquipment() { + return this.equipment; + } + + public HandsElement getHands() { + return this.hands; + } + + public List getPotions() { + return this.potions; + } + + public void setMainStats(MainStatsElement mainStats) { + this.mainStats = mainStats; + } + + public void setEquipment(EquipmentElement equipment) { + this.equipment = equipment; + } + + public void setHands(HandsElement hands) { + this.hands = hands; + } + + public void setPotions(List potions) { + this.potions = potions; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java index c64fa1f..ca4962d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,7 +9,8 @@ import lombok.Setter; */ public class EquipmentElement { - @Expose @Getter @Setter private String helmet, chestplate, leggings, boots; + @Expose + private String helmet, chestplate, leggings, boots; public EquipmentElement(String helmet, String chestplate, String leggings, String boots) { this.helmet = helmet; @@ -20,4 +19,35 @@ public class EquipmentElement { this.boots = boots; } + public String getHelmet() { + return this.helmet; + } + + public String getChestplate() { + return this.chestplate; + } + + public String getLeggings() { + return this.leggings; + } + + public String getBoots() { + return this.boots; + } + + public void setHelmet(String helmet) { + this.helmet = helmet; + } + + public void setChestplate(String chestplate) { + this.chestplate = chestplate; + } + + public void setLeggings(String leggings) { + this.leggings = leggings; + } + + public void setBoots(String boots) { + this.boots = boots; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java index 7c2e2d0..a196dbf 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,11 +9,27 @@ import lombok.Setter; */ public class HandsElement { - @Expose @Getter @Setter private String mainHand, offHand; + @Expose + private String mainHand, offHand; public HandsElement(String mainHand, String offHand) { this.mainHand = mainHand; this.offHand = offHand; } + public String getMainHand() { + return this.mainHand; + } + + public String getOffHand() { + return this.offHand; + } + + public void setMainHand(String mainHand) { + this.mainHand = mainHand; + } + + public void setOffHand(String offHand) { + this.offHand = offHand; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java index ab4457e..5cf2012 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,10 +9,14 @@ import lombok.Setter; */ public class MainStatsElement { - @Expose @Getter @Setter private Integer position; - @Expose @Getter @Setter private String entityType; - @Expose @Getter @Setter private Double health; - @Expose @Getter @Setter private String displayName; + @Expose + private Integer position; + @Expose + private String entityType; + @Expose + private Double health; + @Expose + private String displayName; public MainStatsElement(Integer position, String entityType, Double health, String displayName) { this.position = position; @@ -23,4 +25,35 @@ public class MainStatsElement { this.displayName = displayName; } + public Integer getPosition() { + return this.position; + } + + public String getEntityType() { + return this.entityType; + } + + public Double getHealth() { + return this.health; + } + + public String getDisplayName() { + return this.displayName; + } + + public void setPosition(Integer position) { + this.position = position; + } + + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + public void setHealth(Double health) { + this.health = health; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java index c45e407..d1db06b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,9 +9,12 @@ import lombok.Setter; */ public class MessagesElement { - @Expose @Getter @Setter private OnSpawnMessageElement onSpawn; - @Expose @Getter @Setter private OnDeathMessageElement onDeath; - @Expose @Getter @Setter private TauntElement taunts; + @Expose + private OnSpawnMessageElement onSpawn; + @Expose + private OnDeathMessageElement onDeath; + @Expose + private TauntElement taunts; public MessagesElement(OnSpawnMessageElement onSpawn, OnDeathMessageElement onDeath, TauntElement tauntElement) { this.onDeath = onDeath; @@ -21,4 +22,27 @@ public class MessagesElement { this.taunts = tauntElement; } + public OnSpawnMessageElement getOnSpawn() { + return this.onSpawn; + } + + public OnDeathMessageElement getOnDeath() { + return this.onDeath; + } + + public TauntElement getTaunts() { + return this.taunts; + } + + public void setOnSpawn(OnSpawnMessageElement onSpawn) { + this.onSpawn = onSpawn; + } + + public void setOnDeath(OnDeathMessageElement onDeath) { + this.onDeath = onDeath; + } + + public void setTaunts(TauntElement taunts) { + this.taunts = taunts; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java index c22e13c..a3a3596 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,8 +9,10 @@ import lombok.Setter; */ public class OnDeathMessageElement { - @Expose @Getter @Setter private String message, positionMessage; - @Expose @Getter @Setter private Integer radius, onlyShow; + @Expose + private String message, positionMessage; + @Expose + private Integer radius, onlyShow; public OnDeathMessageElement(String message, String positionMessage, Integer radius, Integer onlyShow) { this.message = message; @@ -20,4 +20,36 @@ public class OnDeathMessageElement { this.radius = radius; this.onlyShow = onlyShow; } + + public String getMessage() { + return this.message; + } + + public String getPositionMessage() { + return this.positionMessage; + } + + public Integer getRadius() { + return this.radius; + } + + public Integer getOnlyShow() { + return this.onlyShow; + } + + public void setMessage(String message) { + this.message = message; + } + + public void setPositionMessage(String positionMessage) { + this.positionMessage = positionMessage; + } + + public void setRadius(Integer radius) { + this.radius = radius; + } + + public void setOnlyShow(Integer onlyShow) { + this.onlyShow = onlyShow; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java index 109fed3..a498547 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,12 +9,29 @@ import lombok.Setter; */ public class OnSpawnMessageElement { - @Expose @Getter @Setter private String message; - @Expose @Getter @Setter private Integer radius; + @Expose + private String message; + @Expose + private Integer radius; public OnSpawnMessageElement(String message, Integer radius) { this.message = message; this.radius = radius; } + public String getMessage() { + return this.message; + } + + public Integer getRadius() { + return this.radius; + } + + public void setMessage(String message) { + this.message = message; + } + + public void setRadius(Integer radius) { + this.radius = radius; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java index b5a40c9..168040c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import java.util.List; @@ -13,9 +11,12 @@ import java.util.List; */ public class SkillsElement { - @Expose @Getter @Setter private Double overallChance; - @Expose @Getter @Setter private String masterMessage; - @Expose @Getter @Setter private List skills; + @Expose + private Double overallChance; + @Expose + private String masterMessage; + @Expose + private List skills; public SkillsElement(Double overallChance, String masterMessage, List skills) { this.overallChance = overallChance; @@ -23,4 +24,27 @@ public class SkillsElement { this.skills = skills; } + public Double getOverallChance() { + return this.overallChance; + } + + public String getMasterMessage() { + return this.masterMessage; + } + + public List getSkills() { + return this.skills; + } + + public void setOverallChance(Double overallChance) { + this.overallChance = overallChance; + } + + public void setMasterMessage(String masterMessage) { + this.masterMessage = masterMessage; + } + + public void setSkills(List skills) { + this.skills = skills; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java index c9fe9be..99c5ec4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.entity.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import java.util.List; @@ -13,8 +11,10 @@ import java.util.List; */ public class TauntElement { - @Expose @Getter @Setter private Integer delay, radius; - @Expose @Getter @Setter private List taunts; + @Expose + private Integer delay, radius; + @Expose + private List taunts; public TauntElement(Integer delay, Integer radius, List taunts) { this.delay = delay; @@ -22,4 +22,27 @@ public class TauntElement { this.taunts = taunts; } + public Integer getDelay() { + return this.delay; + } + + public Integer getRadius() { + return this.radius; + } + + public List getTaunts() { + return this.taunts; + } + + public void setDelay(Integer delay) { + this.delay = delay; + } + + public void setRadius(Integer radius) { + this.radius = radius; + } + + public void setTaunts(List taunts) { + this.taunts = taunts; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java index 4ec8051..3a4cabc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.events; -import lombok.Getter; import com.songoda.epicbosses.holder.ActiveBossHolder; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; @@ -16,10 +15,10 @@ public class BossDamageEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private ActiveBossHolder activeBossHolder; - @Getter private LivingEntity livingEntity; - @Getter private Location damageLocation; - @Getter private double damage; + private ActiveBossHolder activeBossHolder; + private LivingEntity livingEntity; + private Location damageLocation; + private double damage; public BossDamageEvent(ActiveBossHolder activeBossHolder, LivingEntity livingEntity, Location damageLocation, double damageAmount) { this.activeBossHolder = activeBossHolder; @@ -36,4 +35,20 @@ public class BossDamageEvent extends Event { public static HandlerList getHandlerList() { return handlers; } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } + + public LivingEntity getLivingEntity() { + return this.livingEntity; + } + + public Location getDamageLocation() { + return this.damageLocation; + } + + public double getDamage() { + return this.damage; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java index 582759d..1b326dc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.events; -import lombok.Getter; import com.songoda.epicbosses.holder.ActiveBossHolder; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -14,8 +13,8 @@ public class BossDeathEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private final ActiveBossHolder activeBossHolder; - @Getter private final boolean autoSpawn; + private final ActiveBossHolder activeBossHolder; + private final boolean autoSpawn; public BossDeathEvent(ActiveBossHolder activeBossHolder, boolean autoSpawn) { this.activeBossHolder = activeBossHolder; @@ -30,4 +29,12 @@ public class BossDeathEvent extends Event { public static HandlerList getHandlerList() { return handlers; } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } + + public boolean isAutoSpawn() { + return this.autoSpawn; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java index 869710a..121057a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java @@ -1,9 +1,8 @@ package com.songoda.epicbosses.events; import com.songoda.epicbosses.holder.ActiveBossHolder; -import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.skills.Skill; -import lombok.Getter; +import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -16,9 +15,9 @@ public class BossSkillEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private ActiveBossHolder activeBossHolder; - @Getter private ISkillHandler skillHandler; - @Getter private Skill skill; + private ActiveBossHolder activeBossHolder; + private ISkillHandler skillHandler; + private Skill skill; public BossSkillEvent(ActiveBossHolder activeBossHolder, ISkillHandler skillHandler, Skill skill) { this.activeBossHolder = activeBossHolder; @@ -34,4 +33,16 @@ public class BossSkillEvent extends Event { public static HandlerList getHandlerList() { return handlers; } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } + + public ISkillHandler getSkillHandler() { + return this.skillHandler; + } + + public Skill getSkill() { + return this.skill; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java index 288a38e..8c57912 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.events; -import lombok.Getter; import com.songoda.epicbosses.holder.ActiveBossHolder; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -14,8 +13,8 @@ public class BossSpawnEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private final ActiveBossHolder activeBossHolder; - @Getter private final boolean autoSpawn; + private final ActiveBossHolder activeBossHolder; + private final boolean autoSpawn; public BossSpawnEvent(ActiveBossHolder activeBossHolder, boolean autoSpawn) { this.activeBossHolder = activeBossHolder; @@ -30,4 +29,12 @@ public class BossSpawnEvent extends Event { public static HandlerList getHandlerList() { return handlers; } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } + + public boolean isAutoSpawn() { + return this.autoSpawn; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java index 26208cb..74858f4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.events; -import lombok.Getter; import com.songoda.epicbosses.holder.ActiveBossHolder; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -16,9 +15,9 @@ public class PreBossDeathEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private ActiveBossHolder activeBossHolder; - @Getter private Location location; - @Getter private Player killer; + private ActiveBossHolder activeBossHolder; + private Location location; + private Player killer; public PreBossDeathEvent(ActiveBossHolder activeBossHolder, Location location, Player killer) { this.activeBossHolder = activeBossHolder; @@ -34,4 +33,16 @@ public class PreBossDeathEvent extends Event { public static HandlerList getHandlerList() { return handlers; } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } + + public Location getLocation() { + return this.location; + } + + public Player getKiller() { + return this.killer; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java index 59b6555..d79cb25 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.events; import com.songoda.epicbosses.holder.ActiveBossHolder; -import lombok.Getter; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -15,8 +14,8 @@ public class PreBossSkillEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private LivingEntity livingEntityDamaged, damagingEntity; - @Getter private ActiveBossHolder activeBossHolder; + private LivingEntity livingEntityDamaged, damagingEntity; + private ActiveBossHolder activeBossHolder; public PreBossSkillEvent(ActiveBossHolder activeBossHolder, LivingEntity livingEntity, LivingEntity damagingEntity) { this.activeBossHolder = activeBossHolder; @@ -32,4 +31,16 @@ public class PreBossSkillEvent extends Event { public static HandlerList getHandlerList() { return handlers; } + + public LivingEntity getLivingEntityDamaged() { + return this.livingEntityDamaged; + } + + public LivingEntity getDamagingEntity() { + return this.damagingEntity; + } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java index a456c36..ec9a476 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.events; import com.songoda.epicbosses.holder.ActiveBossHolder; -import lombok.Getter; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -14,7 +13,7 @@ public class PreBossSpawnEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private ActiveBossHolder activeBossHolder; + private ActiveBossHolder activeBossHolder; public PreBossSpawnEvent(ActiveBossHolder activeBossHolder) { this.activeBossHolder = activeBossHolder; @@ -28,4 +27,8 @@ public class PreBossSpawnEvent extends Event { public static HandlerList getHandlerList() { return handlers; } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java index b7274d9..1f62f0e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java @@ -1,9 +1,7 @@ package com.songoda.epicbosses.events; -import lombok.Getter; import com.songoda.epicbosses.holder.ActiveBossHolder; import org.bukkit.entity.Player; -import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.bukkit.inventory.ItemStack; @@ -16,8 +14,8 @@ public class PreBossSpawnItemEvent extends PreBossSpawnEvent { private static final HandlerList handlers = new HandlerList(); - @Getter private ItemStack itemStackUsed; - @Getter private Player player; + private ItemStack itemStackUsed; + private Player player; public PreBossSpawnItemEvent(ActiveBossHolder activeBossHolder, Player player, ItemStack itemStackUsed) { super(activeBossHolder); @@ -34,4 +32,12 @@ public class PreBossSpawnItemEvent extends PreBossSpawnEvent { public static HandlerList getHandlerList() { return handlers; } + + public ItemStack getItemStackUsed() { + return this.itemStackUsed; + } + + public Player getPlayer() { + return this.player; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/ConfigFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/DisplayFileHandler.java similarity index 69% rename from plugin-modules/Core/src/com/songoda/epicbosses/file/ConfigFileHandler.java rename to plugin-modules/Core/src/com/songoda/epicbosses/file/DisplayFileHandler.java index c1a91cd..19e9b69 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/ConfigFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/DisplayFileHandler.java @@ -10,9 +10,9 @@ import java.io.File; * @version 1.0.0 * @since 11-Oct-18 */ -public class ConfigFileHandler extends YmlFileHandler { +public class DisplayFileHandler extends YmlFileHandler { - public ConfigFileHandler(JavaPlugin javaPlugin) { - super(javaPlugin, true, new File(javaPlugin.getDataFolder(), "config.yml")); + public DisplayFileHandler(JavaPlugin javaPlugin) { + super(javaPlugin, true, new File(javaPlugin.getDataFolder(), "display.yml")); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java index 720e2dd..589d544 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java @@ -5,8 +5,6 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; import com.songoda.epicbosses.utils.file.FileHandler; -import com.songoda.epicbosses.utils.file.FileUtils; -import com.songoda.epicbosses.utils.file.IFileHandler; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; import org.bukkit.plugin.java.JavaPlugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java index 39d93e4..89be6d0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java @@ -4,7 +4,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; -import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.utils.file.FileHandler; import org.bukkit.plugin.java.JavaPlugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java index 2aa4c55..c5270b4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement; @@ -8,8 +8,6 @@ import com.songoda.epicbosses.managers.files.AutoSpawnFileManager; import com.songoda.epicbosses.utils.IHandler; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -25,14 +23,14 @@ import java.util.UUID; */ public abstract class AutoSpawnVariableHandler implements IHandler { - @Getter private final IVariablePanelHandler panelHandler; + private final IVariablePanelHandler panelHandler; - @Getter private final IntervalSpawnElement intervalSpawnElement; - @Getter private final AutoSpawnFileManager autoSpawnFileManager; - @Getter private final AutoSpawn autoSpawn; - @Getter private final Player player; + private final IntervalSpawnElement intervalSpawnElement; + private final AutoSpawnFileManager autoSpawnFileManager; + private final AutoSpawn autoSpawn; + private final Player player; - @Getter @Setter private boolean handled = false; + private boolean handled = false; private Listener listener; public AutoSpawnVariableHandler(Player player, AutoSpawn autoSpawn, IntervalSpawnElement intervalSpawnElement, AutoSpawnFileManager autoSpawnFileManager, IVariablePanelHandler panelHandler) { @@ -69,7 +67,7 @@ public abstract class AutoSpawnVariableHandler implements IHandler { } if(input == null) { - Bukkit.getScheduler().scheduleSyncDelayedTask(CustomBosses.get(), AutoSpawnVariableHandler.this::finish); + Bukkit.getScheduler().scheduleSyncDelayedTask(EpicBosses.getInstance(), AutoSpawnVariableHandler.this::finish); return; } @@ -80,7 +78,7 @@ public abstract class AutoSpawnVariableHandler implements IHandler { event.setCancelled(true); setHandled(true); - Bukkit.getScheduler().scheduleSyncDelayedTask(CustomBosses.get(), AutoSpawnVariableHandler.this::finish); + Bukkit.getScheduler().scheduleSyncDelayedTask(EpicBosses.getInstance(), AutoSpawnVariableHandler.this::finish); } }; } @@ -89,4 +87,32 @@ public abstract class AutoSpawnVariableHandler implements IHandler { AsyncPlayerChatEvent.getHandlerList().unregister(this.listener); getPanelHandler().openFor(getPlayer(), getAutoSpawn()); } + + public IVariablePanelHandler getPanelHandler() { + return this.panelHandler; + } + + public IntervalSpawnElement getIntervalSpawnElement() { + return this.intervalSpawnElement; + } + + public AutoSpawnFileManager getAutoSpawnFileManager() { + return this.autoSpawnFileManager; + } + + public AutoSpawn getAutoSpawn() { + return this.autoSpawn; + } + + public Player getPlayer() { + return this.player; + } + + public boolean isHandled() { + return this.handled; + } + + public void setHandled(boolean handled) { + this.handled = handled; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java index 9e0724d..78f7023 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java @@ -1,14 +1,12 @@ package com.songoda.epicbosses.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.utils.IHandler; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -24,14 +22,14 @@ import java.util.UUID; */ public class BossDisplayNameHandler implements IHandler { - @Getter private final ISubVariablePanelHandler panelHandler; + private final ISubVariablePanelHandler panelHandler; - @Getter private final EntityStatsElement entityStatsElement; - @Getter private final BossesFileManager bossesFileManager; - @Getter private final BossEntity bossEntity; - @Getter private final Player player; + private final EntityStatsElement entityStatsElement; + private final BossesFileManager bossesFileManager; + private final BossEntity bossEntity; + private final Player player; - @Getter @Setter private boolean handled = false; + private boolean handled = false; private Listener listener; public BossDisplayNameHandler(Player player, BossEntity bossEntity, EntityStatsElement entityStatsElement, BossesFileManager bossesFileManager, ISubVariablePanelHandler panelHandler) { @@ -70,7 +68,7 @@ public class BossDisplayNameHandler implements IHandler { event.setCancelled(true); setHandled(true); - Bukkit.getScheduler().scheduleSyncDelayedTask(CustomBosses.get(), BossDisplayNameHandler.this::finish); + Bukkit.getScheduler().scheduleSyncDelayedTask(EpicBosses.getInstance(), BossDisplayNameHandler.this::finish); } }; } @@ -79,4 +77,32 @@ public class BossDisplayNameHandler implements IHandler { AsyncPlayerChatEvent.getHandlerList().unregister(this.listener); getPanelHandler().openFor(getPlayer(), getBossEntity(), getEntityStatsElement()); } + + public ISubVariablePanelHandler getPanelHandler() { + return this.panelHandler; + } + + public EntityStatsElement getEntityStatsElement() { + return this.entityStatsElement; + } + + public BossesFileManager getBossesFileManager() { + return this.bossesFileManager; + } + + public BossEntity getBossEntity() { + return this.bossEntity; + } + + public Player getPlayer() { + return this.player; + } + + public boolean isHandled() { + return this.handled; + } + + public void setHandled(boolean handled) { + this.handled = handled; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java index 95794db..5a60c42 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.files.BossesFileManager; @@ -9,8 +9,6 @@ import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -26,13 +24,13 @@ import java.util.UUID; */ public class BossShopPriceHandler implements IHandler { - @Getter private final IVariablePanelHandler panelHandler; + private final IVariablePanelHandler panelHandler; - @Getter private final BossesFileManager bossesFileManager; - @Getter private final BossEntity bossEntity; - @Getter private final Player player; + private final BossesFileManager bossesFileManager; + private final BossEntity bossEntity; + private final Player player; - @Getter @Setter private boolean handled = false; + private boolean handled = false; private Listener listener; public BossShopPriceHandler(Player player, BossEntity bossEntity, BossesFileManager bossesFileManager, IVariablePanelHandler panelHandler) { @@ -74,7 +72,7 @@ public class BossShopPriceHandler implements IHandler { setHandled(true); Message.Boss_Edit_PriceSet.msg(getPlayer(), BossAPI.getBossEntityName(getBossEntity()), NumberUtils.get().formatDouble(amount)); - Bukkit.getScheduler().scheduleSyncDelayedTask(CustomBosses.get(), BossShopPriceHandler.this::finish); + Bukkit.getScheduler().scheduleSyncDelayedTask(EpicBosses.getInstance(), BossShopPriceHandler.this::finish); } else { Message.Boss_Edit_Price.msg(getPlayer(), BossAPI.getBossEntityName(getBossEntity())); } @@ -86,4 +84,28 @@ public class BossShopPriceHandler implements IHandler { AsyncPlayerChatEvent.getHandlerList().unregister(this.listener); getPanelHandler().openFor(getPlayer(), getBossEntity()); } + + public IVariablePanelHandler getPanelHandler() { + return this.panelHandler; + } + + public BossesFileManager getBossesFileManager() { + return this.bossesFileManager; + } + + public BossEntity getBossEntity() { + return this.bossEntity; + } + + public Player getPlayer() { + return this.player; + } + + public boolean isHandled() { + return this.handled; + } + + public void setHandled(boolean handled) { + this.handled = handled; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java index 8dc2b2e..581edec 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java @@ -1,13 +1,11 @@ package com.songoda.epicbosses.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.managers.files.SkillsFileManager; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.utils.IHandler; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -23,12 +21,12 @@ import java.util.UUID; */ public class SkillDisplayNameHandler implements IHandler { - @Getter private final IVariablePanelHandler panelHandler; - @Getter private final SkillsFileManager skillsFileManager; - @Getter private final Player player; - @Getter private final Skill skill; + private final IVariablePanelHandler panelHandler; + private final SkillsFileManager skillsFileManager; + private final Player player; + private final Skill skill; - @Getter @Setter private boolean handled = false; + private boolean handled = false; private Listener listener; public SkillDisplayNameHandler(Player player, Skill skill, SkillsFileManager skillsFileManager, IVariablePanelHandler panelHandler) { @@ -66,7 +64,7 @@ public class SkillDisplayNameHandler implements IHandler { event.setCancelled(true); setHandled(true); - Bukkit.getScheduler().scheduleSyncDelayedTask(CustomBosses.get(), SkillDisplayNameHandler.this::finish); + Bukkit.getScheduler().scheduleSyncDelayedTask(EpicBosses.getInstance(), SkillDisplayNameHandler.this::finish); } }; } @@ -75,4 +73,28 @@ public class SkillDisplayNameHandler implements IHandler { AsyncPlayerChatEvent.getHandlerList().unregister(this.listener); getPanelHandler().openFor(getPlayer(), getSkill()); } + + public IVariablePanelHandler getPanelHandler() { + return this.panelHandler; + } + + public SkillsFileManager getSkillsFileManager() { + return this.skillsFileManager; + } + + public Player getPlayer() { + return this.player; + } + + public Skill getSkill() { + return this.skill; + } + + public boolean isHandled() { + return this.handled; + } + + public void setHandled(boolean handled) { + this.handled = handled; + } } \ No newline at end of file diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java index cc93a1b..6eed199 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.handlers.droptable; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.handlers.IGetDropTableListItem; import com.songoda.epicbosses.managers.files.ItemsFileManager; @@ -17,7 +17,7 @@ public class GetDropTableItemStack implements IGetDropTableListItem { private ItemsFileManager itemsFileManager; - public GetDropTableItemStack(CustomBosses plugin) { + public GetDropTableItemStack(EpicBosses plugin) { this.itemsFileManager = plugin.getItemStackManager(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveAutoSpawnHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveAutoSpawnHolder.java index 8d2980e..99f8091 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveAutoSpawnHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveAutoSpawnHolder.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.holder; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.autospawns.SpawnType; -import lombok.Getter; import java.util.ArrayList; import java.util.List; @@ -14,10 +13,10 @@ import java.util.List; */ public class ActiveAutoSpawnHolder { - @Getter private final SpawnType spawnType; - @Getter private final AutoSpawn autoSpawn; + private final SpawnType spawnType; + private final AutoSpawn autoSpawn; - @Getter private List activeBossHolders = new ArrayList<>(); + private List activeBossHolders = new ArrayList<>(); public ActiveAutoSpawnHolder(SpawnType spawnType, AutoSpawn autoSpawn) { this.autoSpawn = autoSpawn; @@ -36,4 +35,15 @@ public class ActiveAutoSpawnHolder { this.activeBossHolders.clear(); } + public SpawnType getSpawnType() { + return this.spawnType; + } + + public AutoSpawn getAutoSpawn() { + return this.autoSpawn; + } + + public List getActiveBossHolders() { + return this.activeBossHolders; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java index 7808885..0619ec5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java @@ -1,13 +1,10 @@ package com.songoda.epicbosses.holder; -import com.songoda.epicbosses.listeners.IBossDeathHandler; -import com.songoda.epicbosses.utils.ServerUtils; -import lombok.Getter; -import lombok.Setter; -import com.songoda.epicbosses.targeting.TargetHandler; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.exception.AlreadySetException; -import org.bukkit.Bukkit; +import com.songoda.epicbosses.listeners.IBossDeathHandler; +import com.songoda.epicbosses.targeting.TargetHandler; +import com.songoda.epicbosses.utils.ServerUtils; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Entity; @@ -23,18 +20,18 @@ import java.util.*; */ public class ActiveBossHolder implements IActiveHolder { - @Getter private final BossEntity bossEntity; - @Getter private final Location location; - @Getter private final String name; + private final BossEntity bossEntity; + private final Location location; + private final String name; - @Getter private Map activeMinionHolderMap = new HashMap<>(); - @Getter private Map livingEntityMap = new HashMap<>(); - @Getter private List postBossDeathHandlers = new ArrayList<>(); - @Getter private Map mapOfDamagingUsers = new HashMap<>(); - @Getter private String spawningPlayerName; + private Map activeMinionHolderMap = new HashMap<>(); + private Map livingEntityMap = new HashMap<>(); + private List postBossDeathHandlers = new ArrayList<>(); + private Map mapOfDamagingUsers = new HashMap<>(); + private String spawningPlayerName; - @Getter @Setter private TargetHandler targetHandler = null; - @Getter @Setter private boolean isDead = false, customSpawnMessage = false; + private TargetHandler targetHandler = null; + private boolean isDead = false, customSpawnMessage = false; public ActiveBossHolder(BossEntity bossEntity, Location spawnLocation, String name, Player spawningPlayer) { this.location = spawnLocation; @@ -100,4 +97,60 @@ public class ActiveBossHolder implements IActiveHolder { this.livingEntityMap.clear(); return true; } + + public BossEntity getBossEntity() { + return this.bossEntity; + } + + public Location getLocation() { + return this.location; + } + + public String getName() { + return this.name; + } + + public Map getActiveMinionHolderMap() { + return this.activeMinionHolderMap; + } + + public Map getLivingEntityMap() { + return this.livingEntityMap; + } + + public List getPostBossDeathHandlers() { + return this.postBossDeathHandlers; + } + + public Map getMapOfDamagingUsers() { + return this.mapOfDamagingUsers; + } + + public String getSpawningPlayerName() { + return this.spawningPlayerName; + } + + public TargetHandler getTargetHandler() { + return this.targetHandler; + } + + public boolean isDead() { + return this.isDead; + } + + public boolean isCustomSpawnMessage() { + return this.customSpawnMessage; + } + + public void setTargetHandler(TargetHandler targetHandler) { + this.targetHandler = targetHandler; + } + + public void setDead(boolean isDead) { + this.isDead = isDead; + } + + public void setCustomSpawnMessage(boolean customSpawnMessage) { + this.customSpawnMessage = customSpawnMessage; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java index a0f1f74..b8a4349 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java @@ -3,9 +3,6 @@ package com.songoda.epicbosses.holder; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.targeting.TargetHandler; import com.songoda.epicbosses.utils.ServerUtils; -import lombok.Getter; -import lombok.Setter; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; @@ -20,13 +17,13 @@ import java.util.UUID; */ public class ActiveMinionHolder implements IActiveHolder { - @Getter @Setter private TargetHandler targetHandler = null; + private TargetHandler targetHandler = null; - @Getter private Map livingEntityMap = new HashMap<>(); - @Getter private ActiveBossHolder activeBossHolder; - @Getter private final MinionEntity minionEntity; - @Getter private final Location location; - @Getter private final String name; + private Map livingEntityMap = new HashMap<>(); + private ActiveBossHolder activeBossHolder; + private final MinionEntity minionEntity; + private final Location location; + private final String name; public ActiveMinionHolder(ActiveBossHolder activeBossHolder, MinionEntity minionEntity, Location spawnLocation, String name) { this.activeBossHolder = activeBossHolder; @@ -87,4 +84,31 @@ public class ActiveMinionHolder implements IActiveHolder { return this.activeBossHolder.hasAttacked(uuid); } + public TargetHandler getTargetHandler() { + return this.targetHandler; + } + + public Map getLivingEntityMap() { + return this.livingEntityMap; + } + + public ActiveBossHolder getActiveBossHolder() { + return this.activeBossHolder; + } + + public MinionEntity getMinionEntity() { + return this.minionEntity; + } + + public Location getLocation() { + return this.location; + } + + public String getName() { + return this.name; + } + + public void setTargetHandler(TargetHandler targetHandler) { + this.targetHandler = targetHandler; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/DeadBossHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/DeadBossHolder.java index a613bcd..9c265ff 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/DeadBossHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/DeadBossHolder.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.holder; -import lombok.Getter; import com.songoda.epicbosses.entity.BossEntity; import org.bukkit.Location; @@ -14,9 +13,9 @@ import java.util.UUID; */ public class DeadBossHolder { - @Getter private final Map sortedDamageMap, percentageMap; - @Getter private final BossEntity bossEntity; - @Getter private final Location location; + private final Map sortedDamageMap, percentageMap; + private final BossEntity bossEntity; + private final Location location; public DeadBossHolder(BossEntity bossEntity, Location deathLocation, Map sortedDamageMap, Map percentageMap) { this.location = deathLocation; @@ -25,4 +24,19 @@ public class DeadBossHolder { this.percentageMap = percentageMap; } + public Map getSortedDamageMap() { + return this.sortedDamageMap; + } + + public Map getPercentageMap() { + return this.percentageMap; + } + + public BossEntity getBossEntity() { + return this.bossEntity; + } + + public Location getLocation() { + return this.location; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java index d55e91a..04aa976 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java @@ -4,8 +4,6 @@ import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.autospawns.SpawnType; import com.songoda.epicbosses.autospawns.types.IntervalSpawnElement; -import com.songoda.epicbosses.events.BossDeathEvent; -import com.songoda.epicbosses.events.PreBossDeathEvent; import com.songoda.epicbosses.holder.ActiveAutoSpawnHolder; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.listeners.IBossDeathHandler; @@ -14,10 +12,7 @@ import com.songoda.epicbosses.utils.ObjectUtils; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.time.TimeUnit; import com.songoda.epicbosses.utils.time.TimeUtil; -import lombok.Getter; import org.bukkit.Location; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; import org.bukkit.scheduler.BukkitTask; /** @@ -27,10 +22,10 @@ import org.bukkit.scheduler.BukkitTask; */ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { - @Getter private final IntervalSpawnElement intervalSpawnElement; + private final IntervalSpawnElement intervalSpawnElement; - @Getter private BukkitTask intervalTask = null; - @Getter private long nextCompletedTime = 0L; + private BukkitTask intervalTask = null; + private long nextCompletedTime = 0L; public ActiveIntervalAutoSpawnHolder(SpawnType spawnType, AutoSpawn autoSpawn) { super(spawnType, autoSpawn); @@ -173,4 +168,16 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { this.nextCompletedTime = System.currentTimeMillis() + delayMs; } + + public IntervalSpawnElement getIntervalSpawnElement() { + return this.intervalSpawnElement; + } + + public BukkitTask getIntervalTask() { + return this.intervalTask; + } + + public long getNextCompletedTime() { + return this.nextCompletedTime; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java index cd36a75..c0101f2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java @@ -1,13 +1,12 @@ package com.songoda.epicbosses.listeners.after; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.events.BossDeathEvent; import com.songoda.epicbosses.events.PreBossDeathEvent; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.holder.DeadBossHolder; -import com.songoda.epicbosses.listeners.IBossDeathHandler; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.MessageUtils; @@ -16,13 +15,15 @@ import com.songoda.epicbosses.utils.ServerUtils; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDeathEvent; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; /** * @author Charles Cullen @@ -33,7 +34,7 @@ public class BossDeathListener implements Listener { private BossEntityManager bossEntityManager; - public BossDeathListener(CustomBosses plugin) { + public BossDeathListener(EpicBosses plugin) { this.bossEntityManager = plugin.getBossEntityManager(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java index 3807871..358e8b9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.listeners.during; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.events.BossDamageEvent; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.BossEntityManager; @@ -20,7 +20,7 @@ public class BossDamageListener implements Listener { private BossEntityManager bossEntityManager; - public BossDamageListener(CustomBosses plugin) { + public BossDamageListener(EpicBosses plugin) { this.bossEntityManager = plugin.getBossEntityManager(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java index 578bfda..433eec6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java @@ -1,16 +1,13 @@ package com.songoda.epicbosses.listeners.during; -import com.songoda.epicbosses.CustomBosses; -import com.songoda.epicbosses.events.BossDamageEvent; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.managers.BossEntityManager; -import com.songoda.epicbosses.utils.ServerUtils; -import org.bukkit.entity.*; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityTargetLivingEntityEvent; /** @@ -22,7 +19,7 @@ public class BossMinionTargetListener implements Listener { private BossEntityManager bossEntityManager; - public BossMinionTargetListener(CustomBosses plugin) { + public BossMinionTargetListener(EpicBosses plugin) { this.bossEntityManager = plugin.getBossEntityManager(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java index 1ba604c..b25c527 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.listeners.during; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.events.PreBossSkillEvent; @@ -16,13 +16,14 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; -import org.bukkit.entity.ThrownPotion; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; /** * @author Charles Cullen @@ -35,7 +36,7 @@ public class BossSkillListener implements Listener { private SkillsFileManager skillsFileManager; private BossSkillManager bossSkillManager; - public BossSkillListener(CustomBosses plugin) { + public BossSkillListener(EpicBosses plugin) { this.bossSkillManager = plugin.getBossSkillManager(); this.bossEntityManager = plugin.getBossEntityManager(); this.skillsFileManager = plugin.getSkillsFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java index 2d8f66b..44a0dfc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.listeners.pre; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.events.BossSpawnEvent; @@ -10,14 +10,9 @@ import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.managers.BossLocationManager; import com.songoda.epicbosses.managers.BossTauntManager; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.MessageUtils; -import com.songoda.epicbosses.utils.NumberUtils; -import com.songoda.epicbosses.utils.ServerUtils; -import com.songoda.epicbosses.utils.StringUtils; +import com.songoda.epicbosses.utils.*; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.version.VersionHandler; -import java.util.ArrayList; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -30,6 +25,7 @@ import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -45,11 +41,11 @@ public class BossSpawnListener implements Listener { private BossTauntManager bossTauntManager; private VersionHandler versionHandler; - public BossSpawnListener(CustomBosses customBosses) { - this.versionHandler = customBosses.getVersionHandler(); - this.bossTauntManager = customBosses.getBossTauntManager(); - this.bossEntityManager = customBosses.getBossEntityManager(); - this.bossLocationManager = customBosses.getBossLocationManager(); + public BossSpawnListener(EpicBosses epicBosses) { + this.versionHandler = epicBosses.getVersionHandler(); + this.bossTauntManager = epicBosses.getBossTauntManager(); + this.bossEntityManager = epicBosses.getBossEntityManager(); + this.bossLocationManager = epicBosses.getBossLocationManager(); } @EventHandler diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java index 6cd9bd2..ff6869b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.autospawns.SpawnType; @@ -27,7 +27,7 @@ public class AutoSpawnManager { private AutoSpawnFileManager autoSpawnFileManager; - public AutoSpawnManager(CustomBosses plugin) { + public AutoSpawnManager(EpicBosses plugin) { this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java index 3e8762e..6777a6f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java @@ -1,9 +1,10 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.commands.boss.*; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.ILoadable; +import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.command.SubCommandService; /** @@ -15,11 +16,11 @@ public class BossCommandManager implements ILoadable { private SubCommandService commandService; private boolean hasBeenLoaded = false; - private CustomBosses customBosses; + private EpicBosses epicBosses; - public BossCommandManager(SubCommandService commandService, CustomBosses customBosses) { + public BossCommandManager(SubCommandService commandService, EpicBosses epicBosses) { this.commandService = commandService; - this.customBosses = customBosses; + this.epicBosses = epicBosses; } @Override @@ -29,24 +30,24 @@ public class BossCommandManager implements ILoadable { return; } - this.commandService.registerSubCommand(new BossCreateCmd(this.customBosses.getBossEntityContainer())); - this.commandService.registerSubCommand(new BossDebugCmd(this.customBosses.getDebugManager())); - this.commandService.registerSubCommand(new BossDropTableCmd(this.customBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossEditCmd(this.customBosses.getBossPanelManager(), this.customBosses.getBossEntityContainer())); - this.commandService.registerSubCommand(new BossGiveEggCmd(this.customBosses.getBossesFileManager(), this.customBosses.getBossEntityManager())); + this.commandService.registerSubCommand(new BossCreateCmd(this.epicBosses.getBossEntityContainer())); + this.commandService.registerSubCommand(new BossDebugCmd(this.epicBosses.getDebugManager())); + this.commandService.registerSubCommand(new BossDropTableCmd(this.epicBosses.getBossPanelManager())); + this.commandService.registerSubCommand(new BossEditCmd(this.epicBosses.getBossPanelManager(), this.epicBosses.getBossEntityContainer())); + this.commandService.registerSubCommand(new BossGiveEggCmd(this.epicBosses.getBossesFileManager(), this.epicBosses.getBossEntityManager())); this.commandService.registerSubCommand(new BossHelpCmd()); - this.commandService.registerSubCommand(new BossInfoCmd(this.customBosses.getBossesFileManager(), this.customBosses.getBossEntityManager())); - this.commandService.registerSubCommand(new BossItemsCmd(this.customBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossKillAllCmd(this.customBosses.getBossEntityManager())); - this.commandService.registerSubCommand(new BossListCmd(this.customBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossMenuCmd(this.customBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossNearbyCmd(this.customBosses)); - this.commandService.registerSubCommand(new BossNewCmd(this.customBosses)); - this.commandService.registerSubCommand(new BossReloadCmd(this.customBosses, this.customBosses.getBossEntityManager())); - this.commandService.registerSubCommand(new BossShopCmd(this.customBosses)); - this.commandService.registerSubCommand(new BossSkillsCmd(this.customBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossSpawnCmd(this.customBosses.getBossesFileManager())); - this.commandService.registerSubCommand(new BossTimeCmd(this.customBosses)); + this.commandService.registerSubCommand(new BossInfoCmd(this.epicBosses.getBossesFileManager(), this.epicBosses.getBossEntityManager())); + this.commandService.registerSubCommand(new BossItemsCmd(this.epicBosses.getBossPanelManager())); + this.commandService.registerSubCommand(new BossKillAllCmd(this.epicBosses.getBossEntityManager())); + this.commandService.registerSubCommand(new BossListCmd(this.epicBosses.getBossPanelManager())); + this.commandService.registerSubCommand(new BossMenuCmd(this.epicBosses.getBossPanelManager())); + this.commandService.registerSubCommand(new BossNearbyCmd(this.epicBosses)); + this.commandService.registerSubCommand(new BossNewCmd(this.epicBosses)); + this.commandService.registerSubCommand(new BossReloadCmd(this.epicBosses, this.epicBosses.getBossEntityManager())); + this.commandService.registerSubCommand(new BossShopCmd(this.epicBosses)); + this.commandService.registerSubCommand(new BossSkillsCmd(this.epicBosses.getBossPanelManager())); + this.commandService.registerSubCommand(new BossSpawnCmd(this.epicBosses.getBossesFileManager())); + this.commandService.registerSubCommand(new BossTimeCmd(this.epicBosses)); this.hasBeenLoaded = true; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java index 4ea8b57..8ae347d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; -import com.songoda.epicbosses.api.BossAPI; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.droptable.elements.DropTableElement; import com.songoda.epicbosses.droptable.elements.GiveTableElement; import com.songoda.epicbosses.droptable.elements.GiveTableSubElement; @@ -10,15 +9,11 @@ import com.songoda.epicbosses.handlers.IGetDropTableListItem; import com.songoda.epicbosses.handlers.droptable.GetDropTableCommand; import com.songoda.epicbosses.handlers.droptable.GetDropTableItemStack; import com.songoda.epicbosses.holder.DeadBossHolder; -import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.RandomUtils; import com.songoda.epicbosses.utils.ServerUtils; -import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; -import lombok.Getter; import org.bukkit.Bukkit; -import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -31,12 +26,12 @@ import java.util.*; */ public class BossDropTableManager { - @Getter private final List validDropTableTypes = Arrays.asList("SPRAY", "DROP", "GIVE"); + private final List validDropTableTypes = Arrays.asList("SPRAY", "DROP", "GIVE"); private final IGetDropTableListItem getDropTableItemStack; private final IGetDropTableListItem> getDropTableCommand; - public BossDropTableManager(CustomBosses plugin) { + public BossDropTableManager(EpicBosses plugin) { this.getDropTableItemStack = new GetDropTableItemStack(plugin); this.getDropTableCommand = new GetDropTableCommand(); } @@ -175,4 +170,7 @@ public class BossDropTableManager { return newListToMerge; } + public List getValidDropTableTypes() { + return this.validDropTableTypes; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java index e4adeed..f975560 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.managers; import com.google.gson.Gson; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.DropTableElement; @@ -17,14 +17,12 @@ import com.songoda.epicbosses.managers.files.DropTableFileManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.managers.files.MinionsFileManager; import com.songoda.epicbosses.skills.Skill; -import com.songoda.epicbosses.skills.custom.Minions; import com.songoda.epicbosses.skills.elements.CustomMinionSkillElement; import com.songoda.epicbosses.utils.BossesGson; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.RandomUtils; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Item; @@ -55,15 +53,15 @@ public class BossEntityManager { private BossesFileManager bossesFileManager; private BossTargetManager bossTargetManager; - public BossEntityManager(CustomBosses customBosses) { - this.minionMechanicManager = customBosses.getMinionMechanicManager(); - this.dropTableFileManager = customBosses.getDropTableFileManager(); - this.bossDropTableManager = customBosses.getBossDropTableManager(); - this.bossMechanicManager = customBosses.getBossMechanicManager(); - this.minionsFileManager = customBosses.getMinionsFileManager(); - this.bossItemFileManager = customBosses.getItemStackManager(); - this.bossesFileManager = customBosses.getBossesFileManager(); - this.bossTargetManager = customBosses.getBossTargetManager(); + public BossEntityManager(EpicBosses epicBosses) { + this.minionMechanicManager = epicBosses.getMinionMechanicManager(); + this.dropTableFileManager = epicBosses.getDropTableFileManager(); + this.bossDropTableManager = epicBosses.getBossDropTableManager(); + this.bossMechanicManager = epicBosses.getBossMechanicManager(); + this.minionsFileManager = epicBosses.getMinionsFileManager(); + this.bossItemFileManager = epicBosses.getItemStackManager(); + this.bossesFileManager = epicBosses.getBossesFileManager(); + this.bossTargetManager = epicBosses.getBossTargetManager(); } public double getRadius(ActiveBossHolder activeBossHolder, Location centerLocation) { @@ -117,7 +115,7 @@ public class BossEntityManager { } } - CustomBosses.get().getAutoSpawnManager().clearAutoSpawns(); + EpicBosses.getInstance().getAutoSpawnManager().clearAutoSpawns(); return amountOfBosses; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java index dbdc69f..c7d71b8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java @@ -1,24 +1,17 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.utils.Versions; -import com.songoda.epicbosses.utils.dependencies.WorldGuardHelper; -import com.songoda.epicbosses.utils.version.VersionHandler; -import lombok.Getter; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.utils.IASkyblockHelper; import com.songoda.epicbosses.utils.IFactionHelper; -import com.songoda.epicbosses.utils.IReloadable; -import com.songoda.epicbosses.utils.IWorldGuardHelper; import com.songoda.epicbosses.utils.dependencies.ASkyblockHelper; -import utils.factions.FactionsM; -import utils.factions.FactionsOne; -import utils.factions.FactionsUUID; -import utils.factions.LegacyFactions; -import com.songoda.epicbosses.utils.dependencies.WorldGuardLegacyHelper; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.plugin.Plugin; +import utils.factions.FactionsM; +import utils.factions.FactionsOne; +import utils.factions.FactionsUUID; +import utils.factions.LegacyFactions; import java.util.List; @@ -27,82 +20,87 @@ import java.util.List; * @version 1.0.0 * @since 16-Oct-18 */ -public class BossHookManager implements IReloadable { +public class BossHookManager { - @Getter private boolean askyblockEnabled, factionsEnabled, stackmobEnabled, worldguardEnabled; - @Getter private List worldGuardSpawnRegions, worldguardBlockedRegions; - @Getter private boolean askyblockOwnIsland, factionWarzone; + private boolean askyblockEnabled, factionsEnabled; + private boolean askyblockOwnIsland, factionWarzone; - @Getter private IWorldGuardHelper worldGuardHelper; - @Getter private IASkyblockHelper aSkyblockHelper; - @Getter private IFactionHelper factionHelper; + private IASkyblockHelper aSkyblockHelper; + private IFactionHelper factionHelper; - private final CustomBosses plugin; + private final EpicBosses plugin; - public BossHookManager(CustomBosses customBosses) { - this.plugin = customBosses; + public BossHookManager(EpicBosses epicBosses) { + this.plugin = epicBosses; } - @Override public void reload() { FileConfiguration config = this.plugin.getConfig(); ConfigurationSection askyblock = config.getConfigurationSection("Hooks.ASkyBlock"); ConfigurationSection factions = config.getConfigurationSection("Hooks.Factions"); - ConfigurationSection stackMob = config.getConfigurationSection("Hooks.StackMob"); - ConfigurationSection worldGuard = config.getConfigurationSection("Hooks.WorldGuard"); this.askyblockEnabled = askyblock.getBoolean("enabled", false); this.factionsEnabled = factions.getBoolean("enabled", false); - this.stackmobEnabled = stackMob.getBoolean("enabled", false); - this.worldguardEnabled = worldGuard.getBoolean("enabled", true); - - this.worldGuardSpawnRegions = worldGuard.getStringList("spawnRegions"); - this.worldguardBlockedRegions = worldGuard.getStringList("blockedRegions"); this.askyblockOwnIsland = askyblock.getBoolean("onOwnIsland", false); this.factionWarzone = factions.getBoolean("useWarzoneSpawnRegion", false); setupFactions(); - setupWorldGuard(); setupAskyblock(); } private void setupAskyblock() { - if(!isAskyblockEnabled()) return; + if (!isAskyblockEnabled()) return; this.aSkyblockHelper = new ASkyblockHelper(); } - private void setupWorldGuard() { - if(!isWorldguardEnabled()) return; - - if (new VersionHandler().getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1)) { - this.worldGuardHelper = new WorldGuardHelper(); - } else { - this.worldGuardHelper = new WorldGuardLegacyHelper(); - } - } - private void setupFactions() { - if(!isFactionsEnabled()) return; + if (!isFactionsEnabled()) return; - if(Bukkit.getServer().getPluginManager().getPlugin("LegacyFactions") != null) { + if (Bukkit.getServer().getPluginManager().getPlugin("LegacyFactions") != null) { this.factionHelper = new LegacyFactions(); } - if(Bukkit.getServer().getPluginManager().getPlugin("Factions") == null) return; + if (Bukkit.getServer().getPluginManager().getPlugin("Factions") == null) return; Plugin factions = Bukkit.getServer().getPluginManager().getPlugin("Factions"); String version = factions.getDescription().getVersion(); String uuidVer = "1.6."; String oneVer = "1.8."; - if(version.startsWith(uuidVer)) { + if (version.startsWith(uuidVer)) { this.factionHelper = new FactionsUUID(); - } else if(version.startsWith(oneVer)) { + } else if (version.startsWith(oneVer)) { this.factionHelper = new FactionsOne(); } else { this.factionHelper = new FactionsM(); } } + + public boolean isAskyblockEnabled() { + return this.askyblockEnabled; + } + + public boolean isFactionsEnabled() { + return this.factionsEnabled; + } + + public boolean isAskyblockOwnIsland() { + return this.askyblockOwnIsland; + } + + //ToDo: This isnt even used 0.o + public boolean isFactionWarzone() { + return this.factionWarzone; + } + + public IFactionHelper getFactionHelper() { + return factionHelper; + } + + public IASkyblockHelper getASkyblockHelper() { + return this.aSkyblockHelper; + } + } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java index 293445d..1e3019e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.listeners.after.BossDeathListener; import com.songoda.epicbosses.listeners.during.BossDamageListener; import com.songoda.epicbosses.listeners.during.BossMinionTargetListener; @@ -18,9 +18,9 @@ import com.songoda.epicbosses.utils.ServerUtils; public class BossListenerManager implements ILoadable { private boolean hasBeenLoaded = false; - private CustomBosses plugin; + private EpicBosses plugin; - public BossListenerManager(CustomBosses plugin) { + public BossListenerManager(EpicBosses plugin) { this.plugin = plugin; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java index 1e0bed1..7f41f6e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java @@ -1,9 +1,9 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.utils.ServerUtils; -import lombok.Getter; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.core.hooks.WorldGuardHook; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.utils.IReloadable; +import com.songoda.epicbosses.utils.ServerUtils; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.configuration.file.FileConfiguration; @@ -18,15 +18,15 @@ import java.util.List; */ public class BossLocationManager implements IReloadable { - @Getter private boolean useBlockedWorlds; - @Getter private List blockedWorlds; + private boolean useBlockedWorlds; + private List blockedWorlds; private final BossHookManager bossHookManager; - private final CustomBosses plugin; + private final EpicBosses plugin; - public BossLocationManager(CustomBosses customBosses) { - this.bossHookManager = customBosses.getBossHookManager(); - this.plugin = customBosses; + public BossLocationManager(EpicBosses epicBosses) { + this.bossHookManager = epicBosses.getBossHookManager(); + this.plugin = epicBosses; } @Override @@ -38,13 +38,13 @@ public class BossLocationManager implements IReloadable { } public boolean canSpawnBoss(Player player, Location location) { - for(int x = location.getBlockX() - 2; x <= location.getBlockX() + 2; x++) { - for(int y = location.getBlockY(); y <= location.getBlockY() + 2; y++) { - for(int z = location.getBlockZ() - 2; z <= location.getBlockZ() + 2; z++) { + for (int x = location.getBlockX() - 2; x <= location.getBlockX() + 2; x++) { + for (int y = location.getBlockY(); y <= location.getBlockY() + 2; y++) { + for (int z = location.getBlockZ() - 2; z <= location.getBlockZ() + 2; z++) { Location l = new Location(location.getWorld(), x, y, z); Block block = l.getBlock(); - if(block.getType().isSolid()) { + if (block.getType().isSolid()) { ServerUtils.get().logDebug("Unable to spawn boss due to needing a 5x3x5 area to spawn"); return false; } @@ -52,60 +52,36 @@ public class BossLocationManager implements IReloadable { } } - if(isUseBlockedWorlds()) { - if(getBlockedWorlds().contains(location.getWorld().getName())) { + if (isUseBlockedWorlds()) { + if (getBlockedWorlds().contains(location.getWorld().getName())) { ServerUtils.get().logDebug("Unable to spawn boss due to world being in blocked worlds list"); return false; } } - if(this.bossHookManager.isWorldguardEnabled() && this.bossHookManager.getWorldGuardHelper() != null) { - List currentRegions = this.bossHookManager.getWorldGuardHelper().getRegionNames(location); - boolean blocked = false; - - if(currentRegions != null) { - for(String s : this.bossHookManager.getWorldguardBlockedRegions()) { - if(currentRegions.contains(s)) { - blocked = true; - break; - } - } - } - - if(blocked) { - ServerUtils.get().logDebug("Unable to spawn boss due to worldguard region being in blocked list"); + if (WorldGuardHook.isEnabled()) { + if (WorldGuardHook.getBooleanFlag(location, "boss-blocked-region")) { + ServerUtils.get().logDebug("Unable to spawn boss due to worldguard region having the 'boss-blocked-region' flag"); return false; } } - if(this.bossHookManager.isFactionsEnabled() && this.bossHookManager.getFactionHelper() != null) { - if(!this.bossHookManager.getFactionHelper().isInWarzone(location)) { + if (this.bossHookManager.isFactionsEnabled() && this.bossHookManager.getFactionHelper() != null) { + if (!this.bossHookManager.getFactionHelper().isInWarzone(location)) { ServerUtils.get().logDebug("Unable to spawn boss due to being outside a factions warzone"); return false; } } - if(this.bossHookManager.isWorldguardEnabled() && this.bossHookManager.getWorldGuardHelper() != null) { - List currentRegions = this.bossHookManager.getWorldGuardHelper().getRegionNames(location); - boolean allowed = false; - - if(currentRegions != null) { - for(String s : this.bossHookManager.getWorldGuardSpawnRegions()) { - if(currentRegions.contains(s)) { - allowed = true; - break; - } - } - - if(!allowed) { - ServerUtils.get().logDebug("Unable to spawn boss due to worldguard region not being in the spawnable regions list"); - return false; - } + if (WorldGuardHook.isEnabled()) { + if (!WorldGuardHook.getBooleanFlag(location, "boss-spawn-region")) { + ServerUtils.get().logDebug("Unable to spawn boss due to worldguard region not being in the spawnable regions list"); + return false; } } - if(this.bossHookManager.isAskyblockEnabled() && this.bossHookManager.getASkyblockHelper() != null) { - if(this.bossHookManager.isAskyblockOwnIsland()) { + if (this.bossHookManager.isAskyblockEnabled() && this.bossHookManager.getASkyblockHelper() != null) { + if (this.bossHookManager.isAskyblockOwnIsland()) { boolean canSpawn = this.bossHookManager.getASkyblockHelper().isOnOwnIsland(player); if (!canSpawn) ServerUtils.get().logDebug("Unable to spawn boss due to not being on own ASkyblock island"); @@ -116,4 +92,11 @@ public class BossLocationManager implements IReloadable { return true; } + public boolean isUseBlockedWorlds() { + return this.useBlockedWorlds; + } + + public List getBlockedWorlds() { + return this.blockedWorlds; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java index 79456fb..45d4f51 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java @@ -1,13 +1,12 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.interfaces.IMechanicManager; import com.songoda.epicbosses.mechanics.IBossMechanic; import com.songoda.epicbosses.mechanics.boss.*; import com.songoda.epicbosses.utils.Debug; -import com.songoda.epicbosses.utils.IMechanic; import com.songoda.epicbosses.utils.ServerUtils; import java.util.LinkedList; @@ -21,10 +20,10 @@ import java.util.Queue; public class BossMechanicManager implements IMechanicManager { private Queue mechanics; - private final CustomBosses customBosses; + private final EpicBosses epicBosses; - public BossMechanicManager(CustomBosses customBosses) { - this.customBosses = customBosses; + public BossMechanicManager(EpicBosses epicBosses) { + this.epicBosses = epicBosses; } @Override @@ -34,8 +33,8 @@ public class BossMechanicManager implements IMechanicManager equipmentEditMenu, helmetEditorMenu, chestplateEditorMenu, leggingsEditorMenu, bootsEditorMenu; - @Getter private ISubVariablePanelHandler weaponEditMenu, offHandEditorMenu, mainHandEditorMenu; - @Getter private ISubVariablePanelHandler statisticMainEditMenu, entityTypeEditMenu; - @Getter private IVariablePanelHandler mainBossEditMenu, dropsEditMenu, targetingEditMenu, skillsBossEditMenu, skillListBossEditMenu, commandsMainEditMenu, onSpawnCommandEditMenu, + private ISubVariablePanelHandler equipmentEditMenu, helmetEditorMenu, chestplateEditorMenu, leggingsEditorMenu, bootsEditorMenu; + private ISubVariablePanelHandler weaponEditMenu, offHandEditorMenu, mainHandEditorMenu; + private ISubVariablePanelHandler statisticMainEditMenu, entityTypeEditMenu; + private IVariablePanelHandler mainBossEditMenu, dropsEditMenu, targetingEditMenu, skillsBossEditMenu, skillListBossEditMenu, commandsMainEditMenu, onSpawnCommandEditMenu, onDeathCommandEditMenu, mainDropsEditMenu, mainTextEditMenu, mainTauntEditMenu, onSpawnTextEditMenu, onSpawnSubTextEditMenu, onDeathTextEditMenu, onDeathSubTextEditMenu, onDeathPositionTextEditMenu, onTauntTextEditMenu, spawnItemEditMenu, bossShopEditMenu, bossSkillMasterMessageTextEditMenu; - @Getter private BossListEditorPanel equipmentListEditMenu, weaponListEditMenu, statisticListEditMenu; + private BossListEditorPanel equipmentListEditMenu, weaponListEditMenu, statisticListEditMenu; - @Getter private IVariablePanelHandler mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel; - @Getter private ISubVariablePanelHandler createPotionEffectMenu, potionEffectTypeEditMenu; - @Getter private ISubVariablePanelHandler modifyCommandEditMenu, commandListSkillEditMenu; - @Getter private ISubVariablePanelHandler customSkillTypeEditorMenu, specialSettingsEditorMenu, minionSelectEditorMenu; + private IVariablePanelHandler mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel; + private ISubVariablePanelHandler createPotionEffectMenu, potionEffectTypeEditMenu; + private ISubVariablePanelHandler modifyCommandEditMenu, commandListSkillEditMenu; + private ISubVariablePanelHandler customSkillTypeEditorMenu, specialSettingsEditorMenu, minionSelectEditorMenu; - @Getter private IVariablePanelHandler mainDropTableEditMenu, dropTableTypeEditMenu; + private IVariablePanelHandler mainDropTableEditMenu, dropTableTypeEditMenu; - @Getter private ISubVariablePanelHandler sprayDropTableMainEditMenu; - @Getter private DropTableRewardMainEditorPanel sprayDropRewardMainEditPanel; - @Getter private DropTableNewRewardEditorPanel sprayDropNewRewardEditPanel; - @Getter private DropTableRewardsListEditorPanel sprayDropRewardListPanel; + private ISubVariablePanelHandler sprayDropTableMainEditMenu; + private DropTableRewardMainEditorPanel sprayDropRewardMainEditPanel; + private DropTableNewRewardEditorPanel sprayDropNewRewardEditPanel; + private DropTableRewardsListEditorPanel sprayDropRewardListPanel; - @Getter private ISubVariablePanelHandler giveRewardMainEditMenu, giveCommandRewardListPanel, giveCommandNewRewardPanel; - @Getter private ISubSubVariablePanelHandler giveCommandRewardMainEditMenu; - @Getter private ISubSubVariablePanelHandler giveRewardRewardsListMenu; - @Getter private ISubVariablePanelHandler giveRewardPositionListMenu; - @Getter private DropTableRewardMainEditorPanel giveDropRewardMainEditPanel; - @Getter private DropTableNewRewardEditorPanel giveDropNewRewardEditPanel; - @Getter private DropTableRewardsListEditorPanel giveDropRewardListPanel; + private ISubVariablePanelHandler giveRewardMainEditMenu, giveCommandRewardListPanel, giveCommandNewRewardPanel; + private ISubSubVariablePanelHandler giveCommandRewardMainEditMenu; + private ISubSubVariablePanelHandler giveRewardRewardsListMenu; + private ISubVariablePanelHandler giveRewardPositionListMenu; + private DropTableRewardMainEditorPanel giveDropRewardMainEditPanel; + private DropTableNewRewardEditorPanel giveDropNewRewardEditPanel; + private DropTableRewardsListEditorPanel giveDropRewardListPanel; - @Getter private ISubVariablePanelHandler dropDropTableMainEditMenu; - @Getter private DropTableRewardMainEditorPanel dropDropRewardMainEditPanel; - @Getter private DropTableNewRewardEditorPanel dropDropNewRewardEditPanel; - @Getter private DropTableRewardsListEditorPanel dropDropRewardListPanel; + private ISubVariablePanelHandler dropDropTableMainEditMenu; + private DropTableRewardMainEditorPanel dropDropRewardMainEditPanel; + private DropTableNewRewardEditorPanel dropDropNewRewardEditPanel; + private DropTableRewardsListEditorPanel dropDropRewardListPanel; - @Getter private IVariablePanelHandler mainAutoSpawnEditPanel, autoSpawnEntitiesEditPanel, autoSpawnSpecialSettingsEditorPanel, autoSpawnTypeEditorPanel, autoSpawnCustomSettingsEditorPanel, + private IVariablePanelHandler mainAutoSpawnEditPanel, autoSpawnEntitiesEditPanel, autoSpawnSpecialSettingsEditorPanel, autoSpawnTypeEditorPanel, autoSpawnCustomSettingsEditorPanel, autoSpawnMessageEditorPanel; - @Getter private PanelBuilder addItemsBuilder; - private final CustomBosses customBosses; + private PanelBuilder addItemsBuilder; + private final EpicBosses epicBosses; - public BossPanelManager(CustomBosses customBosses) { - this.customBosses = customBosses; + public BossPanelManager(EpicBosses epicBosses) { + this.epicBosses = epicBosses; } @Override @@ -169,7 +171,6 @@ public class BossPanelManager implements ILoadable, IReloadable { loadAutoSpawnEditMenus(); } - @Override public void reload() { reloadMainMenu(); reloadShopMenu(); @@ -199,7 +200,7 @@ public class BossPanelManager implements ILoadable, IReloadable { } public int isItemStackUsed(String name) { - Collection values = this.customBosses.getBossEntityContainer().getData().values(); + Collection values = this.epicBosses.getBossEntityContainer().getData().values(); int timesUsed = 0; for(BossEntity bossEntity : values) { @@ -238,11 +239,11 @@ public class BossPanelManager implements ILoadable, IReloadable { public PanelBuilder getListMenu(String path) { Map replaceMap = new HashMap<>(); String finalPath = getPath(path); - String value = this.customBosses.getConfig().getString(finalPath); + String value = this.epicBosses.getDisplay().getString(finalPath); replaceMap.put("{panelName}", StringUtils.get().translateColor(value)); - return new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("ListPanel"), replaceMap); + return new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("ListPanel"), replaceMap); } //--------------------------------------------- @@ -252,23 +253,23 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadAutoSpawnEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("MainAutoSpawnEditMenu")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("AutoSpawnEntitiesEditMenu")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("AutoSpawnCustomSettingsEditMenu")); PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("AutoSpawnSpecialSettingsEditMenu")); PanelBuilder panelBuilder4 = new PanelBuilder(editor.getConfigurationSection("AutoSpawnTypeEditMenu")); - this.mainAutoSpawnEditPanel = new MainAutoSpawnEditorPanel(this, panelBuilder, this.customBosses); - this.autoSpawnEntitiesEditPanel = new AutoSpawnEntitiesEditorPanel(this, panelBuilder1, this.customBosses); - this.autoSpawnCustomSettingsEditorPanel = new AutoSpawnCustomSettingsEditorPanel(this, panelBuilder2, this.customBosses); - this.autoSpawnSpecialSettingsEditorPanel = new AutoSpawnSpecialSettingsEditorPanel(this, panelBuilder3, this.customBosses); - this.autoSpawnMessageEditorPanel = new AutoSpawnSpawnMessageEditorPanel(this, getListMenu("AutoSpawns.SpawnMessage"), this.customBosses); - this.autoSpawnTypeEditorPanel = new AutoSpawnTypeEditorPanel(this, panelBuilder4, this.customBosses); + this.mainAutoSpawnEditPanel = new MainAutoSpawnEditorPanel(this, panelBuilder, this.epicBosses); + this.autoSpawnEntitiesEditPanel = new AutoSpawnEntitiesEditorPanel(this, panelBuilder1, this.epicBosses); + this.autoSpawnCustomSettingsEditorPanel = new AutoSpawnCustomSettingsEditorPanel(this, panelBuilder2, this.epicBosses); + this.autoSpawnSpecialSettingsEditorPanel = new AutoSpawnSpecialSettingsEditorPanel(this, panelBuilder3, this.epicBosses); + this.autoSpawnMessageEditorPanel = new AutoSpawnSpawnMessageEditorPanel(this, getListMenu("AutoSpawns.SpawnMessage"), this.epicBosses); + this.autoSpawnTypeEditorPanel = new AutoSpawnTypeEditorPanel(this, panelBuilder4, this.epicBosses); } private void reloadAutoSpawnEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("MainAutoSpawnEditMenu")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("AutoSpawnEntitiesEditMenu")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("AutoSpawnCustomSettingsEditMenu")); @@ -290,7 +291,7 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadDropTableEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("DropTableMainEditorPanel")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("DropTableTypeEditorPanel")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("SprayDropTableMainEditMenu")); @@ -306,32 +307,32 @@ public class BossPanelManager implements ILoadable, IReloadable { PanelBuilder panelBuilder12 = new PanelBuilder(editor.getConfigurationSection("GiveRewardMainEditMenu")); this.mainDropTableEditMenu = new MainDropTableEditorPanel(this, panelBuilder); - this.dropTableTypeEditMenu = new DropTableTypeEditorPanel(this, panelBuilder1, this.customBosses); + this.dropTableTypeEditMenu = new DropTableTypeEditorPanel(this, panelBuilder1, this.epicBosses); - this.sprayDropTableMainEditMenu = new SprayDropTableMainEditorPanel(this, panelBuilder2, this.customBosses); - this.sprayDropNewRewardEditPanel = new SprayDropNewRewardPanel(this, panelBuilder4, this.customBosses); - this.sprayDropRewardListPanel = new SprayDropRewardListPanel(this, panelBuilder3, this.customBosses); - this.sprayDropRewardMainEditPanel = new SprayDropRewardMainEditPanel(this, panelBuilder5, this.customBosses); + this.sprayDropTableMainEditMenu = new SprayDropTableMainEditorPanel(this, panelBuilder2, this.epicBosses); + this.sprayDropNewRewardEditPanel = new SprayDropNewRewardPanel(this, panelBuilder4, this.epicBosses); + this.sprayDropRewardListPanel = new SprayDropRewardListPanel(this, panelBuilder3, this.epicBosses); + this.sprayDropRewardMainEditPanel = new SprayDropRewardMainEditPanel(this, panelBuilder5, this.epicBosses); - this.dropDropTableMainEditMenu = new DropDropTableMainEditorPanel(this, panelBuilder6, this.customBosses); - this.dropDropNewRewardEditPanel = new DropDropNewRewardPanel(this, panelBuilder4, this.customBosses); - this.dropDropRewardListPanel = new DropDropRewardListPanel(this, panelBuilder3, this.customBosses); - this.dropDropRewardMainEditPanel = new DropDropRewardMainEditPanel(this, panelBuilder5, this.customBosses); + this.dropDropTableMainEditMenu = new DropDropTableMainEditorPanel(this, panelBuilder6, this.epicBosses); + this.dropDropNewRewardEditPanel = new DropDropNewRewardPanel(this, panelBuilder4, this.epicBosses); + this.dropDropRewardListPanel = new DropDropRewardListPanel(this, panelBuilder3, this.epicBosses); + this.dropDropRewardMainEditPanel = new DropDropRewardMainEditPanel(this, panelBuilder5, this.epicBosses); - this.giveRewardPositionListMenu = new GiveRewardPositionListPanel(this, panelBuilder10, this.customBosses); - this.giveRewardRewardsListMenu = new GiveRewardRewardsListPanel(this, panelBuilder11, this.customBosses); - this.giveRewardMainEditMenu = new GiveRewardMainEditPanel(this, panelBuilder12, this.customBosses); + this.giveRewardPositionListMenu = new GiveRewardPositionListPanel(this, panelBuilder10, this.epicBosses); + this.giveRewardRewardsListMenu = new GiveRewardRewardsListPanel(this, panelBuilder11, this.epicBosses); + this.giveRewardMainEditMenu = new GiveRewardMainEditPanel(this, panelBuilder12, this.epicBosses); - this.giveDropNewRewardEditPanel = new GiveDropNewRewardPanel(this, panelBuilder4, this.customBosses); - this.giveDropRewardListPanel = new GiveDropRewardListPanel(this, panelBuilder3, this.customBosses); - this.giveDropRewardMainEditPanel = new GiveDropRewardMainEditPanel(this, panelBuilder5, this.customBosses); - this.giveCommandNewRewardPanel = new GiveCommandNewRewardPanel(this, panelBuilder4, this.customBosses); - this.giveCommandRewardListPanel = new GiveCommandRewardListPanel(this, panelBuilder3, this.customBosses); - this.giveCommandRewardMainEditMenu = new GiveCommandRewardMainEditPanel(this, panelBuilder5, this.customBosses); + this.giveDropNewRewardEditPanel = new GiveDropNewRewardPanel(this, panelBuilder4, this.epicBosses); + this.giveDropRewardListPanel = new GiveDropRewardListPanel(this, panelBuilder3, this.epicBosses); + this.giveDropRewardMainEditPanel = new GiveDropRewardMainEditPanel(this, panelBuilder5, this.epicBosses); + this.giveCommandNewRewardPanel = new GiveCommandNewRewardPanel(this, panelBuilder4, this.epicBosses); + this.giveCommandRewardListPanel = new GiveCommandRewardListPanel(this, panelBuilder3, this.epicBosses); + this.giveCommandRewardMainEditMenu = new GiveCommandRewardMainEditPanel(this, panelBuilder5, this.epicBosses); } private void reloadDropTableEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("DropTableMainEditorPanel")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("DropTableTypeEditorPanel")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("SprayDropTableMainEditMenu")); @@ -377,7 +378,7 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadSkillEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("SkillEditorPanel")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("SkillTypeEditorPanel")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("PotionSkillEditorPanel")); @@ -388,8 +389,8 @@ public class BossPanelManager implements ILoadable, IReloadable { PanelBuilder panelBuilder7 = new PanelBuilder(editor.getConfigurationSection("CustomSkillTypeEditorPanel")); PanelBuilder panelBuilder8 = new PanelBuilder(editor.getConfigurationSection("SpecialSettingsEditorPanel")); - this.mainSkillEditMenu = new MainSkillEditorPanel(this, panelBuilder, this.customBosses); - this.customMessageEditMenu = new SingleMessageListEditor(this, getListMenu("Skills.MainEdit"), this.customBosses) { + this.mainSkillEditMenu = new MainSkillEditorPanel(this, panelBuilder, this.epicBosses); + this.customMessageEditMenu = new SingleMessageListEditor(this, getListMenu("Skills.MainEdit"), this.epicBosses) { @Override public String getCurrent(Skill object) { @@ -399,7 +400,7 @@ public class BossPanelManager implements ILoadable, IReloadable { @Override public void updateMessage(Skill object, String newPath) { object.setCustomMessage(newPath); - BossPanelManager.this.customBosses.getSkillsFileManager().save(); + BossPanelManager.this.epicBosses.getSkillsFileManager().save(); } @Override @@ -412,22 +413,22 @@ public class BossPanelManager implements ILoadable, IReloadable { return BossAPI.getSkillName(object); } }; - this.skillTypeEditMenu = new SkillTypeEditorPanel(this, panelBuilder1, this.customBosses); - this.potionSkillEditorPanel = new PotionSkillEditorPanel(this, panelBuilder2, this.customBosses); - this.createPotionEffectMenu = new CreatePotionEffectEditorPanel(this, panelBuilder3, this.customBosses); - this.potionEffectTypeEditMenu = new PotionEffectTypeEditorPanel(this, getListMenu("Skills.CreatePotion"), this.customBosses); - this.commandSkillEditorPanel = new CommandSkillEditorPanel(this, panelBuilder4, this.customBosses); - this.modifyCommandEditMenu = new ModifyCommandEditorPanel(this, panelBuilder5, this.customBosses); - this.commandListSkillEditMenu = new CommandListSkillEditorPanel(this, getListMenu("Skills.CommandList"), this.customBosses); - this.groupSkillEditorPanel = new GroupSkillEditorPanel(this, getListMenu("Skills.Group"), this.customBosses); - this.customSkillEditorPanel = new CustomSkillEditorPanel(this, panelBuilder6, this.customBosses); - this.customSkillTypeEditorMenu = new CustomSkillTypeEditorPanel(this, panelBuilder7, this.customBosses); - this.specialSettingsEditorMenu = new SpecialSettingsEditorPanel(this, panelBuilder8, this.customBosses); - this.minionSelectEditorMenu = new MinionSelectEditorPanel(this, getListMenu("Skills.MinionList"), this.customBosses); + this.skillTypeEditMenu = new SkillTypeEditorPanel(this, panelBuilder1, this.epicBosses); + this.potionSkillEditorPanel = new PotionSkillEditorPanel(this, panelBuilder2, this.epicBosses); + this.createPotionEffectMenu = new CreatePotionEffectEditorPanel(this, panelBuilder3, this.epicBosses); + this.potionEffectTypeEditMenu = new PotionEffectTypeEditorPanel(this, getListMenu("Skills.CreatePotion"), this.epicBosses); + this.commandSkillEditorPanel = new CommandSkillEditorPanel(this, panelBuilder4, this.epicBosses); + this.modifyCommandEditMenu = new ModifyCommandEditorPanel(this, panelBuilder5, this.epicBosses); + this.commandListSkillEditMenu = new CommandListSkillEditorPanel(this, getListMenu("Skills.CommandList"), this.epicBosses); + this.groupSkillEditorPanel = new GroupSkillEditorPanel(this, getListMenu("Skills.Group"), this.epicBosses); + this.customSkillEditorPanel = new CustomSkillEditorPanel(this, panelBuilder6, this.epicBosses); + this.customSkillTypeEditorMenu = new CustomSkillTypeEditorPanel(this, panelBuilder7, this.epicBosses); + this.specialSettingsEditorMenu = new SpecialSettingsEditorPanel(this, panelBuilder8, this.epicBosses); + this.minionSelectEditorMenu = new MinionSelectEditorPanel(this, getListMenu("Skills.MinionList"), this.epicBosses); } private void reloadSkillEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("SkillEditorPanel")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("SkillTypeEditorPanel")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("PotionSkillEditorPanel")); @@ -461,18 +462,18 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadTextEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("TextEditorMainPanel")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("SpawnTextEditorPanel")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("DeathTextEditorPanel")); PanelBuilder panelBuilder3 = new PanelBuilder(editor.getConfigurationSection("TauntEditorPanel")); this.mainTextEditMenu = new TextMainEditorPanel(this, panelBuilder); - this.bossSkillMasterMessageTextEditMenu = new SkillMasterMessageTextEditorPanel(this, getListMenu("Boss.Text"), this.customBosses); - this.onSpawnSubTextEditMenu = new SpawnTextEditorPanel(this, panelBuilder1, this.customBosses); - this.onDeathSubTextEditMenu = new DeathTextEditorPanel(this, panelBuilder2, this.customBosses); - this.mainTauntEditMenu = new TauntTextEditorPanel(this, panelBuilder3, this.customBosses); - this.onSpawnTextEditMenu = new SingleMessageListEditor(this, getListMenu("Boss.Text"), this.customBosses) { + this.bossSkillMasterMessageTextEditMenu = new SkillMasterMessageTextEditorPanel(this, getListMenu("Boss.Text"), this.epicBosses); + this.onSpawnSubTextEditMenu = new SpawnTextEditorPanel(this, panelBuilder1, this.epicBosses); + this.onDeathSubTextEditMenu = new DeathTextEditorPanel(this, panelBuilder2, this.epicBosses); + this.mainTauntEditMenu = new TauntTextEditorPanel(this, panelBuilder3, this.epicBosses); + this.onSpawnTextEditMenu = new SingleMessageListEditor(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public String getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getOnSpawn().getMessage(); @@ -493,7 +494,7 @@ public class BossPanelManager implements ILoadable, IReloadable { return BossAPI.getBossEntityName(object); } }; - this.onDeathTextEditMenu = new SingleMessageListEditor(this, getListMenu("Boss.Text"), this.customBosses) { + this.onDeathTextEditMenu = new SingleMessageListEditor(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public String getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getOnDeath().getMessage(); @@ -514,7 +515,7 @@ public class BossPanelManager implements ILoadable, IReloadable { return BossAPI.getBossEntityName(object); } }; - this.onDeathPositionTextEditMenu = new SingleMessageListEditor(this, getListMenu("Boss.Text"), this.customBosses) { + this.onDeathPositionTextEditMenu = new SingleMessageListEditor(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public String getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getOnDeath().getPositionMessage(); @@ -535,7 +536,7 @@ public class BossPanelManager implements ILoadable, IReloadable { return BossAPI.getBossEntityName(object); } }; - this.onTauntTextEditMenu = new ListMessageListEditor(this, getListMenu("Boss.Text"), this.customBosses) { + this.onTauntTextEditMenu = new ListMessageListEditor(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public List getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getTaunts().getTaunts(); @@ -567,7 +568,7 @@ public class BossPanelManager implements ILoadable, IReloadable { } private void reloadTextEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); PanelBuilder panelBuilder = new PanelBuilder(editor.getConfigurationSection("TextEditorMainPanel")); PanelBuilder panelBuilder1 = new PanelBuilder(editor.getConfigurationSection("SpawnTextEditorPanel")); PanelBuilder panelBuilder2 = new PanelBuilder(editor.getConfigurationSection("DeathTextEditorPanel")); @@ -591,15 +592,15 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadCommandEditMenus() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("CommandsEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("CommandsEditorPanel")); this.commandsMainEditMenu = new CommandsMainEditorPanel(this, panelBuilder); - this.onSpawnCommandEditMenu = new OnSpawnCommandEditor(this, getListMenu("Boss.Commands"), this.customBosses); - this.onDeathCommandEditMenu = new OnDeathCommandEditor(this, getListMenu("Boss.Commands"), this.customBosses); + this.onSpawnCommandEditMenu = new OnSpawnCommandEditor(this, getListMenu("Boss.Commands"), this.epicBosses); + this.onDeathCommandEditMenu = new OnDeathCommandEditor(this, getListMenu("Boss.Commands"), this.epicBosses); } private void reloadCommandEditMenus() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("CommandsEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("CommandsEditorPanel")); this.commandsMainEditMenu.initializePanel(panelBuilder); this.onSpawnCommandEditMenu.initializePanel(getListMenu("Boss.Commands")); @@ -613,21 +614,21 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadEquipmentEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); - this.spawnItemEditMenu = new SpawnItemEditorPanel(this, new PanelBuilder(editor.getConfigurationSection("SpawnItemEditorPanel")), this.customBosses); + this.spawnItemEditMenu = new SpawnItemEditorPanel(this, new PanelBuilder(editor.getConfigurationSection("SpawnItemEditorPanel")), this.epicBosses); - this.helmetEditorMenu = new HelmetEditorPanel(this, editor.getConfigurationSection(HELMET_EDITOR_PATH), this.customBosses); - this.chestplateEditorMenu = new ChestplateEditorPanel(this, editor.getConfigurationSection(CHESTPLATE_EDITOR_PATH), this.customBosses); - this.leggingsEditorMenu = new LeggingsEditorPanel(this, editor.getConfigurationSection(LEGGINGS_EDITOR_PATH), this.customBosses); - this.bootsEditorMenu = new BootsEditorPanel(this, editor.getConfigurationSection(BOOTS_EDITOR_PATH), this.customBosses); + this.helmetEditorMenu = new HelmetEditorPanel(this, editor.getConfigurationSection(HELMET_EDITOR_PATH), this.epicBosses); + this.chestplateEditorMenu = new ChestplateEditorPanel(this, editor.getConfigurationSection(CHESTPLATE_EDITOR_PATH), this.epicBosses); + this.leggingsEditorMenu = new LeggingsEditorPanel(this, editor.getConfigurationSection(LEGGINGS_EDITOR_PATH), this.epicBosses); + this.bootsEditorMenu = new BootsEditorPanel(this, editor.getConfigurationSection(BOOTS_EDITOR_PATH), this.epicBosses); - this.mainHandEditorMenu = new MainHandEditorPanel(this, editor.getConfigurationSection(MAIN_HAND_EDITOR_PATH), this.customBosses); - this.offHandEditorMenu = new OffHandEditorPanel(this, editor.getConfigurationSection(OFF_HAND_EDITOR_PATH), this.customBosses); + this.mainHandEditorMenu = new MainHandEditorPanel(this, editor.getConfigurationSection(MAIN_HAND_EDITOR_PATH), this.epicBosses); + this.offHandEditorMenu = new OffHandEditorPanel(this, editor.getConfigurationSection(OFF_HAND_EDITOR_PATH), this.epicBosses); } private void reloadEquipmentEditMenus() { - FileConfiguration editor = this.customBosses.getEditor(); + FileConfiguration editor = this.epicBosses.getEditor(); this.spawnItemEditMenu.initializePanel(new PanelBuilder(editor.getConfigurationSection("SpawnItemEditorPanel"))); @@ -647,15 +648,15 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadEditorListMenus() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("BossListEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("BossListEditorPanel")); - this.equipmentListEditMenu = new BossListEquipmentEditorPanel(this, panelBuilder.cloneBuilder(), this.customBosses); - this.weaponListEditMenu = new BossListWeaponEditorPanel(this, panelBuilder.cloneBuilder(), this.customBosses); - this.statisticListEditMenu = new BossListStatisticEditorPanel(this, panelBuilder.cloneBuilder(), this.customBosses); + this.equipmentListEditMenu = new BossListEquipmentEditorPanel(this, panelBuilder.cloneBuilder(), this.epicBosses); + this.weaponListEditMenu = new BossListWeaponEditorPanel(this, panelBuilder.cloneBuilder(), this.epicBosses); + this.statisticListEditMenu = new BossListStatisticEditorPanel(this, panelBuilder.cloneBuilder(), this.epicBosses); } private void reloadEditorListMenus() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("BossListEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("BossListEditorPanel")); this.equipmentListEditMenu.initializePanel(panelBuilder.cloneBuilder()); this.weaponListEditMenu.initializePanel(panelBuilder.cloneBuilder()); @@ -669,14 +670,14 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadStatEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("StatisticsMainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("StatisticsMainEditorPanel")); - this.statisticMainEditMenu = new StatisticMainEditorPanel(this, panelBuilder, this.customBosses); - this.entityTypeEditMenu = new EntityTypeEditorPanel(this, getListMenu("Boss.EntityType"), this.customBosses); + this.statisticMainEditMenu = new StatisticMainEditorPanel(this, panelBuilder, this.epicBosses); + this.entityTypeEditMenu = new EntityTypeEditorPanel(this, getListMenu("Boss.EntityType"), this.epicBosses); } private void reloadStatEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("StatisticsMainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("StatisticsMainEditorPanel")); this.statisticMainEditMenu.initializePanel(panelBuilder); this.entityTypeEditMenu.initializePanel(getListMenu("Boss.EntityType")); @@ -689,14 +690,14 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadSkillsEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("SkillMainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("SkillMainEditorPanel")); - this.skillsBossEditMenu = new SkillMainEditorPanel(this, panelBuilder, this.customBosses); - this.skillListBossEditMenu = new SkillListEditorPanel(this, getListMenu("Boss.Skills"), this.customBosses); + this.skillsBossEditMenu = new SkillMainEditorPanel(this, panelBuilder, this.epicBosses); + this.skillListBossEditMenu = new SkillListEditorPanel(this, getListMenu("Boss.Skills"), this.epicBosses); } private void reloadSkillsEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("SkillMainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("SkillMainEditorPanel")); this.skillsBossEditMenu.initializePanel(panelBuilder); this.skillListBossEditMenu.initializePanel(getListMenu("Boss.Skills")); @@ -709,13 +710,13 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadWeaponEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("WeaponEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("WeaponEditorPanel")); this.weaponEditMenu = new WeaponsEditorPanel(this, panelBuilder); } private void reloadWeaponEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("WeaponEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("WeaponEditorPanel")); this.weaponEditMenu.initializePanel(panelBuilder); } @@ -727,13 +728,13 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadEquipmentEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("EquipmentEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("EquipmentEditorPanel")); this.equipmentEditMenu = new EquipmentEditorPanel(this, panelBuilder); } private void reloadEquipmentEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("EquipmentEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("EquipmentEditorPanel")); this.equipmentEditMenu.initializePanel(panelBuilder); } @@ -745,16 +746,16 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadDropsEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("DropsEditorPanel")); - PanelBuilder panelBuilder1 = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("DropsMainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("DropsEditorPanel")); + PanelBuilder panelBuilder1 = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("DropsMainEditorPanel")); - this.mainDropsEditMenu = new DropsMainEditorPanel(this, panelBuilder1, this.customBosses); - this.dropsEditMenu = new DropsEditorPanel(this, panelBuilder, this.customBosses); + this.mainDropsEditMenu = new DropsMainEditorPanel(this, panelBuilder1, this.epicBosses); + this.dropsEditMenu = new DropsEditorPanel(this, panelBuilder, this.epicBosses); } private void reloadDropsEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("DropsEditorPanel")); - PanelBuilder panelBuilder1 = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("DropsMainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("DropsEditorPanel")); + PanelBuilder panelBuilder1 = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("DropsMainEditorPanel")); this.mainDropsEditMenu.initializePanel(panelBuilder1); this.dropsEditMenu.initializePanel(panelBuilder); @@ -767,13 +768,13 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadTargetingEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("TargetingPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("TargetingPanel")); - this.targetingEditMenu = new TargetingEditorPanel(this, panelBuilder, this.customBosses); + this.targetingEditMenu = new TargetingEditorPanel(this, panelBuilder, this.epicBosses); } private void reloadTargetingEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("TargetingPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("TargetingPanel")); this.targetingEditMenu.initializePanel(panelBuilder); } @@ -785,13 +786,13 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadMainEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("MainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("MainEditorPanel")); - this.mainBossEditMenu = new MainBossEditPanel(this, panelBuilder, this.customBosses); + this.mainBossEditMenu = new MainBossEditPanel(this, panelBuilder, this.epicBosses); } private void reloadMainEditMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("MainEditorPanel")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("MainEditorPanel")); this.mainBossEditMenu.initializePanel(panelBuilder); } @@ -803,14 +804,14 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadAddItemsMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("AddItemsMenu")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("AddItemsMenu")); this.addItemsBuilder = panelBuilder.cloneBuilder(); - this.customItemAddItemsMenu = new AddItemsPanel(this, panelBuilder.cloneBuilder(), this.customBosses, new CustomItemsAddItemsParentPanelHandler(this)); + this.customItemAddItemsMenu = new AddItemsPanel(this, panelBuilder.cloneBuilder(), this.epicBosses, new CustomItemsAddItemsParentPanelHandler(this)); } private void reloadAddItemsMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("AddItemsMenu")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("AddItemsMenu")); this.addItemsBuilder = panelBuilder.cloneBuilder(); this.customItemAddItemsMenu.initializePanel(panelBuilder.cloneBuilder()); @@ -823,13 +824,13 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadShopMenu() { - this.shopPanel = new ShopPanel(this, new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("ShopListPanel")), this.customBosses); - this.bossShopEditMenu = new BossShopEditorPanel(this, new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("BossShopEditorPanel")), this.customBosses); + this.shopPanel = new ShopPanel(this, new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("ShopListPanel")), this.epicBosses); + this.bossShopEditMenu = new BossShopEditorPanel(this, new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("BossShopEditorPanel")), this.epicBosses); } private void reloadShopMenu() { - this.shopPanel.initializePanel(new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("ShopListPanel"))); - this.bossShopEditMenu.initializePanel(new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("BossShopEditorPanel"))); + this.shopPanel.initializePanel(new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("ShopListPanel"))); + this.bossShopEditMenu.initializePanel(new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("BossShopEditorPanel"))); } //--------------------------------------------- @@ -839,13 +840,13 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadMainMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("MainMenu")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("MainMenu")); this.mainMenu = new MainMenuPanel(this, panelBuilder); } private void reloadMainMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("MainMenu")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("MainMenu")); this.mainMenu.initializePanel(panelBuilder); } @@ -857,7 +858,7 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadAutoSpawnsMenu() { - this.autoSpawns = new AutoSpawnsPanel(this, getListMenu("AutoSpawns.Main"), this.customBosses); + this.autoSpawns = new AutoSpawnsPanel(this, getListMenu("AutoSpawns.Main"), this.epicBosses); } private void reloadAutoSpawnsMenu() { @@ -871,7 +872,7 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadCustomBossesMenu() { - this.bosses = new CustomBossesPanel(this, getListMenu("Bosses"), this.customBosses); + this.bosses = new CustomBossesPanel(this, getListMenu("Bosses"), this.epicBosses); } private void reloadCustomBosses() { @@ -885,7 +886,7 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadCustomSkillsMenu() { - this.customSkills = new CustomSkillsPanel(this, getListMenu("Skills.Main"), this.customBosses); + this.customSkills = new CustomSkillsPanel(this, getListMenu("Skills.Main"), this.epicBosses); } private void reloadCustomSkills() { @@ -899,7 +900,7 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadDropTableMenu() { - this.dropTables = new DropTablePanel(this, getListMenu("DropTable.Main"), this.customBosses); + this.dropTables = new DropTablePanel(this, getListMenu("DropTable.Main"), this.epicBosses); } private void reloadDropTable() { @@ -913,13 +914,13 @@ public class BossPanelManager implements ILoadable, IReloadable { //--------------------------------------------- private void loadCustomItemsMenu() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("CustomItemsMenu")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("CustomItemsMenu")); - this.customItems = new CustomItemsPanel(this, panelBuilder, this.customBosses); + this.customItems = new CustomItemsPanel(this, panelBuilder, this.epicBosses); } private void reloadCustomItems() { - PanelBuilder panelBuilder = new PanelBuilder(this.customBosses.getEditor().getConfigurationSection("CustomItemsMenu")); + PanelBuilder panelBuilder = new PanelBuilder(this.epicBosses.getEditor().getConfigurationSection("CustomItemsMenu")); this.customItems.initializePanel(panelBuilder); } @@ -928,4 +929,327 @@ public class BossPanelManager implements ILoadable, IReloadable { return "Display." + key + ".menuName"; } + public IPanelHandler getMainMenu() { + return this.mainMenu; + } + + public IPanelHandler getCustomItems() { + return this.customItems; + } + + public IPanelHandler getBosses() { + return this.bosses; + } + + public IPanelHandler getAutoSpawns() { + return this.autoSpawns; + } + + public IPanelHandler getDropTables() { + return this.dropTables; + } + + public IPanelHandler getCustomSkills() { + return this.customSkills; + } + + public IPanelHandler getShopPanel() { + return this.shopPanel; + } + + public IPanelHandler getCustomItemAddItemsMenu() { + return this.customItemAddItemsMenu; + } + + public ISubVariablePanelHandler getEquipmentEditMenu() { + return this.equipmentEditMenu; + } + + public ISubVariablePanelHandler getHelmetEditorMenu() { + return this.helmetEditorMenu; + } + + public ISubVariablePanelHandler getChestplateEditorMenu() { + return this.chestplateEditorMenu; + } + + public ISubVariablePanelHandler getLeggingsEditorMenu() { + return this.leggingsEditorMenu; + } + + public ISubVariablePanelHandler getBootsEditorMenu() { + return this.bootsEditorMenu; + } + + public ISubVariablePanelHandler getWeaponEditMenu() { + return this.weaponEditMenu; + } + + public ISubVariablePanelHandler getOffHandEditorMenu() { + return this.offHandEditorMenu; + } + + public ISubVariablePanelHandler getMainHandEditorMenu() { + return this.mainHandEditorMenu; + } + + public ISubVariablePanelHandler getStatisticMainEditMenu() { + return this.statisticMainEditMenu; + } + + public ISubVariablePanelHandler getEntityTypeEditMenu() { + return this.entityTypeEditMenu; + } + + public IVariablePanelHandler getMainBossEditMenu() { + return this.mainBossEditMenu; + } + + public IVariablePanelHandler getDropsEditMenu() { + return this.dropsEditMenu; + } + + public IVariablePanelHandler getTargetingEditMenu() { + return this.targetingEditMenu; + } + + public IVariablePanelHandler getSkillsBossEditMenu() { + return this.skillsBossEditMenu; + } + + public IVariablePanelHandler getSkillListBossEditMenu() { + return this.skillListBossEditMenu; + } + + public IVariablePanelHandler getCommandsMainEditMenu() { + return this.commandsMainEditMenu; + } + + public IVariablePanelHandler getOnSpawnCommandEditMenu() { + return this.onSpawnCommandEditMenu; + } + + public IVariablePanelHandler getOnDeathCommandEditMenu() { + return this.onDeathCommandEditMenu; + } + + public IVariablePanelHandler getMainDropsEditMenu() { + return this.mainDropsEditMenu; + } + + public IVariablePanelHandler getMainTextEditMenu() { + return this.mainTextEditMenu; + } + + public IVariablePanelHandler getMainTauntEditMenu() { + return this.mainTauntEditMenu; + } + + public IVariablePanelHandler getOnSpawnTextEditMenu() { + return this.onSpawnTextEditMenu; + } + + public IVariablePanelHandler getOnSpawnSubTextEditMenu() { + return this.onSpawnSubTextEditMenu; + } + + public IVariablePanelHandler getOnDeathTextEditMenu() { + return this.onDeathTextEditMenu; + } + + public IVariablePanelHandler getOnDeathSubTextEditMenu() { + return this.onDeathSubTextEditMenu; + } + + public IVariablePanelHandler getOnDeathPositionTextEditMenu() { + return this.onDeathPositionTextEditMenu; + } + + public IVariablePanelHandler getOnTauntTextEditMenu() { + return this.onTauntTextEditMenu; + } + + public IVariablePanelHandler getSpawnItemEditMenu() { + return this.spawnItemEditMenu; + } + + public IVariablePanelHandler getBossShopEditMenu() { + return this.bossShopEditMenu; + } + + public IVariablePanelHandler getBossSkillMasterMessageTextEditMenu() { + return this.bossSkillMasterMessageTextEditMenu; + } + + public BossListEditorPanel getEquipmentListEditMenu() { + return this.equipmentListEditMenu; + } + + public BossListEditorPanel getWeaponListEditMenu() { + return this.weaponListEditMenu; + } + + public BossListEditorPanel getStatisticListEditMenu() { + return this.statisticListEditMenu; + } + + public IVariablePanelHandler getMainSkillEditMenu() { + return this.mainSkillEditMenu; + } + + public IVariablePanelHandler getCustomMessageEditMenu() { + return this.customMessageEditMenu; + } + + public IVariablePanelHandler getSkillTypeEditMenu() { + return this.skillTypeEditMenu; + } + + public IVariablePanelHandler getPotionSkillEditorPanel() { + return this.potionSkillEditorPanel; + } + + public IVariablePanelHandler getCommandSkillEditorPanel() { + return this.commandSkillEditorPanel; + } + + public IVariablePanelHandler getGroupSkillEditorPanel() { + return this.groupSkillEditorPanel; + } + + public IVariablePanelHandler getCustomSkillEditorPanel() { + return this.customSkillEditorPanel; + } + + public ISubVariablePanelHandler getCreatePotionEffectMenu() { + return this.createPotionEffectMenu; + } + + public ISubVariablePanelHandler getPotionEffectTypeEditMenu() { + return this.potionEffectTypeEditMenu; + } + + public ISubVariablePanelHandler getModifyCommandEditMenu() { + return this.modifyCommandEditMenu; + } + + public ISubVariablePanelHandler getCommandListSkillEditMenu() { + return this.commandListSkillEditMenu; + } + + public ISubVariablePanelHandler getCustomSkillTypeEditorMenu() { + return this.customSkillTypeEditorMenu; + } + + public ISubVariablePanelHandler getSpecialSettingsEditorMenu() { + return this.specialSettingsEditorMenu; + } + + public ISubVariablePanelHandler getMinionSelectEditorMenu() { + return this.minionSelectEditorMenu; + } + + public IVariablePanelHandler getMainDropTableEditMenu() { + return this.mainDropTableEditMenu; + } + + public IVariablePanelHandler getDropTableTypeEditMenu() { + return this.dropTableTypeEditMenu; + } + + public ISubVariablePanelHandler getSprayDropTableMainEditMenu() { + return this.sprayDropTableMainEditMenu; + } + + public DropTableRewardMainEditorPanel getSprayDropRewardMainEditPanel() { + return this.sprayDropRewardMainEditPanel; + } + + public DropTableNewRewardEditorPanel getSprayDropNewRewardEditPanel() { + return this.sprayDropNewRewardEditPanel; + } + + public DropTableRewardsListEditorPanel getSprayDropRewardListPanel() { + return this.sprayDropRewardListPanel; + } + + public ISubVariablePanelHandler getGiveRewardMainEditMenu() { + return this.giveRewardMainEditMenu; + } + + public ISubVariablePanelHandler getGiveCommandRewardListPanel() { + return this.giveCommandRewardListPanel; + } + + public ISubVariablePanelHandler getGiveCommandNewRewardPanel() { + return this.giveCommandNewRewardPanel; + } + + public ISubSubVariablePanelHandler getGiveCommandRewardMainEditMenu() { + return this.giveCommandRewardMainEditMenu; + } + + public ISubSubVariablePanelHandler getGiveRewardRewardsListMenu() { + return this.giveRewardRewardsListMenu; + } + + public ISubVariablePanelHandler getGiveRewardPositionListMenu() { + return this.giveRewardPositionListMenu; + } + + public DropTableRewardMainEditorPanel getGiveDropRewardMainEditPanel() { + return this.giveDropRewardMainEditPanel; + } + + public DropTableNewRewardEditorPanel getGiveDropNewRewardEditPanel() { + return this.giveDropNewRewardEditPanel; + } + + public DropTableRewardsListEditorPanel getGiveDropRewardListPanel() { + return this.giveDropRewardListPanel; + } + + public ISubVariablePanelHandler getDropDropTableMainEditMenu() { + return this.dropDropTableMainEditMenu; + } + + public DropTableRewardMainEditorPanel getDropDropRewardMainEditPanel() { + return this.dropDropRewardMainEditPanel; + } + + public DropTableNewRewardEditorPanel getDropDropNewRewardEditPanel() { + return this.dropDropNewRewardEditPanel; + } + + public DropTableRewardsListEditorPanel getDropDropRewardListPanel() { + return this.dropDropRewardListPanel; + } + + public IVariablePanelHandler getMainAutoSpawnEditPanel() { + return this.mainAutoSpawnEditPanel; + } + + public IVariablePanelHandler getAutoSpawnEntitiesEditPanel() { + return this.autoSpawnEntitiesEditPanel; + } + + public IVariablePanelHandler getAutoSpawnSpecialSettingsEditorPanel() { + return this.autoSpawnSpecialSettingsEditorPanel; + } + + public IVariablePanelHandler getAutoSpawnTypeEditorPanel() { + return this.autoSpawnTypeEditorPanel; + } + + public IVariablePanelHandler getAutoSpawnCustomSettingsEditorPanel() { + return this.autoSpawnCustomSettingsEditorPanel; + } + + public IVariablePanelHandler getAutoSpawnMessageEditorPanel() { + return this.autoSpawnMessageEditorPanel; + } + + public PanelBuilder getAddItemsBuilder() { + return this.addItemsBuilder; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java index ea1a9ea..f3e3101 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java @@ -1,20 +1,19 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.events.BossSkillEvent; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.skills.CustomSkillHandler; -import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; -import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.custom.*; +import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; +import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.skills.types.CommandSkillElement; import com.songoda.epicbosses.skills.types.CustomSkillElement; import com.songoda.epicbosses.skills.types.GroupSkillElement; import com.songoda.epicbosses.skills.types.PotionSkillElement; import com.songoda.epicbosses.utils.*; import com.songoda.epicbosses.utils.panel.base.ClickAction; -import lombok.Getter; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; @@ -32,10 +31,10 @@ public class BossSkillManager implements ILoadable { private static final Set SKILLS = new HashSet<>(); - @Getter private final List validSkillTypes = Arrays.asList("Potion", "Group", "Custom", "Command"); - private CustomBosses plugin; + private final List validSkillTypes = Arrays.asList("Potion", "Group", "Custom", "Command"); + private EpicBosses plugin; - public BossSkillManager(CustomBosses plugin) { + public BossSkillManager(EpicBosses plugin) { this.plugin = plugin; } @@ -206,6 +205,10 @@ public class BossSkillManager implements ILoadable { return new CustomSkillActionCreator(name, current, displayStack, clickAction); } + public List getValidSkillTypes() { + return this.validSkillTypes; + } + private static class CustomSkillActionCreator implements ICustomSettingAction { private final ClickAction clickAction; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java index 0619f81..bdb7e1e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.holder.ActiveBossHolder; @@ -11,7 +11,6 @@ import com.songoda.epicbosses.targeting.types.ClosestTargetHandler; import com.songoda.epicbosses.targeting.types.NotDamagedNearbyTargetHandler; import com.songoda.epicbosses.targeting.types.RandomNearbyTargetHandler; import com.songoda.epicbosses.targeting.types.TopDamagerTargetHandler; -import lombok.Getter; /** * @author Charles Cullen @@ -20,9 +19,9 @@ import lombok.Getter; */ public class BossTargetManager { - @Getter private final CustomBosses plugin; + private final EpicBosses plugin; - public BossTargetManager(CustomBosses plugin) { + public BossTargetManager(EpicBosses plugin) { this.plugin = plugin; } @@ -82,4 +81,7 @@ public class BossTargetManager { return new TopDamagerTargetHandler<>(holder, this); } + public EpicBosses getPlugin() { + return this.plugin; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java index daa2ced..fe5bc95 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.TauntElement; @@ -20,9 +20,9 @@ import java.util.Queue; */ public class BossTauntManager { - private CustomBosses plugin; + private EpicBosses plugin; - public BossTauntManager(CustomBosses plugin) { + public BossTauntManager(EpicBosses plugin) { this.plugin = plugin; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java index d069779..fd0efbb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.managers.interfaces.IMechanicManager; @@ -20,10 +20,10 @@ import java.util.Queue; public class MinionMechanicManager implements IMechanicManager { private Queue mechanics; - private final CustomBosses customBosses; + private final EpicBosses epicBosses; - public MinionMechanicManager(CustomBosses customBosses) { - this.customBosses = customBosses; + public MinionMechanicManager(EpicBosses epicBosses) { + this.epicBosses = epicBosses; } @Override @@ -33,8 +33,8 @@ public class MinionMechanicManager implements IMechanicManager autoSpawnMap = new HashMap<>(); private AutoSpawnFileHandler autoSpawnFileHandler; - public AutoSpawnFileManager(CustomBosses plugin) { + public AutoSpawnFileManager(EpicBosses plugin) { File file = new File(plugin.getDataFolder(), "autospawns.json"); this.autoSpawnFileHandler = new AutoSpawnFileHandler(plugin, true, file); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/BossesFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/BossesFileManager.java index 31af222..d29e6da 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/BossesFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/BossesFileManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers.files; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.container.BossEntityContainer; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.file.BossesFileHandler; @@ -24,11 +24,11 @@ public class BossesFileManager implements ILoadable, ISavable, IReloadable { private BossEntityContainer bossEntityContainer; private BossesFileHandler bossesFileHandler; - public BossesFileManager(CustomBosses customBosses) { - File file = new File(customBosses.getDataFolder(), "bosses.json"); + public BossesFileManager(EpicBosses epicBosses) { + File file = new File(epicBosses.getDataFolder(), "bosses.json"); - this.bossesFileHandler = new BossesFileHandler(customBosses, true, file); - this.bossEntityContainer = customBosses.getBossEntityContainer(); + this.bossesFileHandler = new BossesFileHandler(epicBosses, true, file); + this.bossEntityContainer = epicBosses.getBossEntityContainer(); } @Override diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/CommandsFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/CommandsFileManager.java index d8e198a..a288700 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/CommandsFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/CommandsFileManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers.files; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.file.CommandsFileHandler; import com.songoda.epicbosses.utils.ILoadable; import com.songoda.epicbosses.utils.IReloadable; @@ -21,10 +21,10 @@ public class CommandsFileManager implements ILoadable, ISavable, IReloadable { private Map> commandsMap = new HashMap<>(); private CommandsFileHandler commandsFileHandler; - public CommandsFileManager(CustomBosses customBosses) { - File file = new File(customBosses.getDataFolder(), "commands.json"); + public CommandsFileManager(EpicBosses epicBosses) { + File file = new File(epicBosses.getDataFolder(), "commands.json"); - this.commandsFileHandler = new CommandsFileHandler(customBosses, true, file); + this.commandsFileHandler = new CommandsFileHandler(epicBosses, true, file); } @Override diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/ItemsFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/ItemsFileManager.java index 5b26e3f..6f89f70 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/ItemsFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/ItemsFileManager.java @@ -2,11 +2,9 @@ package com.songoda.epicbosses.managers.files; import com.songoda.epicbosses.file.ItemStackFileHandler; import com.songoda.epicbosses.utils.ILoadable; -import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.ISavable; import com.songoda.epicbosses.utils.itemstack.ItemStackConverter; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; -import lombok.Getter; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; @@ -19,9 +17,9 @@ import java.util.Map; * @version 1.0.0 * @since 03-Jun-18 */ -public class ItemsFileManager implements ILoadable, ISavable, IReloadable { +public class ItemsFileManager implements ILoadable, ISavable { - @Getter private final ItemStackConverter itemStackConverter = new ItemStackConverter(); + private final ItemStackConverter itemStackConverter = new ItemStackConverter(); private Map itemStackHolders = new HashMap<>(); private ItemStackFileHandler itemStackFileHandler; @@ -37,7 +35,6 @@ public class ItemsFileManager implements ILoadable, ISavable, IReloadable { this.itemStackHolders = this.itemStackFileHandler.loadFile(); } - @Override public void reload() { load(); } @@ -65,4 +62,7 @@ public class ItemsFileManager implements ILoadable, ISavable, IReloadable { return new HashMap<>(this.itemStackHolders); } + public ItemStackConverter getItemStackConverter() { + return this.itemStackConverter; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java index bcbfcab..473662d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java @@ -1,9 +1,8 @@ package com.songoda.epicbosses.managers.files; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.file.MessagesFileHandler; import com.songoda.epicbosses.utils.ILoadable; -import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.ISavable; import java.io.File; @@ -16,15 +15,15 @@ import java.util.Map; * @version 1.0.0 * @since 17-Oct-18 */ -public class MessagesFileManager implements ILoadable, ISavable, IReloadable { +public class MessagesFileManager implements ILoadable, ISavable { private Map> messagesMap = new HashMap<>(); private MessagesFileHandler messagesFileHandler; - public MessagesFileManager(CustomBosses customBosses) { - File file = new File(customBosses.getDataFolder(), "messages.json"); + public MessagesFileManager(EpicBosses epicBosses) { + File file = new File(epicBosses.getDataFolder(), "messages.json"); - this.messagesFileHandler = new MessagesFileHandler(customBosses, true, file); + this.messagesFileHandler = new MessagesFileHandler(epicBosses, true, file); } @Override @@ -32,7 +31,6 @@ public class MessagesFileManager implements ILoadable, ISavable, IReloadable { this.messagesMap = this.messagesFileHandler.loadFile(); } - @Override public void reload() { load(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MinionsFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MinionsFileManager.java index da02c6b..565ec6d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MinionsFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MinionsFileManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers.files; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.container.MinionEntityContainer; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.file.MinionsFileHandler; @@ -21,11 +21,11 @@ public class MinionsFileManager implements ILoadable, ISavable, IReloadable { private MinionEntityContainer minionEntityContainer; private MinionsFileHandler minionsFileHandler; - public MinionsFileManager(CustomBosses customBosses) { - File file = new File(customBosses.getDataFolder(), "minions.json"); + public MinionsFileManager(EpicBosses epicBosses) { + File file = new File(epicBosses.getDataFolder(), "minions.json"); - this.minionsFileHandler = new MinionsFileHandler(customBosses, true, file); - this.minionEntityContainer = customBosses.getMinionEntityContainer(); + this.minionsFileHandler = new MinionsFileHandler(epicBosses, true, file); + this.minionEntityContainer = epicBosses.getMinionEntityContainer(); } @Override diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/SkillsFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/SkillsFileManager.java index 7be867f..ba1877d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/SkillsFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/SkillsFileManager.java @@ -1,10 +1,9 @@ package com.songoda.epicbosses.managers.files; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.file.SkillsFileHandler; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.utils.ILoadable; -import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.ISavable; import java.io.File; @@ -16,12 +15,12 @@ import java.util.Map; * @version 1.0.0 * @since 13-Nov-18 */ -public class SkillsFileManager implements ILoadable, IReloadable, ISavable { +public class SkillsFileManager implements ILoadable, ISavable { private Map skillMap = new HashMap<>(); private SkillsFileHandler skillsFileHandler; - public SkillsFileManager(CustomBosses plugin) { + public SkillsFileManager(EpicBosses plugin) { File file = new File(plugin.getDataFolder(), "skills.json"); this.skillsFileHandler = new SkillsFileHandler(plugin, true, file); @@ -32,7 +31,6 @@ public class SkillsFileManager implements ILoadable, IReloadable, ISavable { this.skillMap = this.skillsFileHandler.loadFile(); } - @Override public void reload() { load(); } @@ -43,7 +41,7 @@ public class SkillsFileManager implements ILoadable, IReloadable, ISavable { } public void saveSkill(String name, Skill skill) { - if(this.skillMap.containsKey(name)) return; + if (this.skillMap.containsKey(name)) return; this.skillMap.put(name, skill); save(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/interfaces/IMechanicManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/interfaces/IMechanicManager.java index ba7be8e..32e1850 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/interfaces/IMechanicManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/interfaces/IMechanicManager.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.managers.interfaces; import com.songoda.epicbosses.utils.ILoadable; -import com.songoda.epicbosses.utils.IMechanic; /** * @author Charles Cullen diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java index c472c30..cd334f5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.mechanics.boss; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.MainStatsElement; @@ -16,30 +16,22 @@ import org.bukkit.entity.LivingEntity; */ public class NameMechanic implements IBossMechanic { - private CustomBosses plugin = CustomBosses.get(); + private EpicBosses plugin = EpicBosses.getInstance(); @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; + if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; - for(EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeBossHolder.getLivingEntity(mainStatsElement.getPosition()); String customName = mainStatsElement.getDisplayName(); - if(livingEntity == null) return false; + if (livingEntity == null || customName == null) continue; + String formattedName = StringUtils.get().translateColor(customName); - if(customName != null) { - String formattedName = StringUtils.get().translateColor(customName); - - if(CustomBosses.get().getConfig().getBoolean("Hooks.HolographicDisplays.enabled", false) && this.plugin.getHolographicDisplayHelper().isConnected()) { - this.plugin.getHolographicDisplayHelper().createHologram(livingEntity, formattedName); - livingEntity.setCustomNameVisible(false); - } else { - livingEntity.setCustomName(formattedName); - livingEntity.setCustomNameVisible(true); - } - } + livingEntity.setCustomName(formattedName); + livingEntity.setCustomNameVisible(true); } return true; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java index ae2055a..4eb38e9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java @@ -7,8 +7,8 @@ import com.songoda.epicbosses.entity.elements.MainStatsElement; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.mechanics.IBossMechanic; -import com.songoda.epicbosses.utils.version.VersionHandler; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; +import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/NameMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/NameMechanic.java index eb257d8..8cec997 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/NameMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/NameMechanic.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.mechanics.minions; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.MainStatsElement; @@ -16,29 +16,25 @@ import org.bukkit.entity.LivingEntity; */ public class NameMechanic implements IMinionMechanic { - private CustomBosses plugin = CustomBosses.get(); + private EpicBosses plugin = EpicBosses.getInstance(); @Override public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) { - if(activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) return false; + if (activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) + return false; - for(EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeMinionHolder.getLivingEntity(mainStatsElement.getPosition()); String customName = mainStatsElement.getDisplayName(); - if(livingEntity == null) return false; + if (livingEntity == null) return false; - if(customName != null) { + if (customName != null) { String formattedName = StringUtils.get().translateColor(customName); - if(CustomBosses.get().getConfig().getBoolean("Hooks.HolographicDisplays.enabled", false) && this.plugin.getHolographicDisplayHelper().isConnected()) { - this.plugin.getHolographicDisplayHelper().createHologram(livingEntity, formattedName); - livingEntity.setCustomNameVisible(false); - } else { - livingEntity.setCustomName(formattedName); - livingEntity.setCustomNameVisible(true); - } + livingEntity.setCustomName(formattedName); + livingEntity.setCustomNameVisible(true); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java index f6ecd4d..532cc50 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.panel.additems.interfaces.IParentPanelHandler; @@ -30,7 +30,7 @@ public class AddItemsPanel extends PanelHandler { private IParentPanelHandler parentPanelHandler; private ItemsFileManager itemsFileManager; - public AddItemsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin, IParentPanelHandler parentPanelHandler) { + public AddItemsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin, IParentPanelHandler parentPanelHandler) { super(bossPanelManager, panelBuilder); this.itemsFileManager = plugin.getItemStackManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java index ecc4c6d..b278027 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings; import com.songoda.epicbosses.managers.BossPanelManager; @@ -16,7 +16,10 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author Charles Cullen @@ -27,9 +30,9 @@ public class AutoSpawnsPanel extends MainListPanelHandler { private AutoSpawnFileManager autoSpawnFileManager; private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public AutoSpawnsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public AutoSpawnsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); @@ -88,8 +91,8 @@ public class AutoSpawnsPanel extends MainListPanelHandler { replaceMap.put("{shuffleEntities}", shuffleEntities); replaceMap.put("{customSpawnMessage}", spawnMessage); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.AutoSpawns.Main.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.AutoSpawns.Main.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.AutoSpawns.Main.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.AutoSpawns.Main.lore"), replaceMap); panel.setItem(realisticSlot, itemStack.clone(), e -> this.bossPanelManager.getMainAutoSpawnEditPanel().openFor((Player) e.getWhoClicked(), autoSpawn)); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java index 3bfd771..1d465ea 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.managers.BossPanelManager; @@ -29,14 +29,14 @@ public class CustomBossesPanel extends MainListPanelHandler { private BossEntityManager bossEntityManager; private BossesFileManager bossesFileManager; - private CustomBosses customBosses; + private EpicBosses epicBosses; - public CustomBossesPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses customBosses) { + public CustomBossesPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses epicBosses) { super(bossPanelManager, panelBuilder); - this.customBosses = customBosses; - this.bossEntityManager = customBosses.getBossEntityManager(); - this.bossesFileManager = customBosses.getBossesFileManager(); + this.epicBosses = epicBosses; + this.bossEntityManager = epicBosses.getBossEntityManager(); + this.bossesFileManager = epicBosses.getBossesFileManager(); } @Override @@ -74,8 +74,8 @@ public class CustomBossesPanel extends MainListPanelHandler { replaceMap.put("{name}", name); replaceMap.put("{enabled}", ""+entity.isEditing()); - ItemStackUtils.applyDisplayName(itemStack, this.customBosses.getConfig().getString("Display.Bosses.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.customBosses.getConfig().getStringList("Display.Bosses.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.epicBosses.getDisplay().getString("Display.Bosses.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.epicBosses.getDisplay().getStringList("Display.Bosses.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { if(e.getClick() == ClickType.RIGHT || e.getClick() == ClickType.SHIFT_RIGHT) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java index b115f11..de404b8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java @@ -1,10 +1,9 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.panel.handlers.MainListPanelHandler; -import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; import com.songoda.epicbosses.utils.panel.Panel; @@ -28,7 +27,7 @@ public class CustomItemsPanel extends MainListPanelHandler { private ItemsFileManager itemsFileManager; - public CustomItemsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public CustomItemsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.itemsFileManager = plugin.getItemStackManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java index 0baeecc..e50cf39 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java @@ -1,13 +1,12 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.SkillsFileManager; import com.songoda.epicbosses.panel.handlers.MainListPanelHandler; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.utils.NumberUtils; -import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackConverter; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; @@ -31,9 +30,9 @@ public class CustomSkillsPanel extends MainListPanelHandler { private ItemStackConverter itemStackConverter; private SkillsFileManager skillsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public CustomSkillsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public CustomSkillsPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -84,8 +83,8 @@ public class CustomSkillsPanel extends MainListPanelHandler { replaceMap.put("{customMessage}", customMessage); replaceMap.put("{radius}", NumberUtils.get().formatDouble(radius)); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Main.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.Main.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Main.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Skills.Main.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> this.bossPanelManager.getMainSkillEditMenu().openFor((Player) e.getWhoClicked(), skill)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java index def6bd4..ff8de28 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossPanelManager; @@ -30,9 +30,9 @@ public class DropTablePanel extends MainListPanelHandler { private DropTableFileManager dropTableFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; - public DropTablePanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropTablePanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -75,8 +75,8 @@ public class DropTablePanel extends MainListPanelHandler { replaceMap.put("{name}", name); replaceMap.put("{type}", StringUtils.get().formatString(dropTable.getDropType())); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.DropTable.Main.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.DropTable.Main.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.DropTable.Main.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.DropTable.Main.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> this.bossPanelManager.getMainDropTableEditMenu().openFor((Player) e.getWhoClicked(), dropTable)); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java index 88c2d4b..008990d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java @@ -1,11 +1,14 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; -import com.songoda.epicbosses.utils.*; +import com.songoda.epicbosses.utils.EntityFinder; +import com.songoda.epicbosses.utils.Message; +import com.songoda.epicbosses.utils.ServerUtils; +import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler; @@ -15,8 +18,9 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.*; -import java.util.stream.Collectors; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author Charles Cullen @@ -25,9 +29,9 @@ import java.util.stream.Collectors; */ public class EntityTypeEditorPanel extends SubVariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public EntityTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public EntityTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -92,7 +96,7 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java index ef71e1a..79122d3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java @@ -1,18 +1,16 @@ package com.songoda.epicbosses.panel; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.core.hooks.EconomyManager; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.BossesFileManager; -import com.songoda.epicbosses.panel.handlers.MainListPanelHandler; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.ServerUtils; -import com.songoda.epicbosses.utils.dependencies.VaultHelper; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; -import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.PanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; @@ -20,9 +18,10 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.*; -import java.util.stream.Collector; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author Charles Cullen @@ -33,14 +32,12 @@ public class ShopPanel extends PanelHandler { private BossEntityManager bossEntityManager; private BossesFileManager bossesFileManager; - private VaultHelper vaultHelper; - private CustomBosses plugin; + private EpicBosses plugin; - public ShopPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public ShopPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; - this.vaultHelper = plugin.getVaultHelper(); this.bossEntityManager = plugin.getBossEntityManager(); this.bossesFileManager = plugin.getBossesFileManager(); } @@ -89,8 +86,8 @@ public class ShopPanel extends PanelHandler { replaceMap.put("{name}", name); replaceMap.put("{price}", NumberUtils.get().formatDouble(price)); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Shop.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Shop.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Shop.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Shop.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity); @@ -101,14 +98,13 @@ public class ShopPanel extends PanelHandler { return; } - double balance = this.vaultHelper.getEconomy().getBalance(player); - if(balance < price) { - Message.Boss_Shop_NotEnoughBalance.msg(player, NumberUtils.get().formatDouble(price - balance)); + if(EconomyManager.hasBalance(player, price)) { + Message.Boss_Shop_NotEnoughBalance.msg(player, NumberUtils.get().formatDouble(price)); return; } - this.vaultHelper.getEconomy().withdrawPlayer(player, price); + EconomyManager.withdrawBalance(player, price); player.getInventory().addItem(spawnItem); Message.Boss_Shop_Purchased.msg(player, spawnItem.getItemMeta().getDisplayName()); }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java index 2b49ce1..e9cbc9e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.autospawns; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.managers.BossPanelManager; @@ -29,9 +29,9 @@ import java.util.Map; */ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public AutoSpawnCustomSettingsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public AutoSpawnCustomSettingsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -97,10 +97,10 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler lore = this.plugin.getConfig().getStringList("Display.AutoSpawns.CustomSettings.lore"); + List lore = this.plugin.getDisplay().getStringList("Display.AutoSpawns.CustomSettings.lore"); List newLore = new ArrayList<>(); for(String s : lore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java index 61a18f8..bfa772d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.autospawns; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.entity.BossEntity; @@ -35,9 +35,9 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler { if(!autoSpawn.isEditing()) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpawnMessageEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpawnMessageEditorPanel.java index ff1fd89..fd98712 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpawnMessageEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpawnMessageEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.autospawns; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.managers.BossPanelManager; @@ -19,7 +19,7 @@ public class AutoSpawnSpawnMessageEditorPanel extends SingleMessageListEditor { private AutoSpawnFileManager autoSpawnFileManager; - public AutoSpawnTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public AutoSpawnTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java index 40ae147..a8cc81f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java @@ -1,11 +1,8 @@ package com.songoda.epicbosses.panel.autospawns; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; -import com.songoda.epicbosses.autospawns.SpawnType; -import com.songoda.epicbosses.holder.ActiveAutoSpawnHolder; -import com.songoda.epicbosses.holder.autospawn.ActiveIntervalAutoSpawnHolder; import com.songoda.epicbosses.managers.AutoSpawnManager; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.AutoSpawnFileManager; @@ -33,7 +30,7 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler { private AutoSpawnFileManager autoSpawnFileManager; private AutoSpawnManager autoSpawnManager; - public MainAutoSpawnEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public MainAutoSpawnEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java index 52d018a..9e83a77 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; @@ -18,7 +18,6 @@ import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; -import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; @@ -38,10 +37,10 @@ public abstract class BossListEditorPanel extends VariablePanelHandler { ClickType click = event.getClick(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java index ef1f41f..9fd5277 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.handlers.BossShopPriceHandler; @@ -28,7 +28,7 @@ public class BossShopEditorPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; - public BossShopEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public BossShopEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java index 0295790..c73faaa 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.entity.BossEntity; @@ -36,9 +36,9 @@ public class DropsEditorPanel extends VariablePanelHandler { private DropTableFileManager dropTableFileManager; private ItemStackConverter itemStackConverter; private BossesFileManager bossesFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public DropsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.dropTableFileManager = plugin.getDropTableFileManager(); @@ -127,8 +127,8 @@ public class DropsEditorPanel extends VariablePanelHandler { replaceMap.put("{name}", name); replaceMap.put("{type}", StringUtils.get().formatString(dropTable.getDropType())); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Drops.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Boss.Drops.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Drops.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Boss.Drops.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { if(!bossEntity.isEditing()) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java index 2509f13..a427e50 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java @@ -1,12 +1,11 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.ClickAction; @@ -27,7 +26,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; - public DropsMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropsMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java index 783d31c..5c5c270 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java @@ -1,18 +1,20 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.BossesFileManager; -import com.songoda.epicbosses.utils.*; +import com.songoda.epicbosses.utils.Message; +import com.songoda.epicbosses.utils.ObjectUtils; +import com.songoda.epicbosses.utils.ServerUtils; +import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; -import org.bukkit.Material; import org.bukkit.entity.Player; import java.util.HashMap; @@ -29,7 +31,7 @@ public class MainBossEditPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; private BossEntityManager bossEntityManager; - public MainBossEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public MainBossEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java index 01fa50b..3c77897 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -34,9 +34,9 @@ public class SkillListEditorPanel extends VariablePanelHandler { private ItemStackConverter itemStackConverter; private SkillsFileManager skillsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public SkillListEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SkillListEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.itemStackConverter = new ItemStackConverter(); @@ -103,12 +103,12 @@ public class SkillListEditorPanel extends VariablePanelHandler { replaceMap.put("{radius}", NumberUtils.get().formatDouble(skill.getRadius())); if(bossEntity.getSkills().getSkills().contains(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Skills.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Skills.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Skills.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Skills.name"), replaceMap); } - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Boss.Skills.lore"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Boss.Skills.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { if(!bossEntity.isEditing()) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java index 07dd0b4..ad71084 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -28,7 +28,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; - public SkillMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SkillMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java index 10f82a7..63e7d01 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java @@ -1,14 +1,14 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.panel.AddItemsPanel; -import com.songoda.epicbosses.panel.additems.interfaces.IParentPanelHandler; import com.songoda.epicbosses.panel.additems.SpawnItemAddItemsParentPanelHandler; +import com.songoda.epicbosses.panel.additems.interfaces.IParentPanelHandler; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.ObjectUtils; import com.songoda.epicbosses.utils.ServerUtils; @@ -36,9 +36,9 @@ public class SpawnItemEditorPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public SpawnItemEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SpawnItemEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); @@ -126,7 +126,7 @@ public class SpawnItemEditorPanel extends VariablePanelHandler { replaceMap.put("{name}", ItemStackUtils.getName(itemStack)); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Equipment.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Equipment.name"), replaceMap); } panel.setItem(realisticSlot, itemStack, e -> { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java index fcaf4b3..13adde5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java @@ -1,13 +1,12 @@ package com.songoda.epicbosses.panel.bosses; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.handlers.BossDisplayNameHandler; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.BossesFileManager; -import com.songoda.epicbosses.utils.EntityFinder; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.ServerUtils; @@ -16,7 +15,6 @@ import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; -import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -32,7 +30,7 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler { private BossesFileManager bossesFileManager; private ItemsFileManager itemsFileManager; - public TargetingEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public TargetingEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java index e0327c3..019e41f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.commands; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -33,9 +33,9 @@ public class OnDeathCommandEditor extends VariablePanelHandler { private CommandsFileManager commandsFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; - public OnDeathCommandEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public OnDeathCommandEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -98,13 +98,13 @@ public class OnDeathCommandEditor extends VariablePanelHandler { replaceMap.put("{name}", name); if(bossEntity.getCommands().getOnDeath() != null && bossEntity.getCommands().getOnDeath().equalsIgnoreCase(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Commands.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Commands.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); for(String s : presetLore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java index 35addcd..0319c63 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.commands; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -33,9 +33,9 @@ public class OnSpawnCommandEditor extends VariablePanelHandler { private CommandsFileManager commandsFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; - public OnSpawnCommandEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public OnSpawnCommandEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -98,13 +98,13 @@ public class OnSpawnCommandEditor extends VariablePanelHandler { replaceMap.put("{name}", name); if(bossEntity.getCommands().getOnSpawn() != null && bossEntity.getCommands().getOnSpawn().equalsIgnoreCase(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Commands.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Commands.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); for(String s : presetLore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java index 4285d7b..78dd427 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.equipment; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -20,7 +20,7 @@ import java.util.Map; */ public class BootsEditorPanel extends ItemStackSubListPanelHandler { - public BootsEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, CustomBosses plugin) { + public BootsEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, EpicBosses plugin) { super(bossPanelManager, configurationSection, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java index f30add3..76c15b7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.equipment; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -20,7 +20,7 @@ import java.util.Map; */ public class ChestplateEditorPanel extends ItemStackSubListPanelHandler { - public ChestplateEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, CustomBosses plugin) { + public ChestplateEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, EpicBosses plugin) { super(bossPanelManager, configurationSection, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java index be7e73a..46f2cf2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.equipment; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -20,7 +20,7 @@ import java.util.Map; */ public class HelmetEditorPanel extends ItemStackSubListPanelHandler { - public HelmetEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, CustomBosses plugin) { + public HelmetEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, EpicBosses plugin) { super(bossPanelManager, configurationSection, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java index 7558ff4..df8ec95 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.equipment; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -20,7 +20,7 @@ import java.util.Map; */ public class LeggingsEditorPanel extends ItemStackSubListPanelHandler { - public LeggingsEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, CustomBosses plugin) { + public LeggingsEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, EpicBosses plugin) { super(bossPanelManager, configurationSection, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListEquipmentEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListEquipmentEditorPanel.java index 07b1d63..a85c1e6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListEquipmentEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListEquipmentEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.list; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -16,7 +16,7 @@ import org.bukkit.entity.Player; */ public class BossListEquipmentEditorPanel extends BossListEditorPanel { - public BossListEquipmentEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public BossListEquipmentEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin, "Equipment"); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListStatisticEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListStatisticEditorPanel.java index fe5432b..2da72da 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListStatisticEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListStatisticEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.list; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -16,7 +16,7 @@ import org.bukkit.entity.Player; */ public class BossListStatisticEditorPanel extends BossListEditorPanel { - public BossListStatisticEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public BossListStatisticEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin, "Statistics"); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListWeaponEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListWeaponEditorPanel.java index 6317901..0b6ea87 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListWeaponEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/list/BossListWeaponEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.list; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -16,7 +16,7 @@ import org.bukkit.entity.Player; */ public class BossListWeaponEditorPanel extends BossListEditorPanel { - public BossListWeaponEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public BossListWeaponEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin, "Weapons"); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java index 2c45f8f..b8374e9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.text; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.OnDeathMessageElement; @@ -29,7 +29,7 @@ public class DeathTextEditorPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; - public DeathTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DeathTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SkillMasterMessageTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SkillMasterMessageTextEditorPanel.java index 4352aef..7a1ffc0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SkillMasterMessageTextEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SkillMasterMessageTextEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.text; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -15,7 +15,7 @@ import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; */ public class SkillMasterMessageTextEditorPanel extends SingleMessageListEditor { - public SkillMasterMessageTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SkillMasterMessageTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java index ffa68ce..35d8760 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.text; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -28,7 +28,7 @@ public class SpawnTextEditorPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; - public SpawnTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SpawnTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java index 77d9b78..ac364a1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.text; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.TauntElement; @@ -32,7 +32,7 @@ public class TauntTextEditorPanel extends VariablePanelHandler { private BossesFileManager bossesFileManager; - public TauntTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public TauntTextEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/MainHandEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/MainHandEditorPanel.java index 06b709e..3d48319 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/MainHandEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/MainHandEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.weapons; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -18,7 +18,7 @@ import java.util.Map; */ public class MainHandEditorPanel extends ItemStackSubListPanelHandler { - public MainHandEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, CustomBosses plugin) { + public MainHandEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, EpicBosses plugin) { super(bossPanelManager, configurationSection, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/OffHandEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/OffHandEditorPanel.java index fd57fd1..a74d00c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/OffHandEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/weapons/OffHandEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.bosses.weapons; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -18,7 +18,7 @@ import java.util.Map; */ public class OffHandEditorPanel extends ItemStackSubListPanelHandler { - public OffHandEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, CustomBosses plugin) { + public OffHandEditorPanel(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, EpicBosses plugin) { super(bossPanelManager, configurationSection, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/DropTableTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/DropTableTypeEditorPanel.java index b5a4fbd..aa270b7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/DropTableTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/DropTableTypeEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossPanelManager; @@ -23,9 +23,9 @@ import java.util.Map; */ public class DropTableTypeEditorPanel extends VariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public DropTableTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropTableTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java index 1b75345..3316624 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java @@ -2,9 +2,6 @@ package com.songoda.epicbosses.panel.droptables; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; -import com.songoda.epicbosses.droptable.elements.DropTableElement; -import com.songoda.epicbosses.droptable.elements.GiveTableElement; -import com.songoda.epicbosses.droptable.elements.SprayTableElement; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.ServerUtils; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java index 060ffe2..577a80d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.rewards; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossPanelManager; @@ -28,9 +28,9 @@ import java.util.Map; public abstract class DropTableNewRewardEditorPanel extends SubVariablePanelHandler implements IDropTableNewRewardEditor { private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public DropTableNewRewardEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropTableNewRewardEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.itemsFileManager = plugin.getItemStackManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java index 6047dbf..c72691e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.rewards; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossPanelManager; @@ -30,7 +30,7 @@ public abstract class DropTableRewardMainEditorPanel extends SubSub private DropTableFileManager dropTableFileManager; - public DropTableRewardMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropTableRewardMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.dropTableFileManager = plugin.getDropTableFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java index 51fb954..c9af3d2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.rewards; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossPanelManager; @@ -31,9 +31,9 @@ import java.util.Map; public abstract class DropTableRewardsListEditorPanel extends SubVariablePanelHandler implements IDropTableRewardsListEditor { private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public DropTableRewardsListEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropTableRewardsListEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -105,8 +105,8 @@ public abstract class DropTableRewardsListEditorPanel extends SubVa if(itemStack == null || itemStack.getType() == Material.AIR) return; - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.DropTable.RewardList.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.DropTable.RewardList.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.DropTable.RewardList.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.DropTable.RewardList.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> getRewardMainEditPanel().openFor((Player) event.getWhoClicked(), dropTable, subVariable, name)); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropNewRewardPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropNewRewardPanel.java index c18b1e7..458ea8b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropNewRewardPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropNewRewardPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.drop; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.DropTableElement; @@ -22,7 +22,7 @@ import java.util.Map; */ public class DropDropNewRewardPanel extends DropTableNewRewardEditorPanel { - public DropDropNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropDropNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardListPanel.java index 6586443..a106d1e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardListPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.drop; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.DropTableElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -18,7 +18,7 @@ import java.util.Map; */ public class DropDropRewardListPanel extends DropTableRewardsListEditorPanel { - public DropDropRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropDropRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardMainEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardMainEditPanel.java index 98c29c5..0ec9882 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardMainEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropRewardMainEditPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.drop; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.DropTableElement; @@ -19,7 +19,7 @@ import java.util.Map; */ public class DropDropRewardMainEditPanel extends DropTableRewardMainEditorPanel { - public DropDropRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropDropRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java index a84c52b..c36737a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.droptables.types.drop; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.DropTableElement; @@ -28,9 +28,9 @@ import java.util.Map; */ public class DropDropTableMainEditorPanel extends SubVariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public DropDropTableMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public DropDropTableMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java index e9eafeb..88f9b90 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java @@ -1,11 +1,10 @@ package com.songoda.epicbosses.panel.droptables.types.give; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.GiveTableElement; import com.songoda.epicbosses.droptable.elements.GiveTableSubElement; -import com.songoda.epicbosses.droptable.elements.SprayTableElement; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.panel.droptables.types.give.handlers.GiveRewardEditHandler; import com.songoda.epicbosses.utils.Message; @@ -31,9 +30,9 @@ import java.util.Map; */ public class GiveRewardMainEditPanel extends SubVariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public GiveRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java index feb4cde..f20024d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java @@ -1,20 +1,17 @@ package com.songoda.epicbosses.panel.droptables.types.give; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.GiveTableElement; import com.songoda.epicbosses.droptable.elements.GiveTableSubElement; -import com.songoda.epicbosses.droptable.elements.SprayTableElement; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.utils.Debug; -import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; -import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler; @@ -25,7 +22,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author Charles Cullen @@ -35,9 +35,9 @@ import java.util.*; public class GiveRewardPositionListPanel extends SubVariablePanelHandler { private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public GiveRewardPositionListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveRewardPositionListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -99,8 +99,8 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler { ClickType clickType = event.getClick(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java index 1609ea3..46bb602 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.give; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.GiveTableElement; @@ -36,9 +36,9 @@ import java.util.Map; public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler { private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public GiveRewardRewardsListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveRewardRewardsListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -117,8 +117,8 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler { ClickType clickType = event.getClick(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java index a487a99..4b089b4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.give.commands; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.GiveTableElement; @@ -38,9 +38,9 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); for(String s : presetLore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java index 85b154d..de9aa65 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.give.commands; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossPanelManager; @@ -31,9 +31,9 @@ import java.util.Map; public class GiveCommandRewardListPanel extends SubVariablePanelHandler { private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public GiveCommandRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveCommandRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -98,8 +98,8 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler this.bossPanelManager.getGiveCommandRewardMainEditMenu().openFor((Player) event.getWhoClicked(), dropTable, giveRewardEditHandler, name)); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java index a6a0965..c6967d5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.give.commands; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.GiveTableElement; @@ -32,7 +32,7 @@ public class GiveCommandRewardMainEditPanel extends SubSubVariablePanelHandler { - public GiveDropNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveDropNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardListPanel.java index 5d0087b..b170a65 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardListPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.give.drops; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.panel.droptables.rewards.DropTableRewardsListEditorPanel; @@ -18,7 +18,7 @@ import java.util.Map; */ public class GiveDropRewardListPanel extends DropTableRewardsListEditorPanel { - public GiveDropRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveDropRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardMainEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardMainEditPanel.java index d848b40..31f4bd8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardMainEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropRewardMainEditPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.give.drops; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.GiveTableElement; @@ -21,7 +21,7 @@ import java.util.Map; */ public class GiveDropRewardMainEditPanel extends DropTableRewardMainEditorPanel { - public GiveDropRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveDropRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/handlers/GiveRewardEditHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/handlers/GiveRewardEditHandler.java index 3fc5940..642154e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/handlers/GiveRewardEditHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/handlers/GiveRewardEditHandler.java @@ -3,7 +3,6 @@ package com.songoda.epicbosses.panel.droptables.types.give.handlers; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.GiveTableElement; import com.songoda.epicbosses.droptable.elements.GiveTableSubElement; -import lombok.Getter; /** * @author Charles Cullen @@ -12,10 +11,10 @@ import lombok.Getter; */ public class GiveRewardEditHandler { - @Getter private final GiveTableSubElement giveTableSubElement; - @Getter private final String damagePosition, dropSection; - @Getter private final GiveTableElement giveTableElement; - @Getter private final DropTable dropTable; + private final GiveTableSubElement giveTableSubElement; + private final String damagePosition, dropSection; + private final GiveTableElement giveTableElement; + private final DropTable dropTable; public GiveRewardEditHandler(String damagePosition, String dropSection, DropTable dropTable, GiveTableElement giveTableElement, GiveTableSubElement giveTableSubElement) { this.damagePosition = damagePosition; @@ -25,4 +24,23 @@ public class GiveRewardEditHandler { this.giveTableSubElement = giveTableSubElement; } + public GiveTableSubElement getGiveTableSubElement() { + return this.giveTableSubElement; + } + + public String getDamagePosition() { + return this.damagePosition; + } + + public String getDropSection() { + return this.dropSection; + } + + public GiveTableElement getGiveTableElement() { + return this.giveTableElement; + } + + public DropTable getDropTable() { + return this.dropTable; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropNewRewardPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropNewRewardPanel.java index 138264f..ac35cd1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropNewRewardPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropNewRewardPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.spray; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.SprayTableElement; @@ -22,7 +22,7 @@ import java.util.Map; */ public class SprayDropNewRewardPanel extends DropTableNewRewardEditorPanel { - public SprayDropNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SprayDropNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardListPanel.java index 9b4fee1..1573ca6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardListPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.spray; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.SprayTableElement; import com.songoda.epicbosses.managers.BossPanelManager; @@ -18,7 +18,7 @@ import java.util.Map; */ public class SprayDropRewardListPanel extends DropTableRewardsListEditorPanel { - public SprayDropRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SprayDropRewardListPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardMainEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardMainEditPanel.java index a758edc..41356fc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardMainEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropRewardMainEditPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.droptables.types.spray; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.SprayTableElement; @@ -19,7 +19,7 @@ import java.util.Map; */ public class SprayDropRewardMainEditPanel extends DropTableRewardMainEditorPanel { - public SprayDropRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SprayDropRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java index f71e589..6f2d9e1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.droptables.types.spray; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.droptable.DropTable; import com.songoda.epicbosses.droptable.elements.SprayTableElement; @@ -28,9 +28,9 @@ import java.util.Map; */ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public SprayDropTableMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SprayDropTableMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java index a569bb5..fac55f4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; @@ -42,9 +42,9 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl private BossesFileManager bossesFileManager; private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public ItemStackSubListPanelHandler(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, CustomBosses plugin) { + public ItemStackSubListPanelHandler(BossPanelManager bossPanelManager, ConfigurationSection configurationSection, EpicBosses plugin) { super(bossPanelManager, configurationSection); this.plugin = plugin; @@ -143,7 +143,7 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl replaceMap.put("{name}", ItemStackUtils.getName(itemStack)); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Equipment.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Equipment.name"), replaceMap); } panel.setItem(realisticSlot, itemStack, e -> { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java index a79e2c5..15cc136 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java @@ -1,10 +1,9 @@ package com.songoda.epicbosses.panel.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.CommandsFileManager; -import com.songoda.epicbosses.managers.files.MessagesFileManager; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackConverter; @@ -33,9 +32,9 @@ public abstract class ListCommandListEditor extends VariablePanelHandler { private CommandsFileManager commandsFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; - public ListCommandListEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public ListCommandListEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -108,13 +107,13 @@ public abstract class ListCommandListEditor extends VariablePanelHandler { replaceMap.put("{name}", name); if(current.contains(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Commands.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Command.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Command.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); for(String s : presetLore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java index c8026ec..556d65a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.panel.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; -import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.MessagesFileManager; import com.songoda.epicbosses.utils.ServerUtils; @@ -33,9 +32,9 @@ public abstract class ListMessageListEditor extends VariablePanelHandler { private MessagesFileManager messagesFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; - public ListMessageListEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public ListMessageListEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -108,13 +107,13 @@ public abstract class ListMessageListEditor extends VariablePanelHandler { replaceMap.put("{name}", name); if(current.contains(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Text.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Text.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List presetLore = this.plugin.getConfig().getStringList("Display.Boss.Text.lore"); + List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Text.lore"); List newLore = new ArrayList<>(); for(String s : presetLore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java index 0ae91c8..1154584 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.handlers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.MessagesFileManager; @@ -32,9 +32,9 @@ public abstract class SingleMessageListEditor extends VariablePanelHandler private MessagesFileManager messagesFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; - public SingleMessageListEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SingleMessageListEditor(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -106,13 +106,13 @@ public abstract class SingleMessageListEditor extends VariablePanelHandler replaceMap.put("{name}", name); if(current != null && current.equalsIgnoreCase(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Text.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Text.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List presetLore = this.plugin.getConfig().getStringList("Display.Boss.Text.lore"); + List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Text.lore"); List newLore = new ArrayList<>(); for(String s : presetLore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java index c07da9a..31b08b3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.skills; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.handlers.SkillDisplayNameHandler; import com.songoda.epicbosses.managers.BossPanelManager; @@ -18,7 +18,8 @@ import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -import java.util.*; +import java.util.HashMap; +import java.util.Map; /** * @author Charles Cullen @@ -29,7 +30,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler { private SkillsFileManager skillsFileManager; - public MainSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public MainSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.skillsFileManager = plugin.getSkillsFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/SkillTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/SkillTypeEditorPanel.java index ee9fdb1..341f773 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/SkillTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/SkillTypeEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.skills; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.SkillsFileManager; @@ -26,7 +26,7 @@ public class SkillTypeEditorPanel extends VariablePanelHandler { private SkillsFileManager skillsFileManager; - public SkillTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SkillTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.skillsFileManager = plugin.getSkillsFileManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java index b4195c0..52e1b5a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.skills.Skill; @@ -29,9 +29,9 @@ import java.util.*; */ public class CommandSkillEditorPanel extends VariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public CommandSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public CommandSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -117,8 +117,8 @@ public class CommandSkillEditorPanel extends VariablePanelHandler { ItemStack itemStack = new ItemStack(Material.BOOK); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.Commands.lore"), replaceMap); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Commands.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Skills.Commands.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Commands.name"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> this.bossPanelManager.getModifyCommandEditMenu().openFor((Player) event.getWhoClicked(), skill, subCommandSkillElement)); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java index 0dfbf86..27e1663 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; @@ -31,9 +31,9 @@ public class CustomSkillEditorPanel extends VariablePanelHandler { private SkillsFileManager skillsFileManager; private BossSkillManager bossSkillManager; - private CustomBosses plugin; + private EpicBosses plugin; - public CustomSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public CustomSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java index da0c009..4c2af52 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; @@ -32,9 +32,9 @@ public class GroupSkillEditorPanel extends VariablePanelHandler { private ItemStackConverter itemStackConverter; private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public GroupSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GroupSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -112,12 +112,12 @@ public class GroupSkillEditorPanel extends VariablePanelHandler { replaceMap.put("{type}", type); if(isCurrent) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Group.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Group.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Group.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Group.name"), replaceMap); } - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.Group.lore"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Skills.Group.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> { if(isCurrent) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java index e1b539e..6e7d980 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; @@ -43,9 +43,9 @@ public class PotionSkillEditorPanel extends VariablePanelHandler { private PotionEffectConverter potionEffectConverter; private SkillsFileManager skillsFileManager; private BossSkillManager bossSkillManager; - private CustomBosses plugin; + private EpicBosses plugin; - public PotionSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public PotionSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -127,8 +127,8 @@ public class PotionSkillEditorPanel extends VariablePanelHandler { replaceMap.put("{level}", NumberUtils.get().formatDouble(potionEffectHolder.getLevel())); replaceMap.put("{duration}", NumberUtils.get().formatDouble(potionEffectHolder.getDuration())); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.Potions.lore"), replaceMap); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Potions.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Skills.Potions.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Potions.name"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { potionEffectHolders.remove(potionEffectHolder); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java index 1bf5ad2..5a19f20 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom.commands; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; @@ -37,9 +37,9 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler presetLore = this.plugin.getConfig().getStringList("Display.Skills.CommandList.lore"); + List presetLore = this.plugin.getDisplay().getStringList("Display.Skills.CommandList.lore"); List newLore = new ArrayList<>(); for(String s : presetLore) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java index 8238b38..2a4e2bc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom.commands; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; @@ -36,7 +36,7 @@ public class ModifyCommandEditorPanel extends SubVariablePanelHandler { IOtherSkillDataElement otherSkillDataElement = customSkillHandler.getOtherSkillData(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java index 1d7c452..b61ddb6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.panel.skills.custom.custom; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.types.CustomSkillElement; @@ -9,7 +9,6 @@ import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler; -import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler; import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; import org.bukkit.Material; @@ -25,9 +24,9 @@ import java.util.*; */ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler { - private CustomBosses plugin; + private EpicBosses plugin; - public MaterialTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public MaterialTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -91,9 +90,9 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java index 8897c14..565229b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom.custom; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -11,7 +11,6 @@ import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.elements.CustomMinionSkillElement; import com.songoda.epicbosses.skills.types.CustomSkillElement; import com.songoda.epicbosses.utils.ServerUtils; -import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackConverter; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; @@ -37,9 +36,9 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler { customMinionSkillElement.setMinionToSpawn(name); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java index 28a65e1..5ca5fb4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java @@ -1,12 +1,12 @@ package com.songoda.epicbosses.panel.skills.custom.custom; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; import com.songoda.epicbosses.skills.CustomSkillHandler; -import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; import com.songoda.epicbosses.skills.Skill; +import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; import com.songoda.epicbosses.skills.types.CustomSkillElement; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.ServerUtils; @@ -31,9 +31,9 @@ import java.util.Map; public class SpecialSettingsEditorPanel extends SubVariablePanelHandler { private BossSkillManager bossSkillManager; - private CustomBosses plugin; + private EpicBosses plugin; - public SpecialSettingsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public SpecialSettingsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -107,8 +107,8 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler { private PotionEffectConverter potionEffectConverter = new PotionEffectConverter(); - private CustomBosses plugin; + private EpicBosses plugin; - public PotionEffectTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public PotionEffectTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -102,13 +105,13 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/settings/Settings.java b/plugin-modules/Core/src/com/songoda/epicbosses/settings/Settings.java new file mode 100644 index 0000000..62d8319 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/settings/Settings.java @@ -0,0 +1,53 @@ +package com.songoda.epicbosses.settings; + +import com.songoda.core.configuration.Config; +import com.songoda.core.configuration.ConfigSetting; +import com.songoda.core.hooks.EconomyManager; +import com.songoda.epicbosses.EpicBosses; + +import java.util.Arrays; +import java.util.stream.Collectors; + +public class Settings { + + static final Config config = EpicBosses.getInstance().getCoreConfig(); + + public static final ConfigSetting DEBUG_MODE = new ConfigSetting(config, "Settings.debug", true); + + public static final ConfigSetting BOSS_TARGET_RANGE = new ConfigSetting(config, "Settings.bossTargetRange", 50); + + public static final ConfigSetting DEFAULT_NEARBY_RADIUS = new ConfigSetting(config, "Settings.defaultNearbyRadius", 250); + + public static final ConfigSetting NEARBY_FORMAT = new ConfigSetting(config, "Settings.nearbyFormat", "{name} ({distance}m)"); + + public static final ConfigSetting BLOCKED_WORLDS_ENABLED = new ConfigSetting(config, "Settings.BlockedWorlds", false); + + public static final ConfigSetting BLOCKED_WORLDS = new ConfigSetting(config, "Settings.BlockedWorlds.worlds", Arrays.asList("world_the_end", "world_nether")); + + public static final ConfigSetting ECONOMY_PLUGIN = new ConfigSetting(config, "Settings.Economy", EconomyManager.getEconomy() == null ? "Vault" : EconomyManager.getEconomy().getName(), + "Which economy plugin should be used?", + "Supported plugins you have installed: \"" + EconomyManager.getManager().getRegisteredPlugins().stream().collect(Collectors.joining("\", \"")) + "\"."); + + public static final ConfigSetting BOSS_SHOP = new ConfigSetting(config, "Toggles.bossShop", true); + + public static final ConfigSetting ENDERMAN_TELEPORTING = new ConfigSetting(config, "Toggles.endermanTeleporting", true); + + public static final ConfigSetting POTIONS_AFFECTING_BOSSES = new ConfigSetting(config, "Toggles.potionsAffectingBoss", true); + + public static final ConfigSetting MAX_NEARBY_RADIUS = new ConfigSetting(config, "Limits.maxNearbyRadius", 500); + + public static final ConfigSetting ASKYBLOCK_ENABLED = new ConfigSetting(config, "Hooks.ASkyBlock.enabled", false); + + public static final ConfigSetting ASKYBLOCK_ON_OWN_ISLAND = new ConfigSetting(config, "Hooks.ASkyBlock.onOwnIsland", false); + + public static final ConfigSetting FACTIONS_ENABLED = new ConfigSetting(config, "Hooks.Factions.enabled", false); + + public static final ConfigSetting FACTIONS_USE_WARZONE_SPAWN_REGION = new ConfigSetting(config, "Hooks.Factions.useWarzoneSpawnRegion", false); + + public static void setupConfig() { + config.load(); + config.setAutoremove(true).setAutosave(true); + + config.saveChanges(); + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java index b69ac0a..4f8aa04 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java @@ -2,8 +2,6 @@ package com.songoda.epicbosses.skills; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -12,9 +10,12 @@ import lombok.Setter; */ public class Skill { - @Expose @Getter @Setter private String mode, type, displayName, customMessage; - @Expose @Getter @Setter private Double radius; - @Expose @Getter @Setter private JsonObject customData; + @Expose + private String mode, type, displayName, customMessage; + @Expose + private Double radius; + @Expose + private JsonObject customData; public Skill(String mode, String type, Double radius, String displayName, String customMessage) { this.mode = mode; @@ -24,4 +25,51 @@ public class Skill { this.customMessage = customMessage; } + public String getMode() { + return this.mode; + } + + public String getType() { + return this.type; + } + + public String getDisplayName() { + return this.displayName; + } + + public String getCustomMessage() { + return this.customMessage; + } + + public Double getRadius() { + return this.radius; + } + + public JsonObject getCustomData() { + return this.customData; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public void setType(String type) { + this.type = type; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public void setCustomMessage(String customMessage) { + this.customMessage = customMessage; + } + + public void setRadius(Double radius) { + this.radius = radius; + } + + public void setCustomData(JsonObject customData) { + this.customData = customData; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java index 15a24ab..8374e32 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java @@ -1,20 +1,18 @@ package com.songoda.epicbosses.skills.custom; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; -import com.songoda.epicbosses.autospawns.AutoSpawn; -import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; import com.songoda.epicbosses.panel.skills.custom.custom.MaterialTypeEditorPanel; import com.songoda.epicbosses.skills.CustomSkillHandler; -import com.songoda.epicbosses.skills.elements.SubCustomSkillElement; -import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.custom.cage.CageLocationData; import com.songoda.epicbosses.skills.custom.cage.CagePlayerData; import com.songoda.epicbosses.skills.elements.CustomCageSkillElement; +import com.songoda.epicbosses.skills.elements.SubCustomSkillElement; +import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement; import com.songoda.epicbosses.skills.types.CustomSkillElement; import com.songoda.epicbosses.utils.*; @@ -23,7 +21,6 @@ import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler; import com.songoda.epicbosses.utils.time.TimeUnit; import com.songoda.epicbosses.utils.version.VersionHandler; -import lombok.Getter; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -31,7 +28,6 @@ import org.bukkit.block.BlockState; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.inventory.ItemStack; import java.lang.reflect.InvocationTargetException; @@ -48,16 +44,16 @@ public class Cage extends CustomSkillHandler { private static final MaterialConverter MATERIAL_CONVERTER = new MaterialConverter(); private static final VersionHandler versionHandler = new VersionHandler(); - @Getter private static final Map cageLocationDataMap = new HashMap<>(); - @Getter private static final List playersInCage = new ArrayList<>(); + private static final Map cageLocationDataMap = new HashMap<>(); + private static final List playersInCage = new ArrayList<>(); private static Method setBlockDataMethod; private final MaterialTypeEditorPanel flatTypeEditor, wallTypeEditor, insideTypeEditor; private BossPanelManager bossPanelManager; - private CustomBosses plugin; + private EpicBosses plugin; - public Cage(CustomBosses plugin) { + public Cage(EpicBosses plugin) { this.plugin = plugin; this.bossPanelManager = plugin.getBossPanelManager(); @@ -66,6 +62,14 @@ public class Cage extends CustomSkillHandler { this.insideTypeEditor = getInsideTypeEditor(); } + public static Map getCageLocationDataMap() { + return Cage.cageLocationDataMap; + } + + public static List getPlayersInCage() { + return Cage.playersInCage; + } + @Override public boolean doesUseMultiplier() { return false; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java index a14996e..91ab0fe 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.skills.custom; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.skills.CustomSkillHandler; import com.songoda.epicbosses.skills.Skill; @@ -52,8 +52,8 @@ public class Disarm extends CustomSkillHandler { if(livingEntity instanceof HumanEntity) { HumanEntity humanEntity = (HumanEntity) livingEntity; - itemStack = CustomBosses.get().getVersionHandler().getItemInHand(humanEntity); - CustomBosses.get().getVersionHandler().setItemInHand(humanEntity, replacementItemStack); + itemStack = EpicBosses.getInstance().getVersionHandler().getItemInHand(humanEntity); + EpicBosses.getInstance().getVersionHandler().setItemInHand(humanEntity, replacementItemStack); break; } case 1: diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java index cdf399b..d79baf7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java @@ -10,7 +10,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; import java.util.List; -import java.util.Map; /** * @author Charles Cullen diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java index 4694479..549e19d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.skills.custom; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.BossSkillManager; @@ -33,9 +33,9 @@ public class Minions extends CustomSkillHandler { private static final VersionHandler versionHandler = new VersionHandler(); - private CustomBosses plugin; + private EpicBosses plugin; - public Minions(CustomBosses plugin) { + public Minions(EpicBosses plugin) { this.plugin = plugin; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java index 1ea3856..1f24e86 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java @@ -1,7 +1,5 @@ package com.songoda.epicbosses.skills.custom.cage; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Location; import org.bukkit.block.BlockState; @@ -12,10 +10,10 @@ import org.bukkit.block.BlockState; */ public class CageLocationData { - @Getter @Setter private BlockState oldBlockState; - @Getter @Setter private int amountOfCages = 0; + private BlockState oldBlockState; + private int amountOfCages = 0; - @Getter private final Location location; + private final Location location; public CageLocationData(Location location, int amountOfCages) { this(location); @@ -27,4 +25,23 @@ public class CageLocationData { this.location = location; } + public BlockState getOldBlockState() { + return this.oldBlockState; + } + + public int getAmountOfCages() { + return this.amountOfCages; + } + + public Location getLocation() { + return this.location; + } + + public void setOldBlockState(BlockState oldBlockState) { + this.oldBlockState = oldBlockState; + } + + public void setAmountOfCages(int amountOfCages) { + this.amountOfCages = amountOfCages; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java index 1b60ec5..d81031d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java @@ -1,7 +1,5 @@ package com.songoda.epicbosses.skills.custom.cage; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; @@ -16,8 +14,8 @@ import java.util.*; */ public class CagePlayerData { - @Getter private final Map> mapOfCages = new HashMap<>(), mapOfRestoreCages = new HashMap<>(); - @Getter private final UUID uuid; + private final Map> mapOfCages = new HashMap<>(), mapOfRestoreCages = new HashMap<>(); + private final UUID uuid; public CagePlayerData(UUID uuid) { this.uuid = uuid; @@ -98,4 +96,15 @@ public class CagePlayerData { return blockStateQueue; } + public Map> getMapOfCages() { + return this.mapOfCages; + } + + public Map> getMapOfRestoreCages() { + return this.mapOfRestoreCages; + } + + public UUID getUuid() { + return this.uuid; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java index 7e2c4fb..42a4244 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java @@ -2,8 +2,6 @@ package com.songoda.epicbosses.skills.elements; import com.google.gson.annotations.Expose; import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -12,8 +10,10 @@ import lombok.Setter; */ public class CustomCageSkillElement implements IOtherSkillDataElement { - @Expose @Getter @Setter private String flatType, wallType, insideType; - @Expose @Getter @Setter private int duration; + @Expose + private String flatType, wallType, insideType; + @Expose + private int duration; public CustomCageSkillElement(String flatType, String wallType, String insideType, int duration) { this.flatType = flatType; @@ -22,4 +22,35 @@ public class CustomCageSkillElement implements IOtherSkillDataElement { this.duration = duration; } + public String getFlatType() { + return this.flatType; + } + + public String getWallType() { + return this.wallType; + } + + public String getInsideType() { + return this.insideType; + } + + public int getDuration() { + return this.duration; + } + + public void setFlatType(String flatType) { + this.flatType = flatType; + } + + public void setWallType(String wallType) { + this.wallType = wallType; + } + + public void setInsideType(String insideType) { + this.insideType = insideType; + } + + public void setDuration(int duration) { + this.duration = duration; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java index 9ea4263..b99d251 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java @@ -2,10 +2,6 @@ package com.songoda.epicbosses.skills.elements; import com.google.gson.annotations.Expose; import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement; -import lombok.Getter; -import lombok.Setter; - -import java.util.List; /** * @author Charles Cullen @@ -14,12 +10,29 @@ import java.util.List; */ public class CustomMinionSkillElement implements IOtherSkillDataElement { - @Expose @Getter @Setter private String minionToSpawn; - @Expose @Getter @Setter private Integer amount; + @Expose + private String minionToSpawn; + @Expose + private Integer amount; public CustomMinionSkillElement(Integer amount, String minionToSpawn) { this.amount = amount; this.minionToSpawn = minionToSpawn; } + public String getMinionToSpawn() { + return this.minionToSpawn; + } + + public Integer getAmount() { + return this.amount; + } + + public void setMinionToSpawn(String minionToSpawn) { + this.minionToSpawn = minionToSpawn; + } + + public void setAmount(Integer amount) { + this.amount = amount; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java index e59c35e..660bc17 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.skills.elements; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; import java.util.List; @@ -13,10 +11,13 @@ import java.util.List; */ public class SubCommandSkillElement { - @Expose @Getter private final String name; + @Expose + private final String name; - @Expose @Getter @Setter private Double chance; - @Expose @Getter @Setter private List commands; + @Expose + private Double chance; + @Expose + private List commands; public SubCommandSkillElement(String name, Double chance, List commands) { this.name = name; @@ -24,4 +25,23 @@ public class SubCommandSkillElement { this.commands = commands; } + public String getName() { + return this.name; + } + + public Double getChance() { + return this.chance; + } + + public List getCommands() { + return this.commands; + } + + public void setChance(Double chance) { + this.chance = chance; + } + + public void setCommands(List commands) { + this.commands = commands; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java index 948e5da..6f3a4c1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java @@ -3,8 +3,6 @@ package com.songoda.epicbosses.skills.elements; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; import com.songoda.epicbosses.utils.BossesGson; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -13,9 +11,12 @@ import lombok.Setter; */ public class SubCustomSkillElement { - @Expose @Getter @Setter private String type; - @Expose @Getter @Setter private Double multiplier; - @Expose @Setter private JsonObject otherSkillData; + @Expose + private String type; + @Expose + private Double multiplier; + @Expose + private JsonObject otherSkillData; public SubCustomSkillElement(String type, Double multiplier, JsonObject otherSkillData) { this.type = type; @@ -39,4 +40,23 @@ public class SubCustomSkillElement { return null; } + public String getType() { + return this.type; + } + + public Double getMultiplier() { + return this.multiplier; + } + + public void setType(String type) { + this.type = type; + } + + public void setMultiplier(Double multiplier) { + this.multiplier = multiplier; + } + + public void setOtherSkillData(JsonObject otherSkillData) { + this.otherSkillData = otherSkillData; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/interfaces/ICustomSkillHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/interfaces/ICustomSkillHandler.java index 1e5c8b6..b0c78ce 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/interfaces/ICustomSkillHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/interfaces/ICustomSkillHandler.java @@ -4,7 +4,6 @@ import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.types.CustomSkillElement; import java.util.List; -import java.util.Map; /** * @author Charles Cullen diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java index 3e395c6..088adbe 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java @@ -2,14 +2,12 @@ package com.songoda.epicbosses.skills.types; import com.google.gson.annotations.Expose; import com.songoda.epicbosses.holder.ActiveBossHolder; -import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.elements.SubCommandSkillElement; +import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.RandomUtils; import com.songoda.epicbosses.utils.ServerUtils; -import lombok.Getter; -import lombok.Setter; import org.bukkit.entity.LivingEntity; import java.util.List; @@ -21,7 +19,8 @@ import java.util.List; */ public class CommandSkillElement implements ISkillHandler { - @Expose @Getter @Setter private List commands; + @Expose + private List commands; public CommandSkillElement(List commandSkillElements) { this.commands = commandSkillElements; @@ -51,4 +50,12 @@ public class CommandSkillElement implements ISkillHandler { }) ); } + + public List getCommands() { + return this.commands; + } + + public void setCommands(List commands) { + this.commands = commands; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CustomSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CustomSkillElement.java index 96a7fa3..fe3a26c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CustomSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CustomSkillElement.java @@ -2,8 +2,6 @@ package com.songoda.epicbosses.skills.types; import com.google.gson.annotations.Expose; import com.songoda.epicbosses.skills.elements.SubCustomSkillElement; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -12,9 +10,18 @@ import lombok.Setter; */ public class CustomSkillElement { - @Expose @Getter @Setter private SubCustomSkillElement custom; + @Expose + private SubCustomSkillElement custom; public CustomSkillElement(SubCustomSkillElement subCustomSkillElement) { this.custom = subCustomSkillElement; } + + public SubCustomSkillElement getCustom() { + return this.custom; + } + + public void setCustom(SubCustomSkillElement custom) { + this.custom = custom; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java index 93af501..297b7f6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java @@ -1,15 +1,13 @@ package com.songoda.epicbosses.skills.types; import com.google.gson.annotations.Expose; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.BossSkillManager; import com.songoda.epicbosses.managers.files.SkillsFileManager; -import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.skills.Skill; +import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.utils.Debug; -import lombok.Getter; -import lombok.Setter; import org.bukkit.entity.LivingEntity; import java.util.List; @@ -21,7 +19,8 @@ import java.util.List; */ public class GroupSkillElement implements ISkillHandler { - @Expose @Getter @Setter private List groupedSkills; + @Expose + private List groupedSkills; public GroupSkillElement(List groupedSkills) { this.groupedSkills = groupedSkills; @@ -30,7 +29,7 @@ public class GroupSkillElement implements ISkillHandler { @Override public void castSkill(Skill skill, GroupSkillElement groupSkillElement, ActiveBossHolder activeBossHolder, List nearbyEntities) { List currentGroupedSkills = getGroupedSkills(); - CustomBosses plugin = CustomBosses.get(); + EpicBosses plugin = EpicBosses.getInstance(); SkillsFileManager skillsFileManager = plugin.getSkillsFileManager(); BossSkillManager bossSkillManager = plugin.getBossSkillManager(); @@ -45,4 +44,12 @@ public class GroupSkillElement implements ISkillHandler { bossSkillManager.handleSkill(null, skill, nearbyEntities, activeBossHolder, false, true); }); } + + public List getGroupedSkills() { + return this.groupedSkills; + } + + public void setGroupedSkills(List groupedSkills) { + this.groupedSkills = groupedSkills; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java index 60d69c9..4b6e6d4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java @@ -2,13 +2,11 @@ package com.songoda.epicbosses.skills.types; import com.google.gson.annotations.Expose; import com.songoda.epicbosses.holder.ActiveBossHolder; -import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.skills.Skill; +import com.songoda.epicbosses.skills.interfaces.ISkillHandler; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.potion.PotionEffectConverter; import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder; -import lombok.Getter; -import lombok.Setter; import org.bukkit.entity.LivingEntity; import org.bukkit.potion.PotionEffect; @@ -22,7 +20,8 @@ import java.util.List; */ public class PotionSkillElement implements ISkillHandler { - @Expose @Getter @Setter private List potions; + @Expose + private List potions; private PotionEffectConverter potionEffectConverter; @@ -56,4 +55,12 @@ public class PotionSkillElement implements ISkillHandler { nearbyEntities.forEach(nearby -> potionEffects.forEach(nearby::addPotionEffect)); } + + public List getPotions() { + return this.potions; + } + + public void setPotions(List potions) { + this.potions = potions; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java index 4402c66..76a8f3f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java @@ -3,8 +3,6 @@ package com.songoda.epicbosses.targeting; import com.songoda.epicbosses.holder.IActiveHolder; import com.songoda.epicbosses.managers.BossTargetManager; import com.songoda.epicbosses.utils.ServerUtils; -import lombok.Getter; -import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; @@ -22,8 +20,8 @@ import java.util.UUID; */ public abstract class TargetHandler implements ITarget { - @Getter protected final BossTargetManager bossTargetManager; - @Getter protected final Holder holder; + protected final BossTargetManager bossTargetManager; + protected final Holder holder; public TargetHandler(Holder holder, BossTargetManager bossTargetManager) { this.holder = holder; @@ -84,4 +82,11 @@ public abstract class TargetHandler implements ITa }); } + public BossTargetManager getBossTargetManager() { + return this.bossTargetManager; + } + + public Holder getHolder() { + return this.holder; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java index 038011c..ed57c2f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java @@ -6,7 +6,10 @@ import com.songoda.epicbosses.targeting.TargetHandler; import com.songoda.epicbosses.utils.MapUtils; import org.bukkit.entity.LivingEntity; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; /** * @author Charles Cullen diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java index 414fd9e..daf2cd9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -64,7 +64,7 @@ public enum Debug { AUTOSPAWN_INTERVALNOTREAL("The specified interval of {0} is not a valid integer for the auto spawn interval table {1}."); - private static CustomBosses PLUGIN; + private static EpicBosses PLUGIN; private String message; @@ -102,7 +102,7 @@ public enum Debug { PLAIN.debug(message); } - public static void setPlugin(CustomBosses plugin) { + public static void setPlugin(EpicBosses plugin) { PLUGIN = plugin; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java index 148b538..3943fef 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.utils; -import lombok.Getter; import org.bukkit.enchantments.Enchantment; import java.util.ArrayList; @@ -45,9 +44,9 @@ public enum EnchantFinder { mending("Mending", Enchantment.getByName("MENDING"), "mending"), curse_of_vanishing("Curse of Vanishing", Enchantment.getByName("VANISHING_CURSE"), "vanishing", "vanishing curse", "vanishing_curse", "curseofvanishing", "vanishingcurse", "curse of vanishing", "curse_of_vanishing"); - @Getter private List names = new ArrayList<>(); - @Getter private Enchantment enchantment; - @Getter private String fancyName; + private List names = new ArrayList<>(); + private Enchantment enchantment; + private String fancyName; EnchantFinder(String fancyName, Enchantment enchantment, String... names) { this.fancyName = fancyName; @@ -82,4 +81,16 @@ public enum EnchantFinder { return null; } + + public List getNames() { + return this.names; + } + + public Enchantment getEnchantment() { + return this.enchantment; + } + + public String getFancyName() { + return this.fancyName; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java index 9727cc3..4e05852 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.utils; -import lombok.Getter; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.entity.handlers.*; import org.bukkit.Location; @@ -82,10 +81,10 @@ public enum EntityFinder { TRADER_LLAMA("TraderLlama", new TraderLlamaHandler(), "traderllama", "trader_llama", "trader llama", "llamatrader", "llama_trader", "llama trader"), WANDERING_TRADER("WanderingTrader", new WanderingTraderHandler(), "wanderingtrader", "wandering_trader", "wandering trader", "tradervillager", "trader_villager", "trader villager"); - @Getter private ICustomEntityHandler customEntityHandler; - @Getter private List names = new ArrayList<>(); - @Getter private EntityType entityType; - @Getter private String fancyName; + private ICustomEntityHandler customEntityHandler; + private List names = new ArrayList<>(); + private EntityType entityType; + private String fancyName; EntityFinder(String fancyName, ICustomEntityHandler customEntityHandler, String... names) { this.fancyName = fancyName; @@ -139,4 +138,19 @@ public enum EntityFinder { return null; } + public ICustomEntityHandler getCustomEntityHandler() { + return this.customEntityHandler; + } + + public List getNames() { + return this.names; + } + + public EntityType getEntityType() { + return this.entityType; + } + + public String getFancyName() { + return this.fancyName; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java index f0c5973..2730db4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java @@ -184,7 +184,7 @@ public enum Message { Boss_Shop_Disabled("&c&l(!) &cThe boss shop is currently disabled."), Boss_Shop_NoPermission("&c&l(!) &cYou do not have access to this command."), - Boss_Shop_NotEnoughBalance("&c&l(!) &cYou do not have enough money to make this purchase! You need &a$&f{0}&c more."), + Boss_Shop_NotEnoughBalance("&c&l(!) &cYou do not have enough money to make this purchase! You need &a$&f{0}&c."), Boss_Shop_Purchased("&b&lEpicBosses &8» &7You have purchased &f1x {0}&7."), Boss_Skills_NoPermission("&c&l(!) &cYou do not have access to this command."), diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java index 351a3fc..e952ea9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java @@ -3,7 +3,6 @@ package com.songoda.epicbosses.utils; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import java.util.Arrays; import java.util.List; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Permission.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Permission.java index 358f45d..369eaee 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Permission.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Permission.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.utils; -import lombok.Getter; import org.bukkit.command.CommandSender; /** @@ -21,7 +20,7 @@ public enum Permission { shop("boss.shop"), time("boss.time"); - @Getter private String permission; + private String permission; Permission(String permission) { this.permission = permission; @@ -31,4 +30,7 @@ public enum Permission { return commandSender.hasPermission(getPermission()); } + public String getPermission() { + return this.permission; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java index 881a2e5..e4d5afb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java @@ -1,7 +1,5 @@ package com.songoda.epicbosses.utils; -import lombok.Getter; -import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import java.util.ArrayList; @@ -46,9 +44,9 @@ public enum PotionEffectFinder { Weakness("Weakness", PotionEffectType.WEAKNESS), Wither("Wither", PotionEffectType.WITHER, "blackhearts"); - @Getter private List names = new ArrayList<>(); - @Getter private PotionEffectType potionEffectType; - @Getter private String fancyName; + private List names = new ArrayList<>(); + private PotionEffectType potionEffectType; + private String fancyName; PotionEffectFinder(String fancyName, PotionEffectType potionEffectType, String... names) { this.fancyName = fancyName; @@ -80,4 +78,16 @@ public enum PotionEffectFinder { return null; } + + public List getNames() { + return this.names; + } + + public PotionEffectType getPotionEffectType() { + return this.potionEffectType; + } + + public String getFancyName() { + return this.fancyName; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java index 8f666ab..0050999 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java @@ -1,7 +1,5 @@ package com.songoda.epicbosses.utils; -import org.bukkit.Material; - import java.util.Random; /** diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java index 85e229d..0052217 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.Entity; @@ -42,7 +42,7 @@ public class ServerUtils { } public void logDebug(String log) { - if (CustomBosses.get().isDebug()) { + if (EpicBosses.getInstance().isDebug()) { log("&d[EpicBosses] Debug - &7" + log); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java index 10bfe99..3efef29 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java @@ -5,7 +5,10 @@ import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.World; -import java.util.*; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; /** * @author Charles Cullen diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java index 48af03c..b291499 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java @@ -1,7 +1,5 @@ package com.songoda.epicbosses.utils; -import lombok.Getter; - /** * @author Charles Cullen * @version 1.0.0 @@ -23,7 +21,7 @@ public enum Versions { v1_13_R2(12, "1.13.2"), v1_14_R1(13, "1.14"); - @Getter private String displayVersion, bukkitVersion; + private String displayVersion, bukkitVersion; private int weight; Versions(int weight, String displayVersion) { @@ -58,4 +56,11 @@ public enum Versions { return null; } + public String getDisplayVersion() { + return this.displayVersion; + } + + public String getBukkitVersion() { + return this.bukkitVersion; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java index 488adbf..41177a1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java @@ -1,8 +1,8 @@ package com.songoda.epicbosses.utils.dependencies; +import com.songoda.epicbosses.utils.IASkyblockHelper; import com.wasteofplastic.askyblock.ASkyBlock; import com.wasteofplastic.askyblock.Island; -import com.songoda.epicbosses.utils.IASkyblockHelper; import org.bukkit.entity.Player; /** diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/HolographicDisplayHelper.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/HolographicDisplayHelper.java deleted file mode 100644 index 6604156..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/HolographicDisplayHelper.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.songoda.epicbosses.utils.dependencies; - -import com.gmail.filoghost.holographicdisplays.api.Hologram; -import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; -import com.songoda.epicbosses.CustomBosses; -import com.songoda.epicbosses.utils.IHelper; -import org.bukkit.Bukkit; -import org.bukkit.entity.LivingEntity; -import org.bukkit.scheduler.BukkitRunnable; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Jan-19 - */ -public class HolographicDisplayHelper implements IHelper { - - @Override - public boolean isConnected() { - return Bukkit.getPluginManager().getPlugin("HolographicDisplays") != null; - } - - public void createHologram(LivingEntity livingEntity, String line) { - CustomBosses plugin = CustomBosses.get(); - Hologram hologram = HologramsAPI.createHologram(plugin, livingEntity.getEyeLocation()); - - hologram.appendTextLine(line); - - new BukkitRunnable() { - @Override - public void run() { - if(!livingEntity.isDead()) { - hologram.teleport(livingEntity.getEyeLocation()); - } else { - hologram.delete(); - cancel(); - } - } - }.runTaskTimer(plugin, 1L, 1L); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/VaultHelper.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/VaultHelper.java deleted file mode 100644 index a96aeeb..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/VaultHelper.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.songoda.epicbosses.utils.dependencies; - -import com.songoda.epicbosses.utils.IHelper; -import lombok.Getter; -import net.milkbowl.vault.economy.Economy; -import org.bukkit.Bukkit; -import org.bukkit.plugin.RegisteredServiceProvider; - -/** - * @author AMinecraftDev - * @version 1.0.0 - * @since 25-May-17 - */ -public class VaultHelper implements IHelper { - - private Economy economy; - - @Override - public boolean isConnected() { - return setupEconomy(); - } - - public Economy getEconomy() { - if(this.economy == null) { - RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class); - - if (rsp == null) { - return null; - } - - this.economy = rsp.getProvider(); - } - - return this.economy; - } - - private boolean setupEconomy() { - return Bukkit.getServer().getPluginManager().getPlugin("Vault") != null; - } - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/ICustomEntityHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/ICustomEntityHandler.java index 52ab0ea..80e61ce 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/ICustomEntityHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/ICustomEntityHandler.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.utils.entity; import org.bukkit.Location; -import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; /** diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java index a969ad1..3435687 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java @@ -4,7 +4,8 @@ import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; -import org.bukkit.entity.*; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; /** * @author Charles Cullen diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java index 17842ef..770044e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java @@ -5,7 +5,6 @@ import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; -import org.bukkit.entity.Fish; import org.bukkit.entity.LivingEntity; public class FishHandler implements ICustomEntityHandler { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java index 529b1af..b43ea59 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java @@ -4,7 +4,9 @@ import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; -import org.bukkit.entity.*; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Rabbit; /** * @author Charles Cullen diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java index 7f291f1..2a40138 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java index fe5fe33..9d3134d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java @@ -2,17 +2,12 @@ package com.songoda.epicbosses.utils.file; import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.version.VersionHandler; -import lombok.Getter; import org.bukkit.plugin.java.JavaPlugin; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.regex.Pattern; /** * @author Charles Cullen @@ -24,7 +19,7 @@ public abstract class FileHandler implements IFileHandler { private final JavaPlugin javaPlugin; private final boolean saveResource; - @Getter private final File file; + private final File file; public FileHandler(JavaPlugin javaPlugin, boolean saveResource, File file) { this.javaPlugin = javaPlugin; @@ -52,4 +47,7 @@ public abstract class FileHandler implements IFileHandler { } } + public File getFile() { + return this.file; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java index b861e65..95af4e1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.file; import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.version.VersionHandler; -import lombok.Getter; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.plugin.java.JavaPlugin; @@ -21,7 +20,7 @@ public class YmlFileHandler implements IFileHandler { private final JavaPlugin javaPlugin; private final boolean saveResource; - @Getter private final File file; + private final File file; public YmlFileHandler(JavaPlugin javaPlugin, boolean saveResource, File file) { this.javaPlugin = javaPlugin; @@ -34,15 +33,9 @@ public class YmlFileHandler implements IFileHandler { if(!this.file.exists()) { if(this.saveResource) { String name = this.file.getName(); - String folder = new VersionHandler().getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1) ? "/current/" : "/legacy/"; - String path = folder + name; - try (InputStream resourceStream = this.getClass().getResourceAsStream(path)) { - Files.copy(resourceStream, new File(this.javaPlugin.getDataFolder(), name).toPath()); - return; - } catch (IOException e) { - e.printStackTrace(); - } + System.out.println(name); + javaPlugin.saveResource(name, false); } FileUtils.get().createFile(this.file); @@ -59,4 +52,7 @@ public class YmlFileHandler implements IFileHandler { FileUtils.get().saveFile(this.file, config); } + public File getFile() { + return this.file; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java index f0f64b4..97cdb63 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.utils.itemstack; +import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.epicbosses.utils.IConverter; import com.songoda.epicbosses.utils.exceptions.NotImplementedException; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; @@ -20,7 +21,7 @@ public class ItemStackHolderConverter implements IConverter lore = (List) configurationSection.getList("lore", null); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/holder/ItemStackHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/holder/ItemStackHolder.java index a3aa356..3a42428 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/holder/ItemStackHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/holder/ItemStackHolder.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.utils.itemstack.holder; import com.google.gson.annotations.Expose; -import lombok.Getter; import java.util.List; @@ -12,14 +11,22 @@ import java.util.List; */ public class ItemStackHolder { - @Expose @Getter private Integer amount; - @Expose @Getter private String type; - @Expose @Getter private Short durability; - @Expose @Getter private String name; - @Expose @Getter private List lore; - @Expose @Getter private List enchants; - @Expose @Getter private String skullOwner; - @Expose @Getter private Short spawnerId; + @Expose + private Integer amount; + @Expose + private String type; + @Expose + private Short durability; + @Expose + private String name; + @Expose + private List lore; + @Expose + private List enchants; + @Expose + private String skullOwner; + @Expose + private Short spawnerId; public ItemStackHolder(Integer amount, String type, Short durability, String name, List lore, List enchants, String skullOwner, Short spawnerId) { this.amount = amount; @@ -32,4 +39,35 @@ public class ItemStackHolder { this.spawnerId = spawnerId; } + public Integer getAmount() { + return this.amount; + } + + public String getType() { + return this.type; + } + + public Short getDurability() { + return this.durability; + } + + public String getName() { + return this.name; + } + + public List getLore() { + return this.lore; + } + + public List getEnchants() { + return this.enchants; + } + + public String getSkullOwner() { + return this.skullOwner; + } + + public Short getSpawnerId() { + return this.spawnerId; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java index 5a05536..57ed006 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java @@ -1,24 +1,21 @@ package com.songoda.epicbosses.utils.panel; -import com.songoda.epicbosses.utils.panel.base.*; -import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; -import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; -import lombok.Getter; import com.songoda.epicbosses.utils.ICloneable; import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackConverter; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; +import com.songoda.epicbosses.utils.panel.base.*; +import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; +import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; import com.songoda.epicbosses.utils.panel.builder.PanelBuilderSettings; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; -import org.bukkit.event.Event; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; -import org.bukkit.event.inventory.InventoryEvent; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -39,8 +36,8 @@ public class Panel implements Listener, ICloneable { // //-------------------------------------------------- - @Getter private static final ItemStackConverter ITEM_STACK_CONVERTER = new ItemStackConverter(); - @Getter private static final List PANELS = new ArrayList<>(); + private static final ItemStackConverter ITEM_STACK_CONVERTER = new ItemStackConverter(); + private static final List PANELS = new ArrayList<>(); private static JavaPlugin PLUGIN; @@ -57,13 +54,13 @@ public class Panel implements Listener, ICloneable { private final Map currentPageContainer = new HashMap<>(); private final List openedUsers = new ArrayList<>(); - @Getter private boolean cancelClick = true, destroyWhenDone = true, cancelLowerClick = true; - @Getter private PanelBuilderSettings panelBuilderSettings; - @Getter private PanelBuilderCounter panelBuilderCounter; - @Getter private Sound clickSound = null; - @Getter private String title; - @Getter private Inventory inventory; - @Getter private int viewers = 0; + private boolean cancelClick = true, destroyWhenDone = true, cancelLowerClick = true; + private PanelBuilderSettings panelBuilderSettings; + private PanelBuilderCounter panelBuilderCounter; + private Sound clickSound = null; + private String title; + private Inventory inventory; + private int viewers = 0; private PageAction onPageChange = (player, currentPage, requestedPage) -> false; private PanelCloseAction panelClose = (p) -> {}; @@ -125,6 +122,14 @@ public class Panel implements Listener, ICloneable { PANELS.add(this); } + public static ItemStackConverter getITEM_STACK_CONVERTER() { + return Panel.ITEM_STACK_CONVERTER; + } + + public static List getPANELS() { + return Panel.PANELS; + } + //-------------------------------------------------- // // P A N E L L I S T E N E R S @@ -646,4 +651,40 @@ public class Panel implements Listener, ICloneable { public static void setPlugin(JavaPlugin javaPlugin) { PLUGIN = javaPlugin; } + + public boolean isCancelClick() { + return this.cancelClick; + } + + public boolean isDestroyWhenDone() { + return this.destroyWhenDone; + } + + public boolean isCancelLowerClick() { + return this.cancelLowerClick; + } + + public PanelBuilderSettings getPanelBuilderSettings() { + return this.panelBuilderSettings; + } + + public PanelBuilderCounter getPanelBuilderCounter() { + return this.panelBuilderCounter; + } + + public Sound getClickSound() { + return this.clickSound; + } + + public String getTitle() { + return this.title; + } + + public Inventory getInventory() { + return this.inventory; + } + + public int getViewers() { + return this.viewers; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/SubVariablePanelHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/SubVariablePanelHandler.java index 36473f7..0b33c48 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/SubVariablePanelHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/SubVariablePanelHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.panel.base.handlers; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler; -import com.songoda.epicbosses.utils.panel.base.handlers.BasePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; import org.bukkit.configuration.ConfigurationSection; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/VariablePanelHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/VariablePanelHandler.java index a36b254..aff4016 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/VariablePanelHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/VariablePanelHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.panel.base.handlers; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler; -import com.songoda.epicbosses.utils.panel.base.handlers.BasePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; /** diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java index 5fb2b88..ee182f0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.utils.panel.builder; -import lombok.Getter; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; @@ -23,12 +22,12 @@ import java.util.Set; */ public class PanelBuilder { - @Getter private final Map replaceMap = new HashMap<>(); + private final Map replaceMap = new HashMap<>(); private final Set defaultSlots = new HashSet<>(); private final ConfigurationSection configurationSection; private final PanelBuilderSettings panelBuilderSettings; - @Getter private PanelBuilderCounter panelBuilderCounter; + private PanelBuilderCounter panelBuilderCounter; private String title; private Inventory inventory; @@ -157,4 +156,12 @@ public class PanelBuilder { return input; } + + public Map getReplaceMap() { + return this.replaceMap; + } + + public PanelBuilderCounter getPanelBuilderCounter() { + return this.panelBuilderCounter; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java index 324c2cd..8e92f1f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.utils.panel.builder; -import lombok.Getter; import com.songoda.epicbosses.utils.panel.base.ClickAction; import org.bukkit.inventory.ItemStack; @@ -16,12 +15,12 @@ import java.util.Set; */ public class PanelBuilderCounter { - @Getter private final Map> specialValuesCounter = new HashMap<>(); - @Getter private final Map> slotsWithCounter = new HashMap<>(); - @Getter private final Map clickActions = new HashMap<>(); - @Getter private final Map buttonCounters = new HashMap<>(); - @Getter private final Map itemStacks = new HashMap<>(); - @Getter private final Map pageData = new HashMap<>(); + private final Map> specialValuesCounter = new HashMap<>(); + private final Map> slotsWithCounter = new HashMap<>(); + private final Map clickActions = new HashMap<>(); + private final Map buttonCounters = new HashMap<>(); + private final Map itemStacks = new HashMap<>(); + private final Map pageData = new HashMap<>(); public boolean isButtonAtSlot(int slot) { for (Set integers : this.slotsWithCounter.values()) { @@ -102,4 +101,27 @@ public class PanelBuilderCounter { return clone; } + public Map> getSpecialValuesCounter() { + return this.specialValuesCounter; + } + + public Map> getSlotsWithCounter() { + return this.slotsWithCounter; + } + + public Map getClickActions() { + return this.clickActions; + } + + public Map getButtonCounters() { + return this.buttonCounters; + } + + public Map getItemStacks() { + return this.itemStacks; + } + + public Map getPageData() { + return this.pageData; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java index 0e0661a..64aa7b8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.utils.panel.builder; -import lombok.Getter; import com.songoda.epicbosses.utils.itemstack.ItemStackHolderConverter; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; import org.bukkit.configuration.ConfigurationSection; @@ -12,9 +11,9 @@ import org.bukkit.configuration.ConfigurationSection; */ public class PanelBuilderSettings { - @Getter private boolean emptySpaceFiller, backButton, exitButton; - @Getter private int fillTo, backButtonSlot, exitButtonSlot; - @Getter private ItemStackHolder emptySpaceFillerItem; + private boolean emptySpaceFiller, backButton, exitButton; + private int fillTo, backButtonSlot, exitButtonSlot; + private ItemStackHolder emptySpaceFillerItem; public PanelBuilderSettings(ConfigurationSection configurationSection) { ItemStackHolderConverter itemStackHolderConverter = new ItemStackHolderConverter(); @@ -30,4 +29,31 @@ public class PanelBuilderSettings { this.emptySpaceFillerItem = itemStackHolderConverter.to(configurationSection.getConfigurationSection("EmptySpaceFiller")); } + public boolean isEmptySpaceFiller() { + return this.emptySpaceFiller; + } + + public boolean isBackButton() { + return this.backButton; + } + + public boolean isExitButton() { + return this.exitButton; + } + + public int getFillTo() { + return this.fillTo; + } + + public int getBackButtonSlot() { + return this.backButtonSlot; + } + + public int getExitButtonSlot() { + return this.exitButtonSlot; + } + + public ItemStackHolder getEmptySpaceFillerItem() { + return this.emptySpaceFillerItem; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/holder/PotionEffectHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/holder/PotionEffectHolder.java index 81b3f88..60602ba 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/holder/PotionEffectHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/holder/PotionEffectHolder.java @@ -1,8 +1,6 @@ package com.songoda.epicbosses.utils.potion.holder; import com.google.gson.annotations.Expose; -import lombok.Getter; -import lombok.Setter; /** * @author Charles Cullen @@ -11,8 +9,10 @@ import lombok.Setter; */ public class PotionEffectHolder { - @Expose @Getter @Setter private String type; - @Expose @Getter @Setter private Integer level, duration; + @Expose + private String type; + @Expose + private Integer level, duration; public PotionEffectHolder(String type, Integer level, Integer duration) { this.type = type; @@ -20,4 +20,27 @@ public class PotionEffectHolder { this.duration = duration; } + public String getType() { + return this.type; + } + + public Integer getLevel() { + return this.level; + } + + public Integer getDuration() { + return this.duration; + } + + public void setType(String type) { + this.type = type; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public void setDuration(Integer duration) { + this.duration = duration; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java index dcf0ce0..bc80bf0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java @@ -1,11 +1,8 @@ package com.songoda.epicbosses.utils.version; -import lombok.Getter; import com.songoda.epicbosses.utils.Versions; import org.bukkit.Bukkit; import org.bukkit.entity.HumanEntity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; /** @@ -15,7 +12,7 @@ import org.bukkit.inventory.ItemStack; */ public class VersionHandler { - @Getter private Versions version; + private Versions version; public VersionHandler() { String v = Bukkit.getServer().getClass().getPackage().getName(); @@ -45,4 +42,7 @@ public class VersionHandler { } } + public Versions getVersion() { + return this.version; + } } diff --git a/plugin-modules/WorldGuardHelper/pom.xml b/plugin-modules/WorldGuardHelper/pom.xml deleted file mode 100644 index 09c0e04..0000000 --- a/plugin-modules/WorldGuardHelper/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - EpicBosses - com.songoda.epicbosses - maven-version-number - ../../pom.xml - - 4.0.0 - - WorldGuardHelper - - - - org.spigotmc - spigot - 1.14.4 - provided - - - \ No newline at end of file diff --git a/plugin-modules/WorldGuardHelper/src/com/songoda/epicbosses/utils/IWorldGuardHelper.java b/plugin-modules/WorldGuardHelper/src/com/songoda/epicbosses/utils/IWorldGuardHelper.java deleted file mode 100644 index 766eda0..0000000 --- a/plugin-modules/WorldGuardHelper/src/com/songoda/epicbosses/utils/IWorldGuardHelper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.songoda.epicbosses.utils; - -import org.bukkit.Location; - -import java.util.List; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 16-Oct-18 - */ -public interface IWorldGuardHelper { - - boolean isPvpAllowed(Location location); - - boolean isBreakAllowed(Location location); - - boolean isExplosionsAllowed(Location location); - - List getRegionNames(Location location); - - boolean isMobSpawningAllowed(Location location); - -} diff --git a/pom.xml b/pom.xml index f5c7dff..9f7a835 100644 --- a/pom.xml +++ b/pom.xml @@ -14,27 +14,18 @@ api-modules/FactionsOne api-modules/FactionsUUID api-modules/LegacyFactions - api-modules/WorldGuard - api-modules/WorldGuard-Legacy plugin-modules/Core plugin-modules/FactionHelper - plugin-modules/WorldGuardHelper maven-version-number EpicBosses - com.songoda.epicbosses.CustomBosses + com.songoda.epicbosses.EpicBosses AMinecraftDev - - net.milkbowl - vault - 1.7.1 - provided - com.wasteofplastic askyblock @@ -47,18 +38,6 @@ 1.16.22 provided - - org.bstats - bstats-bukkit - 1.2 - compile - - - com.gmail.filoghost.holographicdisplays - holographicdisplays-api - 2.3.2 - provided - me.clip placeholderapi @@ -72,10 +51,6 @@ private-repo http://repo.songoda.com/artifactory/private/ - - bstats-repo - http://repo.bstats.org/content/repositories/releases/ - @@ -138,21 +113,6 @@ LegacyFactions ${project.version} - - ${project.groupId} - WorldGuardHelper - ${project.version} - - - ${project.groupId} - WorldGuard - ${project.version} - - - ${project.groupId} - WorldGuard-Legacy - ${project.version} - ${project.groupId} Core From 22d58040f2400e993d59e137c95a13674ea254d9 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 17:24:55 -0400 Subject: [PATCH 03/16] Converted to Core versioning system. --- .../skills/custom/PotionSkillEditorPanel.java | 4 +- .../potions/PotionEffectTypeEditorPanel.java | 18 +-- .../epicbosses/skills/custom/Cage.java | 8 +- .../epicbosses/skills/custom/Minions.java | 17 +-- .../songoda/epicbosses/utils/Versions.java | 66 --------- .../utils/entity/handlers/CatHandler.java | 7 +- .../utils/entity/handlers/DolphinHandler.java | 4 +- .../entity/handlers/DonkeyHorseHandler.java | 11 +- .../utils/entity/handlers/DrownedHandler.java | 4 +- .../entity/handlers/ElderGuardianHandler.java | 5 +- .../entity/handlers/EndermiteHandler.java | 5 +- .../utils/entity/handlers/EvokerHandler.java | 7 +- .../utils/entity/handlers/FishHandler.java | 5 +- .../utils/entity/handlers/FoxHandler.java | 5 +- .../entity/handlers/GuardianHandler.java | 8 +- .../entity/handlers/HuskZombieHandler.java | 8 +- .../entity/handlers/IllusionerHandler.java | 8 +- .../entity/handlers/KillerBunnyHandler.java | 8 +- .../utils/entity/handlers/LlamaHandler.java | 10 +- .../entity/handlers/MuleHorseHandler.java | 10 +- .../utils/entity/handlers/PandaHandler.java | 5 +- .../utils/entity/handlers/ParrotHandler.java | 10 +- .../utils/entity/handlers/PhantomHandler.java | 8 +- .../entity/handlers/PillagerHandler.java | 5 +- .../entity/handlers/PolarBearHandler.java | 7 +- .../utils/entity/handlers/RabbitHandler.java | 6 +- .../utils/entity/handlers/RavagerHandler.java | 5 +- .../utils/entity/handlers/ShulkerHandler.java | 4 +- .../entity/handlers/SkeletonHorseHandler.java | 8 +- .../entity/handlers/StraySkeletonHandler.java | 10 +- .../entity/handlers/TraderLlamaHandler.java | 8 +- .../utils/entity/handlers/TurtleHandler.java | 8 +- .../utils/entity/handlers/VexHandler.java | 7 +- .../entity/handlers/VindicatorHandler.java | 8 +- .../handlers/WanderingTraderHandler.java | 7 +- .../handlers/WitherSkeletonHandler.java | 4 +- .../entity/handlers/ZombieHorseHandler.java | 8 +- .../handlers/ZombieVillagerHandler.java | 9 +- .../epicbosses/utils/file/FileHandler.java | 18 +-- .../epicbosses/utils/file/YmlFileHandler.java | 9 +- .../utils/itemstack/ItemStackUtils.java | 137 +++++++++--------- .../utils/itemstack/MaterialUtils.java | 10 -- .../utils/version/VersionHandler.java | 23 +-- 43 files changed, 173 insertions(+), 369 deletions(-) delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java index 6e7d980..6bdd34f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java @@ -1,6 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom; import com.google.gson.JsonObject; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; @@ -11,7 +12,6 @@ import com.songoda.epicbosses.skills.types.PotionSkillElement; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler; @@ -110,7 +110,7 @@ public class PotionSkillEditorPanel extends VariablePanelHandler { ItemStack itemStack = new ItemStack(Material.POTION); PotionMeta potionMeta = (PotionMeta) itemStack.getItemMeta(); - if (new VersionHandler().getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) { PotionType potionType = PotionType.getByEffect(PotionEffectType.BLINDNESS); if (potionType == null) potionType = PotionType.WATER; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/PotionEffectTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/PotionEffectTypeEditorPanel.java index d803a9f..fb5c253 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/PotionEffectTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/PotionEffectTypeEditorPanel.java @@ -1,19 +1,18 @@ package com.songoda.epicbosses.panel.skills.custom.potions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.utils.PotionEffectFinder; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.handlers.SubVariablePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; import com.songoda.epicbosses.utils.potion.PotionEffectConverter; import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -50,7 +49,7 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, list, skill, potionEffectHolder); return true; @@ -77,14 +76,15 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler panel.loadPage(requestedPage, ((slot, realisticSlot) -> { - if(slot >= potionEffectTypes.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= potionEffectTypes.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { PotionEffectType potionEffectType = potionEffectTypes.get(slot); ItemStack itemStack = new ItemStack(Material.POTION); PotionMeta potionMeta = (PotionMeta) itemStack.getItemMeta(); - if (new VersionHandler().getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) { PotionType potionType = PotionType.getByEffect(potionEffectType); if (potionType == null) potionType = PotionType.WATER; @@ -101,7 +101,7 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler { PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByEffect(potionEffectType); - if(potionEffectFinder != null) { + if (potionEffectFinder != null) { potionEffectHolder.setType(potionEffectFinder.getFancyName()); this.bossPanelManager.getCreatePotionEffectMenu().openFor((Player) e.getWhoClicked(), skill, potionEffectHolder); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java index 8374e32..7db4245 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java @@ -1,5 +1,7 @@ package com.songoda.epicbosses.skills.custom; +import com.songoda.core.compatibility.CompatibleMaterial; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.holder.ActiveBossHolder; @@ -83,8 +85,8 @@ public class Cage extends CustomSkillHandler { @Override public List getOtherSkillDataActions(Skill skill, CustomSkillElement customSkillElement) { List clickActions = new ArrayList<>(); - ItemStack clickStack = new ItemStack(versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1) ? Material.STONE_PRESSURE_PLATE : Material.valueOf("STONE_PLATE")); - ItemStack duration = new ItemStack(versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1) ? Material.CLOCK : Material.valueOf("WATCH")); + ItemStack clickStack = CompatibleMaterial.STONE_PRESSURE_PLATE.getItem(); + ItemStack duration = CompatibleMaterial.CLOCK.getItem(); ClickAction flatAction = (event -> this.flatTypeEditor.openFor((Player) event.getWhoClicked(), skill, customSkillElement)); ClickAction wallAction = (event -> this.wallTypeEditor.openFor((Player) event.getWhoClicked(), skill, customSkillElement)); ClickAction insideAction = (event -> this.insideTypeEditor.openFor((Player) event.getWhoClicked(), skill, customSkillElement)); @@ -140,7 +142,7 @@ public class Cage extends CustomSkillHandler { BlockState oldState = cageLocationData.getOldBlockState(); if(oldState != null) { - if (versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) { location.getBlock().setBlockData(oldState.getBlockData()); } else { if (setBlockDataMethod == null) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java index 549e19d..36e31ba 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.skills.custom; +import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.holder.ActiveBossHolder; @@ -12,9 +13,7 @@ import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement; import com.songoda.epicbosses.skills.types.CustomSkillElement; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; -import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.panel.base.ClickAction; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Material; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -31,8 +30,6 @@ import java.util.List; */ public class Minions extends CustomSkillHandler { - private static final VersionHandler versionHandler = new VersionHandler(); - private EpicBosses plugin; public Minions(EpicBosses plugin) { @@ -54,7 +51,7 @@ public class Minions extends CustomSkillHandler { List clickActions = new ArrayList<>(); clickActions.add(BossSkillManager.createCustomSkillAction("Amount Editor", getAmountCurrent(customSkillElement), new ItemStack(Material.REDSTONE), getAmountAction(skill, customSkillElement))); - clickActions.add(BossSkillManager.createCustomSkillAction("Minion to Spawn Editor", getMinionToSpawnCurrent(customSkillElement), new ItemStack(versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1) ? Material.CREEPER_SPAWN_EGG : Material.valueOf("MONSTER_EGG")), getMinionToSpawnAction(skill, customSkillElement))); + clickActions.add(BossSkillManager.createCustomSkillAction("Minion to Spawn Editor", getMinionToSpawnCurrent(customSkillElement), CompatibleMaterial.CREEPER_SPAWN_EGG.getItem(), getMinionToSpawnAction(skill, customSkillElement))); return clickActions; } @@ -77,7 +74,7 @@ public class Minions extends CustomSkillHandler { private String getAmountCurrent(CustomSkillElement customSkillElement) { CustomMinionSkillElement customMinionSkillElement = customSkillElement.getCustom().getCustomMinionSkillData(); - return ""+customMinionSkillElement.getAmount(); + return "" + customMinionSkillElement.getAmount(); } private ClickAction getAmountAction(Skill skill, CustomSkillElement customSkillElement) { @@ -86,7 +83,7 @@ public class Minions extends CustomSkillHandler { ClickType clickType = event.getClick(); Integer amountToModifyBy; - if(clickType.name().contains("RIGHT")) { + if (clickType.name().contains("RIGHT")) { amountToModifyBy = -1; } else { amountToModifyBy = 1; @@ -96,9 +93,9 @@ public class Minions extends CustomSkillHandler { String modifyValue; Integer newAmount; - if(currentAmount == null) currentAmount = 0; + if (currentAmount == null) currentAmount = 0; - if(amountToModifyBy > 0.0) { + if (amountToModifyBy > 0.0) { modifyValue = "increased"; newAmount = currentAmount + amountToModifyBy; } else { @@ -106,7 +103,7 @@ public class Minions extends CustomSkillHandler { newAmount = currentAmount + amountToModifyBy; } - if(newAmount <= 0) { + if (newAmount <= 0) { newAmount = 0; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java deleted file mode 100644 index b291499..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.songoda.epicbosses.utils; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 27-Jun-18 - */ -public enum Versions { - - v1_7_R3(1, "1.7.9"), - v1_7_R4(2, "1.7.10"), - v1_8_R1(3, "1.8"), - v1_8_R2(4, "1.8.3"), - v1_8_R3(5, "1.8.9"), - v1_9_R1(6, "1.9"), - v1_9_R2(7, "1.9.4"), - v1_10_R1(8, "1.10"), - v1_11_R1(9, "1.11.2"), - v1_12_R1(10, "1.12.1"), - v1_13_R1(11, "1.13"), - v1_13_R2(12, "1.13.2"), - v1_14_R1(13, "1.14"); - - private String displayVersion, bukkitVersion; - private int weight; - - Versions(int weight, String displayVersion) { - this.weight = weight; - this.displayVersion = displayVersion; - this.bukkitVersion = name(); - } - - public boolean isLessThan(Versions input) { - return this.weight < input.weight; - } - - public boolean isLessThanOrEqualTo(Versions input) { - return this.weight <= input.weight; - } - - public boolean isHigherThanOrEqualTo(Versions input) { - return this.weight >= input.weight; - } - - public boolean isHigherThan(Versions input) { - return this.weight > input.weight; - } - - public static Versions getVersion(String input) { - for(Versions versions : values()) { - if(versions.getBukkitVersion().equalsIgnoreCase(input)) { - return versions; - } - } - - return null; - } - - public String getDisplayVersion() { - return this.displayVersion; - } - - public String getBukkitVersion() { - return this.bukkitVersion; - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java index ef57fc0..454e160 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java @@ -1,19 +1,16 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class CatHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) { throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java index 65c5fd0..94d71e3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -13,7 +13,7 @@ public class DolphinHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) { throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DonkeyHorseHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DonkeyHorseHandler.java index 58605ad..b907c8c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DonkeyHorseHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DonkeyHorseHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Horse; @@ -15,17 +14,13 @@ import org.bukkit.entity.LivingEntity; */ public class DonkeyHorseHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); - } - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.DONKEY); - } Horse horse = (Horse) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.HORSE); horse.setVariant(Horse.Variant.DONKEY); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java index 044749a..17454ed 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -13,7 +13,7 @@ public class DrownedHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) { throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java index 3435687..f9657fd 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -18,9 +18,8 @@ public class ElderGuardianHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThanOrEqualTo(Versions.v1_7_R4)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ELDER_GUARDIAN); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java index 2bb9325..712424d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -18,9 +18,8 @@ public class EndermiteHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_8_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ENDERMITE); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java index aae40f9..8f3c4f4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,11 +13,9 @@ import org.bukkit.entity.LivingEntity; */ public class EvokerHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) { throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java index 770044e..ec97d9f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -13,9 +13,8 @@ public class FishHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); - } EntityType fishEntityType; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java index b55c410..7aa1117 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -13,9 +13,8 @@ public class FoxHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.FOX); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/GuardianHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/GuardianHandler.java index df8e77a..1c41e99 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/GuardianHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/GuardianHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,13 +13,10 @@ import org.bukkit.entity.LivingEntity; */ public class GuardianHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_8_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.GUARDIAN); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/HuskZombieHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/HuskZombieHandler.java index 5f1f67d..e7b6942 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/HuskZombieHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/HuskZombieHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,13 +13,10 @@ import org.bukkit.entity.LivingEntity; */ public class HuskZombieHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_10_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_10)) return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.HUSK); - } throw new NullPointerException("This feature is only implemented in version 1.10 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/IllusionerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/IllusionerHandler.java index 8e81c9c..91e30f2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/IllusionerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/IllusionerHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -15,13 +14,10 @@ import org.bukkit.entity.LivingEntity; */ public class IllusionerHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if (this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ILLUSIONER); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java index b43ea59..785cf26 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -15,13 +14,10 @@ import org.bukkit.entity.Rabbit; */ public class KillerBunnyHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThanOrEqualTo(Versions.v1_7_R4)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); - } Rabbit rabbit = (Rabbit) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.RABBIT); rabbit.setRabbitType(Rabbit.Type.THE_KILLER_BUNNY); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/LlamaHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/LlamaHandler.java index a4da4db..05303d4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/LlamaHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/LlamaHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Horse; @@ -15,15 +14,12 @@ import org.bukkit.entity.LivingEntity; */ public class LlamaHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); - } - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) { return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.LLAMA); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MuleHorseHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MuleHorseHandler.java index 3f92690..210fb2f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MuleHorseHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MuleHorseHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Horse; @@ -15,17 +14,14 @@ import org.bukkit.entity.LivingEntity; */ public class MuleHorseHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); - } - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.MULE); - } Horse horse = (Horse) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.HORSE); horse.setVariant(Horse.Variant.MULE); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java index 1a68f7c..0b5e94c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -13,9 +13,8 @@ public class PandaHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PANDA); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java index 67e6047..8070e52 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,13 +13,10 @@ import org.bukkit.entity.LivingEntity; */ public class ParrotHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_12_R1)) { - throw new NullPointerException("This feature is only implemented in version 1.12 and above of Minecraft."); - } + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_12)) + throw new NullPointerException("This feature is only implemented in version 1.12 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PARROT); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java index 4acb87a..3a97245 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -10,13 +9,10 @@ import org.bukkit.entity.Phantom; public class PhantomHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); - } int size = 4; if (entityType.contains(":")) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java index 4ed62ad..69515db 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -13,9 +13,8 @@ public class PillagerHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PILLAGER); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java index fabdb61..dbac2b4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -14,13 +14,10 @@ import org.bukkit.entity.LivingEntity; */ public class PolarBearHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_10_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_10)) throw new NullPointerException("This feature is only implemented in version 1.10 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.POLAR_BEAR); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RabbitHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RabbitHandler.java index c884972..10e0a5a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RabbitHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RabbitHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,11 +13,10 @@ import org.bukkit.entity.LivingEntity; */ public class RabbitHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_8_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) { throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java index ec564e6..b723742 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -9,11 +9,10 @@ import org.bukkit.entity.LivingEntity; public class RavagerHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) { throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java index 772a091..585deb9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -18,7 +18,7 @@ public class ShulkerHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_9_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { throw new NullPointerException("This feature is only implemented in version 1.9 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/SkeletonHorseHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/SkeletonHorseHandler.java index 574d126..d8bc2c0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/SkeletonHorseHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/SkeletonHorseHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Horse; @@ -15,13 +14,10 @@ import org.bukkit.entity.LivingEntity; */ public class SkeletonHorseHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.SKELETON_HORSE); - } Horse horse = (Horse) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.HORSE); horse.setVariant(Horse.Variant.SKELETON_HORSE); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java index 8af7047..5c28486 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -15,17 +15,13 @@ import org.bukkit.entity.Skeleton; */ public class StraySkeletonHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThanOrEqualTo(Versions.v1_9_R2)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_10)) throw new NullPointerException("This feature is only implemented in version 1.10 and above of Minecraft."); - } - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_10)) return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.STRAY); - } Skeleton skeleton = (Skeleton) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.SKELETON); skeleton.setSkeletonType(Skeleton.SkeletonType.STRAY); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TraderLlamaHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TraderLlamaHandler.java index 4c384b4..85f4916 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TraderLlamaHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TraderLlamaHandler.java @@ -1,21 +1,17 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class TraderLlamaHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_12)) throw new NullPointerException("This feature is only implemented in version 1.12 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.TRADER_LLAMA); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java index 1b68500..ab4435d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java @@ -1,21 +1,17 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class TurtleHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_13_R1)) { + if(ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.TURTLE); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java index e7e8ebf..5ac92a1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -14,13 +14,10 @@ import org.bukkit.entity.LivingEntity; */ public class VexHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.VEX); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VindicatorHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VindicatorHandler.java index dec5c78..9efb1d5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VindicatorHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VindicatorHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,13 +13,10 @@ import org.bukkit.entity.LivingEntity; */ public class VindicatorHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); - } return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.VINDICATOR); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WanderingTraderHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WanderingTraderHandler.java index 286e7d5..c1d842b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WanderingTraderHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WanderingTraderHandler.java @@ -1,19 +1,16 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class WanderingTraderHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isLessThan(Versions.v1_14_R1)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) { throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java index e6c05d3..ada2add 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; @@ -19,7 +19,7 @@ public class WitherSkeletonHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) { return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.WITHER_SKELETON); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieHorseHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieHorseHandler.java index bb16d25..e6d8618 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieHorseHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieHorseHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Horse; @@ -15,13 +14,10 @@ import org.bukkit.entity.LivingEntity; */ public class ZombieHorseHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ZOMBIE_HORSE); - } Horse horse = (Horse) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.HORSE); horse.setVariant(Horse.Variant.UNDEAD_HORSE); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieVillagerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieVillagerHandler.java index ae5a855..1a97e43 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieVillagerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ZombieVillagerHandler.java @@ -1,8 +1,7 @@ package com.songoda.epicbosses.utils.entity.handlers; -import com.songoda.epicbosses.utils.Versions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.*; @@ -13,15 +12,13 @@ import org.bukkit.entity.*; */ public class ZombieVillagerHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(this.versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_11_R1)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) { ZombieVillager zombieVillager = (ZombieVillager) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ZOMBIE_VILLAGER); String[] split = entityType.split(":"); - if(split.length == 2) { + if (split.length == 2) { String type = split[1]; Villager.Profession profession; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java index 9d3134d..950a986 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileHandler.java @@ -1,13 +1,8 @@ package com.songoda.epicbosses.utils.file; -import com.songoda.epicbosses.utils.Versions; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.plugin.java.JavaPlugin; import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; /** * @author Charles Cullen @@ -29,18 +24,11 @@ public abstract class FileHandler implements IFileHandler { @Override public void createFile() { - if(!this.file.exists()) { - if(this.saveResource) { + if (!this.file.exists()) { + if (this.saveResource) { String name = this.file.getName(); - String folder = new VersionHandler().getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1) ? "/current/" : "/legacy/"; - String path = folder + name; - try (InputStream resourceStream = this.getClass().getResourceAsStream(path)) { - Files.copy(resourceStream, new File(this.javaPlugin.getDataFolder(), name).toPath()); - return; - } catch (IOException e) { - e.printStackTrace(); - } + javaPlugin.saveResource(name, false); } FileUtils.get().createFile(this.file); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java index 95af4e1..4702273 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java @@ -1,14 +1,9 @@ package com.songoda.epicbosses.utils.file; -import com.songoda.epicbosses.utils.Versions; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.plugin.java.JavaPlugin; import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; /** * @author Charles Cullen @@ -30,8 +25,8 @@ public class YmlFileHandler implements IFileHandler { @Override public void createFile() { - if(!this.file.exists()) { - if(this.saveResource) { + if (!this.file.exists()) { + if (this.saveResource) { String name = this.file.getName(); System.out.println(name); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java index 57d83ef..ec73a16 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java @@ -1,9 +1,10 @@ package com.songoda.epicbosses.utils.itemstack; +import com.songoda.core.compatibility.CompatibleMaterial; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.NumberUtils; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.itemstack.enchants.GlowEnchant; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; import com.songoda.epicbosses.utils.version.VersionHandler; @@ -33,7 +34,7 @@ public class ItemStackUtils { spawnableEntityMaterials = new HashMap<>(); spawnableEntityIds = new HashMap<>(); - boolean isLegacy = versionHandler.getVersion().isLessThanOrEqualTo(Versions.v1_12_R1); + boolean isLegacy = ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_12); Arrays.stream(EntityType.values()).filter(EntityType::isSpawnable).forEach(entityType -> { if (isLegacy) { @@ -48,7 +49,7 @@ public class ItemStackUtils { } public static List getSpawnableEntityTypes() { - if (versionHandler.getVersion().isLessThanOrEqualTo(Versions.v1_12_R1)) { + if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_12)) { return new ArrayList<>(spawnableEntityIds.keySet()); } else { return new ArrayList<>(spawnableEntityMaterials.keySet()); @@ -59,18 +60,18 @@ public class ItemStackUtils { if (!entityType.isSpawnable()) return new ItemStack(Material.AIR); - if (versionHandler.getVersion().isLessThanOrEqualTo(Versions.v1_12_R1)) { + if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_12)) { return new ItemStack(Material.valueOf("MONSTER_EGG"), 1, spawnableEntityIds.get(entityType)); } else { return new ItemStack(spawnableEntityMaterials.get(entityType)); } } - public static ItemStack createItemStack(ItemStack itemStack, Map replaceMap) { + public static ItemStack createItemStack(ItemStack itemStack, Map replaceMap) { return createItemStack(itemStack, replaceMap, null); } - public static ItemStack createItemStack(ItemStack itemStack, Map replaceMap, Map compoundData) { + public static ItemStack createItemStack(ItemStack itemStack, Map replaceMap, Map compoundData) { ItemStack cloneStack = itemStack.clone(); ItemMeta itemMeta = cloneStack.getItemMeta(); boolean hasName = cloneStack.getItemMeta().hasDisplayName(); @@ -78,21 +79,21 @@ public class ItemStackUtils { String name = ""; List newLore = new ArrayList<>(); - if(hasName) name = cloneStack.getItemMeta().getDisplayName(); + if (hasName) name = cloneStack.getItemMeta().getDisplayName(); - if(replaceMap != null && !replaceMap.isEmpty()) { - if(hasName) { - for(String s : replaceMap.keySet()) { + if (replaceMap != null && !replaceMap.isEmpty()) { + if (hasName) { + for (String s : replaceMap.keySet()) { name = name.replace(s, replaceMap.get(s)); } itemMeta.setDisplayName(name); } - if(hasLore) { - for(String s : itemMeta.getLore()) { - for(String z : replaceMap.keySet()) { - if(s.contains(z)) s = s.replace(z, replaceMap.get(z)); + if (hasLore) { + for (String s : itemMeta.getLore()) { + for (String z : replaceMap.keySet()) { + if (s.contains(z)) s = s.replace(z, replaceMap.get(z)); } newLore.add(s); @@ -104,7 +105,7 @@ public class ItemStackUtils { cloneStack.setItemMeta(itemMeta); - if(compoundData == null || compoundData.isEmpty()) return cloneStack; + if (compoundData == null || compoundData.isEmpty()) return cloneStack; return cloneStack; } @@ -126,14 +127,14 @@ public class ItemStackUtils { short meta = 0; Material mat; - if(NumberUtils.get().isInt(type)) { + if (NumberUtils.get().isInt(type)) { mat = MaterialUtils.fromId(NumberUtils.get().getInteger(type)); } else { - if(type.contains(":")) { + if (type.contains(":")) { String[] split = type.split(":"); String typeSplit = split[0]; - if(NumberUtils.get().isInt(typeSplit)) { + if (NumberUtils.get().isInt(typeSplit)) { mat = MaterialUtils.fromId(NumberUtils.get().getInteger(typeSplit)); } else { mat = Material.getMaterial(typeSplit); @@ -145,21 +146,21 @@ public class ItemStackUtils { } } - if((replacedMap != null) && (name != null)) { - for(String z : replacedMap.keySet()) { - if(!name.contains(z)) continue; + if ((replacedMap != null) && (name != null)) { + for (String z : replacedMap.keySet()) { + if (!name.contains(z)) continue; name = name.replace(z, replacedMap.get(z)); } } - if(lore != null && !lore.isEmpty()) { - for(String z : lore) { + if (lore != null && !lore.isEmpty()) { + for (String z : lore) { String y = z; - if(replacedMap != null) { - for(String x : replacedMap.keySet()) { - if(x == null || !y.contains(x)) continue; + if (replacedMap != null) { + for (String x : replacedMap.keySet()) { + if (x == null || !y.contains(x)) continue; if (replacedMap.get(x) == null) { ServerUtils.get().logDebug("Failed to apply replaced lore: [y=" + y + "x=" + x + "]"); @@ -170,10 +171,10 @@ public class ItemStackUtils { } } - if(y.contains("\n")) { + if (y.contains("\n")) { String[] split = y.split("\n"); - for(String s2 : split) { + for (String s2 : split) { newLore.add(ChatColor.translateAlternateColorCodes('&', s2)); } } else { @@ -182,12 +183,12 @@ public class ItemStackUtils { } } - if(enchants != null) { - for(String s : enchants) { + if (enchants != null) { + for (String s : enchants) { String[] spl = s.split(":"); String ench = spl[0]; - if(ench.equalsIgnoreCase("GLOW")) { + if (ench.equalsIgnoreCase("GLOW")) { addGlow = true; } else { int level = Integer.parseInt(spl[1]); @@ -197,33 +198,33 @@ public class ItemStackUtils { } } - if(mat == null) return null; + if (mat == null) return null; ItemStack itemStack = new ItemStack(mat, amount, meta); ItemMeta itemMeta = itemStack.getItemMeta(); - if(!newLore.isEmpty()) { + if (!newLore.isEmpty()) { itemMeta.setLore(newLore); } - if(name != null) { - if(!name.equals("")) { + if (name != null) { + if (!name.equals("")) { itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); } } itemStack.setItemMeta(itemMeta); - if(!map.isEmpty()) { + if (!map.isEmpty()) { itemStack.addUnsafeEnchantments(map); } - if(configurationSection.contains("durability")) { + if (configurationSection.contains("durability")) { short dura = itemStack.getType().getMaxDurability(); dura -= (short) durability - 1; itemStack.setDurability(dura); } - if(configurationSection.contains("owner") && itemStack.getType() == MaterialUtils.getSkullMaterial()) { + if (configurationSection.contains("owner") && itemStack.getType() == CompatibleMaterial.PLAYER_HEAD.getMaterial()) { SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta(); skullMeta.setOwner(owner); @@ -231,7 +232,7 @@ public class ItemStackUtils { itemStack.setItemMeta(skullMeta); } - return addGlow? addGlow(itemStack) : itemStack; + return addGlow ? addGlow(itemStack) : itemStack; } public static void applyDisplayName(ItemStack itemStack, String name) { @@ -241,13 +242,13 @@ public class ItemStackUtils { public static void applyDisplayName(ItemStack itemStack, String name, Map replaceMap) { ItemMeta itemMeta = itemStack.getItemMeta(); - if(replaceMap != null) { - for(String s : replaceMap.keySet()) { - if(name.contains(s)) name = name.replace(s, replaceMap.get(s)); + if (replaceMap != null) { + for (String s : replaceMap.keySet()) { + if (name.contains(s)) name = name.replace(s, replaceMap.get(s)); } } - if(itemMeta == null) return; + if (itemMeta == null) return; itemMeta.setDisplayName(StringUtils.get().translateColor(name)); itemStack.setItemMeta(itemMeta); @@ -262,13 +263,13 @@ public class ItemStackUtils { if (itemStack == null || (itemMeta = itemStack.getItemMeta()) == null) return; if (lore == null || lore.isEmpty()) { - itemMeta.setLore(Collections.EMPTY_LIST); - itemStack.setItemMeta(itemMeta); + itemMeta.setLore(Collections.EMPTY_LIST); + itemStack.setItemMeta(itemMeta); return; } - if(replaceMap != null) { - for(String s : replaceMap.keySet()) { + if (replaceMap != null) { + for (String s : replaceMap.keySet()) { lore.replaceAll(loreLine -> loreLine .replace(s, replaceMap.get(s)) .replace('&', '§') @@ -281,7 +282,7 @@ public class ItemStackUtils { } public static String getName(ItemStack itemStack) { - if(!itemStack.hasItemMeta() || !itemStack.getItemMeta().hasDisplayName()) { + if (!itemStack.hasItemMeta() || !itemStack.getItemMeta().hasDisplayName()) { return StringUtils.get().formatString(itemStack.getType().name()); } @@ -293,15 +294,15 @@ public class ItemStackUtils { public static Material getType(String string) { Material material = Material.getMaterial(string); - if(material == null) { - if(NumberUtils.get().isInt(string)) { + if (material == null) { + if (NumberUtils.get().isInt(string)) { return null; } else { String[] split = string.split(":"); material = Material.getMaterial(split[0]); - if(material != null) return material; + if (material != null) return material; return null; } @@ -321,16 +322,16 @@ public class ItemStackUtils { public static void giveItems(Player player, List items) { PlayerInventory inventory = player.getInventory(); - for(ItemStack itemStack : items) { + for (ItemStack itemStack : items) { int amount = itemStack.getAmount(); - while(amount > 0) { - int toGive = amount > 64? 64 : amount; + while (amount > 0) { + int toGive = amount > 64 ? 64 : amount; ItemStack stack = itemStack.clone(); stack.setAmount(toGive); - if(inventory.firstEmpty() != -1) { + if (inventory.firstEmpty() != -1) { inventory.addItem(stack); } else { player.getWorld().dropItemNaturally(player.getLocation(), stack); @@ -344,18 +345,18 @@ public class ItemStackUtils { public static void takeItems(Player player, Map items) { PlayerInventory inventory = player.getInventory(); - for(ItemStack itemStack : items.keySet()) { + for (ItemStack itemStack : items.keySet()) { int toTake = items.get(itemStack); int i = 0; - while(toTake > 0 && i < inventory.getSize()) { + while (toTake > 0 && i < inventory.getSize()) { if (inventory.getItem(i) != null && inventory.getItem(i).getType() == itemStack.getType() && (inventory.getItem(i).getData().getData() == itemStack.getData().getData() || itemStack.getData().getData() == -1)) { ItemStack target = inventory.getItem(i); - if(target.getAmount() > toTake) { - target.setAmount(target.getAmount()-toTake); + if (target.getAmount() > toTake) { + target.setAmount(target.getAmount() - toTake); inventory.setItem(i, target); break; - } else if(target.getAmount() == toTake) { + } else if (target.getAmount() == toTake) { inventory.setItem(i, new ItemStack(Material.AIR)); break; } else { @@ -372,7 +373,7 @@ public class ItemStackUtils { PlayerInventory playerInventory = player.getInventory(); int amountInInventory = 0; - for(int i = 0; i < playerInventory.getSize(); i++) { + for (int i = 0; i < playerInventory.getSize(); i++) { if (playerInventory.getItem(i) != null && playerInventory.getItem(i).getType() == itemStack.getType() && (playerInventory.getItem(i).getData().getData() == itemStack.getData().getData() || itemStack.getData().getData() == -1)) { amountInInventory += playerInventory.getItem(i).getAmount(); } @@ -397,25 +398,25 @@ public class ItemStackUtils { } public static boolean isItemStackSame(ItemStack itemStack1, ItemStack itemStack2) { - if(itemStack1 == null || itemStack2 == null) return false; - if(itemStack1.getType() != itemStack2.getType()) return false; + if (itemStack1 == null || itemStack2 == null) return false; + if (itemStack1.getType() != itemStack2.getType()) return false; // Durability checks are too tempermental to be reliable for all versions //if(itemStack1.getDurability() != itemStack2.getDurability()) return false; ItemMeta itemMeta1 = itemStack1.getItemMeta(); ItemMeta itemMeta2 = itemStack2.getItemMeta(); - if(itemMeta1 == null || itemMeta2 == null) return false; + if (itemMeta1 == null || itemMeta2 == null) return false; - if(itemMeta1.hasDisplayName() == itemMeta2.hasDisplayName()) { - if(itemMeta1.hasDisplayName() && !itemMeta1.getDisplayName().equals(itemMeta2.getDisplayName())) + if (itemMeta1.hasDisplayName() == itemMeta2.hasDisplayName()) { + if (itemMeta1.hasDisplayName() && !itemMeta1.getDisplayName().equals(itemMeta2.getDisplayName())) return false; } else { return false; } - if(itemMeta1.hasLore() == itemMeta2.hasLore()) { - if(itemMeta1.hasLore() && !itemMeta1.getLore().equals(itemMeta2.getLore())) + if (itemMeta1.hasLore() == itemMeta2.hasLore()) { + if (itemMeta1.hasLore() && !itemMeta1.getLore().equals(itemMeta2.getLore())) return false; } else { return false; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/MaterialUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/MaterialUtils.java index 17a71c4..35b25cb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/MaterialUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/MaterialUtils.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.utils.itemstack; -import com.songoda.epicbosses.utils.Versions; import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Material; @@ -9,7 +8,6 @@ import java.util.Map; public class MaterialUtils { - private static final VersionHandler versionHandler = new VersionHandler(); private static Map materialIdMap; static { @@ -26,12 +24,4 @@ public class MaterialUtils { return materialIdMap.get(id); } - public static Material getSkullMaterial() { - if (versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1)) { - return Material.PLAYER_HEAD; - } else { - return Material.getMaterial("SKULL_ITEM"); - } - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java index bc80bf0..0a93e83 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java @@ -1,7 +1,6 @@ package com.songoda.epicbosses.utils.version; -import com.songoda.epicbosses.utils.Versions; -import org.bukkit.Bukkit; +import com.songoda.core.compatibility.ServerVersion; import org.bukkit.entity.HumanEntity; import org.bukkit.inventory.ItemStack; @@ -12,22 +11,12 @@ import org.bukkit.inventory.ItemStack; */ public class VersionHandler { - private Versions version; - - public VersionHandler() { - String v = Bukkit.getServer().getClass().getPackage().getName(); - - v = v.substring(v.lastIndexOf(".") + 1); - - this.version = Versions.getVersion(v); - } - public boolean canUseOffHand() { - return this.version.isHigherThanOrEqualTo(Versions.v1_9_R1); + return ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9); } public ItemStack getItemInHand(HumanEntity humanEntity) { - if(this.version.isLessThanOrEqualTo(Versions.v1_8_R3)) { + if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { return humanEntity.getItemInHand(); } else { return humanEntity.getInventory().getItemInMainHand(); @@ -35,14 +24,10 @@ public class VersionHandler { } public void setItemInHand(HumanEntity humanEntity, ItemStack itemStack) { - if(this.version.isLessThanOrEqualTo(Versions.v1_8_R3)) { + if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { humanEntity.setItemInHand(itemStack); } else { humanEntity.getInventory().setItemInMainHand(itemStack); } } - - public Versions getVersion() { - return this.version; - } } From 5b8c5f47e0bb233d8aff346b3125535f44a5f9c8 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 17:25:54 -0400 Subject: [PATCH 04/16] Formatting clean up. --- api-modules/FactionsM/pom.xml | 4 +- .../src/utils/factions/FactionsM.java | 44 +-- api-modules/FactionsOne/pom.xml | 4 +- .../src/utils/factions/FactionsOne.java | 46 +-- api-modules/FactionsUUID/pom.xml | 4 +- .../src/utils/factions/FactionsUUID.java | 34 +-- api-modules/LegacyFactions/pom.xml | 4 +- .../src/utils/factions/LegacyFactions.java | 18 +- plugin-modules/Core/pom.xml | 4 +- .../com/songoda/epicbosses/api/BossAPI.java | 89 +++--- .../songoda/epicbosses/commands/BossCmd.java | 4 +- .../commands/boss/BossCreateCmd.java | 8 +- .../commands/boss/BossDebugCmd.java | 6 +- .../commands/boss/BossDropTableCmd.java | 4 +- .../epicbosses/commands/boss/BossEditCmd.java | 8 +- .../commands/boss/BossGiveEggCmd.java | 14 +- .../epicbosses/commands/boss/BossHelpCmd.java | 6 +- .../epicbosses/commands/boss/BossInfoCmd.java | 6 +- .../commands/boss/BossItemsCmd.java | 4 +- .../commands/boss/BossKillAllCmd.java | 8 +- .../epicbosses/commands/boss/BossListCmd.java | 4 +- .../epicbosses/commands/boss/BossMenuCmd.java | 4 +- .../commands/boss/BossNearbyCmd.java | 12 +- .../epicbosses/commands/boss/BossNewCmd.java | 48 +-- .../commands/boss/BossReloadCmd.java | 3 +- .../epicbosses/commands/boss/BossShopCmd.java | 6 +- .../commands/boss/BossSkillsCmd.java | 4 +- .../commands/boss/BossSpawnCmd.java | 12 +- .../epicbosses/commands/boss/BossTimeCmd.java | 8 +- .../songoda/epicbosses/entity/BossEntity.java | 77 +++-- .../epicbosses/entity/MinionEntity.java | 8 +- .../entity/elements/CommandsElement.java | 8 +- .../entity/elements/DropsElement.java | 16 +- .../entity/elements/EntityStatsElement.java | 24 +- .../entity/elements/EquipmentElement.java | 24 +- .../entity/elements/HandsElement.java | 8 +- .../entity/elements/MainStatsElement.java | 24 +- .../entity/elements/MessagesElement.java | 16 +- .../elements/OnDeathMessageElement.java | 24 +- .../elements/OnSpawnMessageElement.java | 8 +- .../entity/elements/SkillsElement.java | 16 +- .../entity/elements/TauntElement.java | 16 +- .../epicbosses/events/BossDamageEvent.java | 6 +- .../epicbosses/events/BossDeathEvent.java | 6 +- .../epicbosses/events/BossSkillEvent.java | 6 +- .../epicbosses/events/BossSpawnEvent.java | 6 +- .../epicbosses/events/PreBossDeathEvent.java | 6 +- .../epicbosses/events/PreBossSkillEvent.java | 6 +- .../epicbosses/events/PreBossSpawnEvent.java | 6 +- .../events/PreBossSpawnItemEvent.java | 6 +- .../epicbosses/file/AutoSpawnFileHandler.java | 5 +- .../epicbosses/file/BossesFileHandler.java | 5 +- .../epicbosses/file/CommandsFileHandler.java | 8 +- .../epicbosses/file/DropTableFileHandler.java | 5 +- .../epicbosses/file/ItemStackFileHandler.java | 5 +- .../epicbosses/file/MessagesFileHandler.java | 8 +- .../epicbosses/file/MinionsFileHandler.java | 5 +- .../epicbosses/file/SkillsFileHandler.java | 5 +- .../handlers/BossShopPriceHandler.java | 8 +- .../droptable/GetDropTableCommand.java | 2 +- .../droptable/GetDropTableItemStack.java | 4 +- .../AutoSpawnLocationVariableHandler.java | 2 +- .../epicbosses/holder/ActiveBossHolder.java | 16 +- .../epicbosses/holder/ActiveMinionHolder.java | 23 +- .../ActiveIntervalAutoSpawnHolder.java | 30 +- .../epicbosses/panel/AddItemsPanel.java | 16 +- .../epicbosses/panel/AutoSpawnsPanel.java | 23 +- .../epicbosses/panel/CustomBossesPanel.java | 17 +- .../epicbosses/panel/CustomItemsPanel.java | 17 +- .../epicbosses/panel/CustomSkillsPanel.java | 15 +- .../epicbosses/panel/DropTablePanel.java | 9 +- .../panel/EntityTypeEditorPanel.java | 13 +- .../epicbosses/panel/MainMenuPanel.java | 20 +- .../songoda/epicbosses/panel/ShopPanel.java | 15 +- .../AutoSpawnCustomSettingsEditorPanel.java | 23 +- .../AutoSpawnEntitiesEditorPanel.java | 15 +- .../AutoSpawnSpecialSettingsEditorPanel.java | 26 +- .../autospawns/AutoSpawnTypeEditorPanel.java | 2 +- .../autospawns/MainAutoSpawnEditorPanel.java | 8 +- .../panel/bosses/BossListEditorPanel.java | 4 +- .../panel/bosses/BossShopEditorPanel.java | 6 +- .../panel/bosses/DropsEditorPanel.java | 13 +- .../panel/bosses/DropsMainEditorPanel.java | 14 +- .../panel/bosses/MainBossEditPanel.java | 4 +- .../panel/bosses/SkillListEditorPanel.java | 13 +- .../panel/bosses/SkillMainEditorPanel.java | 20 +- .../panel/bosses/SpawnItemEditorPanel.java | 15 +- .../bosses/StatisticMainEditorPanel.java | 22 +- .../panel/bosses/TargetingEditorPanel.java | 6 +- .../bosses/commands/OnDeathCommandEditor.java | 17 +- .../bosses/commands/OnSpawnCommandEditor.java | 17 +- .../bosses/equipment/BootsEditorPanel.java | 2 +- .../equipment/ChestplateEditorPanel.java | 2 +- .../bosses/equipment/HelmetEditorPanel.java | 2 +- .../bosses/equipment/LeggingsEditorPanel.java | 2 +- .../bosses/text/DeathTextEditorPanel.java | 36 +-- .../bosses/text/SpawnTextEditorPanel.java | 20 +- .../bosses/text/TauntTextEditorPanel.java | 38 +-- .../droptables/MainDropTableEditorPanel.java | 6 +- .../DropTableNewRewardEditorPanel.java | 9 +- .../DropTableRewardMainEditorPanel.java | 12 +- .../DropTableRewardsListEditorPanel.java | 11 +- .../drop/DropDropTableMainEditorPanel.java | 20 +- .../types/give/GiveRewardMainEditPanel.java | 36 +-- .../give/GiveRewardPositionListPanel.java | 13 +- .../give/GiveRewardRewardsListPanel.java | 17 +- .../commands/GiveCommandNewRewardPanel.java | 16 +- .../commands/GiveCommandRewardListPanel.java | 11 +- .../GiveCommandRewardMainEditPanel.java | 12 +- .../spray/SprayDropTableMainEditorPanel.java | 34 +-- .../ItemStackSubListPanelHandler.java | 15 +- .../panel/handlers/ListCommandListEditor.java | 15 +- .../panel/handlers/ListMessageListEditor.java | 15 +- .../handlers/SingleMessageListEditor.java | 15 +- .../panel/skills/MainSkillEditorPanel.java | 34 +-- .../custom/CommandSkillEditorPanel.java | 11 +- .../skills/custom/CustomSkillEditorPanel.java | 22 +- .../skills/custom/GroupSkillEditorPanel.java | 21 +- .../skills/custom/PotionSkillEditorPanel.java | 8 +- .../commands/CommandListSkillEditorPanel.java | 21 +- .../commands/ModifyCommandEditorPanel.java | 22 +- .../custom/CustomSkillTypeEditorPanel.java | 15 +- .../custom/MaterialTypeEditorPanel.java | 15 +- .../custom/MinionSelectEditorPanel.java | 11 +- .../custom/SpecialSettingsEditorPanel.java | 13 +- .../CreatePotionEffectEditorPanel.java | 22 +- .../com/songoda/epicbosses/skills/Skill.java | 40 +-- .../songoda/epicbosses/skills/SkillMode.java | 22 +- .../epicbosses/skills/custom/Cage.java | 28 +- .../epicbosses/skills/custom/Disarm.java | 4 +- .../epicbosses/skills/custom/Fireball.java | 4 +- .../epicbosses/skills/custom/Grapple.java | 2 +- .../epicbosses/skills/custom/Insidious.java | 2 +- .../epicbosses/skills/custom/Knockback.java | 2 +- .../skills/custom/cage/CageLocationData.java | 19 +- .../skills/custom/cage/CagePlayerData.java | 14 +- .../elements/CustomCageSkillElement.java | 24 +- .../elements/CustomMinionSkillElement.java | 8 +- .../elements/SubCommandSkillElement.java | 8 +- .../elements/SubCustomSkillElement.java | 12 +- .../skills/types/CommandSkillElement.java | 8 +- .../skills/types/GroupSkillElement.java | 2 +- .../skills/types/PotionSkillElement.java | 8 +- .../com/songoda/epicbosses/utils/Debug.java | 22 +- .../epicbosses/utils/EnchantFinder.java | 14 +- .../epicbosses/utils/EntityFinder.java | 22 +- .../songoda/epicbosses/utils/MapUtils.java | 8 +- .../com/songoda/epicbosses/utils/Message.java | 131 ++++---- .../epicbosses/utils/MessageUtils.java | 14 +- .../songoda/epicbosses/utils/NumberUtils.java | 14 +- .../songoda/epicbosses/utils/ObjectUtils.java | 2 +- .../epicbosses/utils/PotionEffectFinder.java | 12 +- .../songoda/epicbosses/utils/RandomUtils.java | 8 +- .../epicbosses/utils/ReflectionUtil.java | 12 +- .../songoda/epicbosses/utils/ServerUtils.java | 10 +- .../songoda/epicbosses/utils/StringUtils.java | 36 +-- .../adapters/PotionEffectTypeAdapter.java | 2 +- .../utils/command/CommandService.java | 23 +- .../utils/command/SubCommandService.java | 4 +- .../utils/command/attributes/Alias.java | 2 +- .../utils/command/attributes/Description.java | 2 +- .../utils/command/attributes/Name.java | 2 +- .../command/attributes/NoPermission.java | 2 +- .../utils/command/attributes/Permission.java | 2 +- .../utils/command/attributes/Suggest.java | 2 +- .../utils/dependencies/ASkyblockHelper.java | 2 +- .../utils/entity/handlers/CatHandler.java | 2 +- .../utils/entity/handlers/DrownedHandler.java | 2 +- .../entity/handlers/ElderGuardianHandler.java | 2 +- .../entity/handlers/EndermiteHandler.java | 2 +- .../utils/entity/handlers/EvokerHandler.java | 2 +- .../utils/entity/handlers/FishHandler.java | 2 +- .../utils/entity/handlers/FoxHandler.java | 2 +- .../entity/handlers/KillerBunnyHandler.java | 2 +- .../utils/entity/handlers/PandaHandler.java | 2 +- .../utils/entity/handlers/ParrotHandler.java | 2 +- .../entity/handlers/PolarBearHandler.java | 3 +- .../utils/entity/handlers/RavagerHandler.java | 3 +- .../utils/entity/handlers/ShulkerHandler.java | 2 +- .../entity/handlers/StraySkeletonHandler.java | 5 +- .../utils/entity/handlers/TurtleHandler.java | 2 +- .../utils/entity/handlers/VexHandler.java | 1 - .../entity/handlers/VillagerHandler.java | 2 +- .../handlers/WitherSkeletonHandler.java | 2 +- .../epicbosses/utils/file/FileUtils.java | 8 +- .../utils/file/reader/SpigotYmlReader.java | 8 +- .../utils/itemstack/ItemStackConverter.java | 50 ++-- .../itemstack/ItemStackHolderConverter.java | 2 +- .../utils/itemstack/MaterialUtils.java | 4 +- .../converters/EnchantConverter.java | 8 +- .../converters/MaterialConverter.java | 4 +- .../songoda/epicbosses/utils/panel/Panel.java | 283 +++++++++--------- .../panel/base/handlers/BasePanelHandler.java | 3 +- .../utils/panel/builder/PanelBuilder.java | 44 +-- .../panel/builder/PanelBuilderCounter.java | 6 +- .../panel/builder/PanelBuilderSettings.java | 10 +- .../utils/potion/PotionEffectConverter.java | 12 +- .../converters/PotionEffectTypeConverter.java | 6 +- .../potion/holder/PotionEffectHolder.java | 16 +- .../utils/target/TargetHandler.java | 3 +- .../epicbosses/utils/time/TimeUnit.java | 48 +-- .../epicbosses/utils/time/TimeUtil.java | 44 +-- plugin-modules/FactionHelper/pom.xml | 4 +- pom.xml | 4 +- 204 files changed, 1502 insertions(+), 1472 deletions(-) diff --git a/api-modules/FactionsM/pom.xml b/api-modules/FactionsM/pom.xml index 7fb43b9..2258409 100644 --- a/api-modules/FactionsM/pom.xml +++ b/api-modules/FactionsM/pom.xml @@ -1,6 +1,6 @@ - EpicBosses diff --git a/api-modules/FactionsM/src/utils/factions/FactionsM.java b/api-modules/FactionsM/src/utils/factions/FactionsM.java index 4ba4ee1..2453d43 100644 --- a/api-modules/FactionsM/src/utils/factions/FactionsM.java +++ b/api-modules/FactionsM/src/utils/factions/FactionsM.java @@ -24,15 +24,15 @@ public class FactionsM implements IFactionHelper { Faction mp2Fac = mp2.getFaction(); Rel relation = mp1.getRelationTo(mp2); - if(ChatColor.stripColor(mp2Fac.getName()).equalsIgnoreCase("Wilderness")) return false; - if(relation == Rel.ENEMY) return false; - if(relation == Rel.NEUTRAL) return false; - if(relation == Rel.ALLY) return true; - if(relation == Rel.TRUCE) return false; - if(relation == Rel.LEADER) return true; - if(relation == Rel.OFFICER) return true; - if(relation == Rel.MEMBER) return true; - if(relation == Rel.RECRUIT) return true; + if (ChatColor.stripColor(mp2Fac.getName()).equalsIgnoreCase("Wilderness")) return false; + if (relation == Rel.ENEMY) return false; + if (relation == Rel.NEUTRAL) return false; + if (relation == Rel.ALLY) return true; + if (relation == Rel.TRUCE) return false; + if (relation == Rel.LEADER) return true; + if (relation == Rel.OFFICER) return true; + if (relation == Rel.MEMBER) return true; + if (relation == Rel.RECRUIT) return true; return false; } @@ -43,15 +43,15 @@ public class FactionsM implements IFactionHelper { Faction locFac = BoardColl.get().getFactionAt(PS.valueOf(location)); Rel relation = mp1Fac.getRelationTo(locFac); - if(ChatColor.stripColor(locFac.getName()).equalsIgnoreCase("Wilderness")) return true; - if(relation == Rel.ENEMY) return false; - if(relation == Rel.NEUTRAL) return false; - if(relation == Rel.ALLY) return true; - if(relation == Rel.TRUCE) return true; - if(relation == Rel.LEADER) return true; - if(relation == Rel.OFFICER) return true; - if(relation == Rel.MEMBER) return true; - if(relation == Rel.RECRUIT) return true; + if (ChatColor.stripColor(locFac.getName()).equalsIgnoreCase("Wilderness")) return true; + if (relation == Rel.ENEMY) return false; + if (relation == Rel.NEUTRAL) return false; + if (relation == Rel.ALLY) return true; + if (relation == Rel.TRUCE) return true; + if (relation == Rel.LEADER) return true; + if (relation == Rel.OFFICER) return true; + if (relation == Rel.MEMBER) return true; + if (relation == Rel.RECRUIT) return true; return false; } @@ -59,7 +59,7 @@ public class FactionsM implements IFactionHelper { public boolean isInWarzone(Location location) { Faction locFac = BoardColl.get().getFactionAt(PS.valueOf(location)); - if(ChatColor.stripColor(locFac.getName()).equalsIgnoreCase("WarZone")) return true; + if (ChatColor.stripColor(locFac.getName()).equalsIgnoreCase("WarZone")) return true; return false; } @@ -68,9 +68,9 @@ public class FactionsM implements IFactionHelper { Faction locFac = BoardColl.get().getFactionAt(PS.valueOf(location)); String string = ChatColor.stripColor(locFac.getName()); - if(string.equalsIgnoreCase("WarZone")) return false; - if(string.equalsIgnoreCase("SafeZone")) return false; - if(string.equalsIgnoreCase("Wilderness")) return false; + if (string.equalsIgnoreCase("WarZone")) return false; + if (string.equalsIgnoreCase("SafeZone")) return false; + if (string.equalsIgnoreCase("Wilderness")) return false; return true; } } diff --git a/api-modules/FactionsOne/pom.xml b/api-modules/FactionsOne/pom.xml index db6871c..eb96e29 100644 --- a/api-modules/FactionsOne/pom.xml +++ b/api-modules/FactionsOne/pom.xml @@ -1,6 +1,6 @@ - EpicBosses diff --git a/api-modules/FactionsOne/src/utils/factions/FactionsOne.java b/api-modules/FactionsOne/src/utils/factions/FactionsOne.java index 53836fa..8d5bf8d 100644 --- a/api-modules/FactionsOne/src/utils/factions/FactionsOne.java +++ b/api-modules/FactionsOne/src/utils/factions/FactionsOne.java @@ -23,16 +23,16 @@ public class FactionsOne implements IFactionHelper { Faction zFac = FPlayers.i.get(b).getFaction(); Rel r = pFac.getRelationTo(zFac); - if(ChatColor.stripColor(zFac.getId()).equalsIgnoreCase("Wilderness")) return false; - if(a == b) return true; - if(r.equals(Rel.ALLY)) return true; - if(r.equals(Rel.TRUCE)) return true; - if(r.equals(Rel.LEADER)) return true; - if(r.equals(Rel.MEMBER)) return true; - if(r.equals(Rel.OFFICER)) return true; - if(r.equals(Rel.RECRUIT)) return true; - if(r.equals(Rel.ENEMY)) return false; - if(r.equals(Rel.NEUTRAL)) return false; + if (ChatColor.stripColor(zFac.getId()).equalsIgnoreCase("Wilderness")) return false; + if (a == b) return true; + if (r.equals(Rel.ALLY)) return true; + if (r.equals(Rel.TRUCE)) return true; + if (r.equals(Rel.LEADER)) return true; + if (r.equals(Rel.MEMBER)) return true; + if (r.equals(Rel.OFFICER)) return true; + if (r.equals(Rel.RECRUIT)) return true; + if (r.equals(Rel.ENEMY)) return false; + if (r.equals(Rel.NEUTRAL)) return false; return false; } @@ -43,15 +43,15 @@ public class FactionsOne implements IFactionHelper { Faction locFac = Board.getFactionAt(fLoc); Rel r = pFac.getRelationTo(locFac); - if(ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("Wilderness")) return false; - if(r.equals(Rel.ALLY)) return true; - if(r.equals(Rel.TRUCE)) return true; - if(r.equals(Rel.LEADER)) return true; - if(r.equals(Rel.MEMBER)) return true; - if(r.equals(Rel.OFFICER)) return true; - if(r.equals(Rel.RECRUIT)) return true; - if(r.equals(Rel.ENEMY)) return false; - if(r.equals(Rel.NEUTRAL)) return false; + if (ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("Wilderness")) return false; + if (r.equals(Rel.ALLY)) return true; + if (r.equals(Rel.TRUCE)) return true; + if (r.equals(Rel.LEADER)) return true; + if (r.equals(Rel.MEMBER)) return true; + if (r.equals(Rel.OFFICER)) return true; + if (r.equals(Rel.RECRUIT)) return true; + if (r.equals(Rel.ENEMY)) return false; + if (r.equals(Rel.NEUTRAL)) return false; return false; } @@ -60,7 +60,7 @@ public class FactionsOne implements IFactionHelper { FLocation fLoc = new FLocation(location); Faction locFac = Board.getFactionAt(fLoc); - if(ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("WarZone")) return true; + if (ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("WarZone")) return true; return false; } @@ -70,9 +70,9 @@ public class FactionsOne implements IFactionHelper { Faction locFac = Board.getFactionAt(fLoc); String string = ChatColor.stripColor(locFac.getComparisonTag()); - if(string.equalsIgnoreCase("WarZone")) return false; - if(string.equalsIgnoreCase("SafeZone")) return false; - if(string.equalsIgnoreCase("Wilderness")) return false; + if (string.equalsIgnoreCase("WarZone")) return false; + if (string.equalsIgnoreCase("SafeZone")) return false; + if (string.equalsIgnoreCase("Wilderness")) return false; return true; } } diff --git a/api-modules/FactionsUUID/pom.xml b/api-modules/FactionsUUID/pom.xml index 90d8396..de88390 100644 --- a/api-modules/FactionsUUID/pom.xml +++ b/api-modules/FactionsUUID/pom.xml @@ -1,6 +1,6 @@ - EpicBosses diff --git a/api-modules/FactionsUUID/src/utils/factions/FactionsUUID.java b/api-modules/FactionsUUID/src/utils/factions/FactionsUUID.java index 4e6e916..ae1d001 100644 --- a/api-modules/FactionsUUID/src/utils/factions/FactionsUUID.java +++ b/api-modules/FactionsUUID/src/utils/factions/FactionsUUID.java @@ -23,13 +23,13 @@ public class FactionsUUID implements IFactionHelper { Faction zFac = FPlayers.getInstance().getByPlayer(b).getFaction(); Relation r = pFac.getRelationTo(zFac); - if(ChatColor.stripColor(zFac.getId()).equalsIgnoreCase("Wilderness")) return false; - if(a == b) return true; - if(r.isEnemy()) return false; - if(r.isNeutral()) return false; - if(r.isTruce()) return true; - if(r.isAlly()) return true; - if(r.isMember()) return true; + if (ChatColor.stripColor(zFac.getId()).equalsIgnoreCase("Wilderness")) return false; + if (a == b) return true; + if (r.isEnemy()) return false; + if (r.isNeutral()) return false; + if (r.isTruce()) return true; + if (r.isAlly()) return true; + if (r.isMember()) return true; return false; } @@ -40,12 +40,12 @@ public class FactionsUUID implements IFactionHelper { Faction locFac = Board.getInstance().getFactionAt(fLoc); Relation r = pFac.getRelationTo(locFac); - if(ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("Wilderness")) return false; - if(r.isEnemy()) return false; - if(r.isNeutral()) return false; - if(r.isTruce()) return true; - if(r.isAlly()) return true; - if(r.isMember()) return true; + if (ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("Wilderness")) return false; + if (r.isEnemy()) return false; + if (r.isNeutral()) return false; + if (r.isTruce()) return true; + if (r.isAlly()) return true; + if (r.isMember()) return true; return false; } @@ -54,7 +54,7 @@ public class FactionsUUID implements IFactionHelper { FLocation fLoc = new FLocation(location); Faction locFac = Board.getInstance().getFactionAt(fLoc); - if(ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("WarZone")) return true; + if (ChatColor.stripColor(locFac.getComparisonTag()).equalsIgnoreCase("WarZone")) return true; return false; } @@ -64,9 +64,9 @@ public class FactionsUUID implements IFactionHelper { Faction locFac = Board.getInstance().getFactionAt(fLoc); String string = ChatColor.stripColor(locFac.getComparisonTag()); - if(string.equalsIgnoreCase("WarZone")) return false; - if(string.equalsIgnoreCase("SafeZone")) return false; - if(string.equalsIgnoreCase("Wilderness")) return false; + if (string.equalsIgnoreCase("WarZone")) return false; + if (string.equalsIgnoreCase("SafeZone")) return false; + if (string.equalsIgnoreCase("Wilderness")) return false; return true; } } diff --git a/api-modules/LegacyFactions/pom.xml b/api-modules/LegacyFactions/pom.xml index 2a8cd1a..0cea1b1 100644 --- a/api-modules/LegacyFactions/pom.xml +++ b/api-modules/LegacyFactions/pom.xml @@ -1,6 +1,6 @@ - EpicBosses diff --git a/api-modules/LegacyFactions/src/utils/factions/LegacyFactions.java b/api-modules/LegacyFactions/src/utils/factions/LegacyFactions.java index 93de9ae..8997141 100644 --- a/api-modules/LegacyFactions/src/utils/factions/LegacyFactions.java +++ b/api-modules/LegacyFactions/src/utils/factions/LegacyFactions.java @@ -22,13 +22,13 @@ public class LegacyFactions implements IFactionHelper { Faction bFac = FPlayerColl.get(b).getFaction(); Relation relation = aFac.getRelationTo(bFac); - if(bFac.isWilderness()) return false; - if(aFac == bFac) return true; - if(relation.isEnemy()) return false; - if(relation.isNeutral()) return false; - if(relation.isTruce()) return true; - if(relation.isAlly()) return true; - if(relation.isMember()) return true; + if (bFac.isWilderness()) return false; + if (aFac == bFac) return true; + if (relation.isEnemy()) return false; + if (relation.isNeutral()) return false; + if (relation.isTruce()) return true; + if (relation.isAlly()) return true; + if (relation.isMember()) return true; return false; } @@ -38,8 +38,8 @@ public class LegacyFactions implements IFactionHelper { Faction bFac = Board.get().getFactionAt(Locality.of(location)); Relation relation = aFac.getRelationTo(bFac); - if(bFac.isWilderness() || relation.isEnemy() || relation.isNeutral()) return false; - if(relation.isTruce() || relation.isAlly() || relation.isMember()) return true; + if (bFac.isWilderness() || relation.isEnemy() || relation.isNeutral()) return false; + if (relation.isTruce() || relation.isAlly() || relation.isMember()) return true; return false; } diff --git a/plugin-modules/Core/pom.xml b/plugin-modules/Core/pom.xml index 8364903..aa62cd0 100644 --- a/plugin-modules/Core/pom.xml +++ b/plugin-modules/Core/pom.xml @@ -1,6 +1,6 @@ - EpicBosses diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java b/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java index 53a0e45..97766ae 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/api/BossAPI.java @@ -56,14 +56,14 @@ public class BossAPI { * plugin instance so the methods can * pull variables in the main class to use * in their method. - * + *

* This should only ever be used in house and * never to be used by an outside party. * * @param plugin - the plugin instance. */ public BossAPI(EpicBosses plugin) { - if(PLUGIN != null) { + if (PLUGIN != null) { Debug.ATTEMPTED_TO_UPDATE_PLUGIN.debug(); return; } @@ -78,29 +78,30 @@ public class BossAPI { * using the BossAPI#createBaseBossEntity * method or by manually creating a BossEntity. * - * @param name - Name for the boss section. + * @param name - Name for the boss section. * @param bossEntity - The boss section. * @return false if it failed, true if it saved successfully. */ public static boolean registerBossEntity(String name, BossEntity bossEntity) { - if(name == null || bossEntity == null) return false; + if (name == null || bossEntity == null) return false; PLUGIN.getBossEntityContainer().saveData(name, bossEntity); PLUGIN.getBossesFileManager().save(); return true; } + /** * Used to register a Minion Entity into * the plugin after it has been created * using the BossAPI#createBaseMinionEntity * method or by manually creating a MinionEntity. * - * @param name - Name for the minion section. + * @param name - Name for the minion section. * @param minionEntity - The minion section. * @return false if it failed, true if it saved successfully. */ public static boolean registerMinionEntity(String name, MinionEntity minionEntity) { - if(name == null || minionEntity == null) return false; + if (name == null || minionEntity == null) return false; PLUGIN.getMinionEntityContainer().saveData(name, minionEntity); PLUGIN.getMinionsFileManager().save(); @@ -144,8 +145,8 @@ public class BossAPI { * @return name of the boss from the BossContainer or null if not found. */ public static String getBossEntityName(BossEntity bossEntity) { - for(Map.Entry entry : PLUGIN.getBossEntityContainer().getData().entrySet()) { - if(entry.getValue().equals(bossEntity)) { + for (Map.Entry entry : PLUGIN.getBossEntityContainer().getData().entrySet()) { + if (entry.getValue().equals(bossEntity)) { return entry.getKey(); } } @@ -172,8 +173,8 @@ public class BossAPI { * @return name of the skill from the SkillsFileManager or null if not found. */ public static String getSkillName(Skill skill) { - for(Map.Entry entry : PLUGIN.getSkillsFileManager().getSkillMap().entrySet()) { - if(entry.getValue().equals(skill)) return entry.getKey(); + for (Map.Entry entry : PLUGIN.getSkillsFileManager().getSkillMap().entrySet()) { + if (entry.getValue().equals(skill)) return entry.getKey(); } return null; @@ -187,8 +188,8 @@ public class BossAPI { * @return name of the skill from the SkillsFileManager or null if not found. */ public static String getAutoSpawnName(AutoSpawn autoSpawn) { - for(Map.Entry entry : PLUGIN.getAutoSpawnFileManager().getAutoSpawnMap().entrySet()) { - if(entry.getValue().equals(autoSpawn)) return entry.getKey(); + for (Map.Entry entry : PLUGIN.getAutoSpawnFileManager().getAutoSpawnMap().entrySet()) { + if (entry.getValue().equals(autoSpawn)) return entry.getKey(); } return null; @@ -202,8 +203,8 @@ public class BossAPI { * @return name of the dropTable from the DropTableFileManager or null if not found. */ public static String getDropTableName(DropTable dropTable) { - for(Map.Entry entry : PLUGIN.getDropTableFileManager().getDropTables().entrySet()) { - if(entry.getValue().equals(dropTable)) return entry.getKey(); + for (Map.Entry entry : PLUGIN.getDropTableFileManager().getDropTables().entrySet()) { + if (entry.getValue().equals(dropTable)) return entry.getKey(); } return null; @@ -217,8 +218,8 @@ public class BossAPI { * @return name of the minion from the MinionContainer or null if not found. */ public static String getMinionEntityName(MinionEntity minionEntity) { - for(Map.Entry entry : PLUGIN.getMinionEntityContainer().getData().entrySet()) { - if(entry.getValue().equals(minionEntity)) { + for (Map.Entry entry : PLUGIN.getMinionEntityContainer().getData().entrySet()) { + if (entry.getValue().equals(minionEntity)) { return entry.getKey(); } } @@ -227,15 +228,15 @@ public class BossAPI { } public static JsonObject createNewDropTableRewards(String type) { - if(type.equalsIgnoreCase("SPRAY")) { + if (type.equalsIgnoreCase("SPRAY")) { SprayTableElement sprayTableElement = new SprayTableElement(new HashMap<>(), false, 15, 15); return convertObjectToJsonObject(sprayTableElement); - } else if(type.equalsIgnoreCase("DROP")) { + } else if (type.equalsIgnoreCase("DROP")) { DropTableElement dropTableElement = new DropTableElement(new HashMap<>(), false, 15); return convertObjectToJsonObject(dropTableElement); - } else if(type.equalsIgnoreCase("GIVE")) { + } else if (type.equalsIgnoreCase("GIVE")) { GiveTableElement giveTableElement = new GiveTableElement(new HashMap<>()); return convertObjectToJsonObject(giveTableElement); @@ -248,19 +249,19 @@ public class BossAPI { JsonParser jsonParser = new JsonParser(); String jsonString; - if(type.equalsIgnoreCase("COMMAND")) { + if (type.equalsIgnoreCase("COMMAND")) { CommandSkillElement commandSkillElement = new CommandSkillElement(new ArrayList<>()); jsonString = BossesGson.get().toJson(commandSkillElement); - } else if(type.equalsIgnoreCase("POTION")) { + } else if (type.equalsIgnoreCase("POTION")) { PotionSkillElement potionSkillElement = new PotionSkillElement(new ArrayList<>()); jsonString = BossesGson.get().toJson(potionSkillElement); - } else if(type.equalsIgnoreCase("CUSTOM")) { + } else if (type.equalsIgnoreCase("CUSTOM")) { CustomSkillElement customSkillElement = new CustomSkillElement(new SubCustomSkillElement("", 0.0, null)); jsonString = BossesGson.get().toJson(customSkillElement); - } else if(type.equalsIgnoreCase("GROUP")) { + } else if (type.equalsIgnoreCase("GROUP")) { GroupSkillElement groupSkillElement = new GroupSkillElement(new ArrayList<>()); jsonString = BossesGson.get().toJson(groupSkillElement); @@ -295,7 +296,7 @@ public class BossAPI { * @return an instance of the drop table if successful */ public static Skill createBaseSkill(String name, String type, String mode) { - if(PLUGIN.getSkillsFileManager().getSkill(name) != null) { + if (PLUGIN.getSkillsFileManager().getSkill(name) != null) { Debug.SKILL_NAME_EXISTS.debug(name); return null; } @@ -310,12 +311,12 @@ public class BossAPI { * Used to create a new base drop table * with the specified arguments. * - * @param name - name of the drop table. + * @param name - name of the drop table. * @param dropType - drop table type. * @return an instance of the drop table if successful */ public static DropTable createBaseDropTable(String name, String dropType) { - if(PLUGIN.getDropTableFileManager().getDropTable(name) != null) { + if (PLUGIN.getDropTableFileManager().getDropTable(name) != null) { Debug.DROPTABLE_NAME_EXISTS.debug(name); return null; } @@ -323,15 +324,15 @@ public class BossAPI { JsonParser jsonParser = new JsonParser(); String jsonString; - if(dropType.equalsIgnoreCase("SPRAY")) { + if (dropType.equalsIgnoreCase("SPRAY")) { SprayTableElement sprayTableElement = new SprayTableElement(new HashMap<>(), false, 100, 10); jsonString = BossesGson.get().toJson(sprayTableElement); - } else if(dropType.equalsIgnoreCase("GIVE")) { + } else if (dropType.equalsIgnoreCase("GIVE")) { GiveTableElement giveTableElement = new GiveTableElement(new HashMap<>()); jsonString = BossesGson.get().toJson(giveTableElement); - } else if(dropType.equalsIgnoreCase("DROP")) { + } else if (dropType.equalsIgnoreCase("DROP")) { DropTableElement dropTableElement = new DropTableElement(new HashMap<>(), false, 10); jsonString = BossesGson.get().toJson(dropTableElement); @@ -353,7 +354,7 @@ public class BossAPI { * elements are filled in editing can be disabled * and the boss can be spawned. * - * @param name - boss name + * @param name - boss name * @param entityTypeInput - entity type * @return null if something went wrong, or the BossEntity that was created. */ @@ -361,7 +362,7 @@ public class BossAPI { String input = entityTypeInput.split(":")[0]; EntityFinder entityFinder = EntityFinder.get(input); - if(PLUGIN.getBossEntityContainer().exists(name)) { + if (PLUGIN.getBossEntityContainer().exists(name)) { Debug.BOSS_NAME_EXISTS.debug(name); return null; } @@ -399,7 +400,7 @@ public class BossAPI { * elements are filled in editing can be disabled * and the minion can be spawned in skills. * - * @param name - minion name + * @param name - minion name * @param entityTypeInput - entity type * @return null if something went wrong, or the MinionEntity that was created. */ @@ -407,7 +408,7 @@ public class BossAPI { String input = entityTypeInput.split(":")[0]; EntityFinder entityFinder = EntityFinder.get(input); - if(PLUGIN.getMinionEntityContainer().exists(name)) { + if (PLUGIN.getMinionEntityContainer().exists(name)) { Debug.MINION_NAME_EXISTS.debug(name); return null; } @@ -420,7 +421,7 @@ public class BossAPI { entityStatsElements.add(entityStatsElement); - MinionEntity minionEntity = new MinionEntity(true,entityStatsElements); + MinionEntity minionEntity = new MinionEntity(true, entityStatsElements); boolean result = PLUGIN.getMinionEntityContainer().saveData(name, minionEntity); if (!result) { @@ -441,7 +442,7 @@ public class BossAPI { * @return an instance of the auto spawn if successful */ public static AutoSpawn createBaseAutoSpawn(String name) { - if(PLUGIN.getAutoSpawnFileManager().getAutoSpawn(name) != null) { + if (PLUGIN.getAutoSpawnFileManager().getAutoSpawn(name) != null) { Debug.AUTOSPAWN_NAME_EXISTS.debug(name); return null; } @@ -461,13 +462,13 @@ public class BossAPI { * specified bossEntity. * * @param bossEntity - targetted BossEntity - * @param location - Location to spawn the boss. - * @param player - Player who spawned the boss. - * @param itemStack - The itemstack used to spawn the boss. + * @param location - Location to spawn the boss. + * @param player - Player who spawned the boss. + * @param itemStack - The itemstack used to spawn the boss. * @return ActiveBossHolder class with stored information */ public static ActiveBossHolder spawnNewBoss(BossEntity bossEntity, Location location, Player player, ItemStack itemStack, boolean customSpawnMessage) { - if(bossEntity.isEditing()) { + if (bossEntity.isEditing()) { Debug.ATTEMPTED_TO_SPAWN_WHILE_DISABLED.debug(); return null; } @@ -476,7 +477,7 @@ public class BossAPI { ActiveBossHolder activeBossHolder = PLUGIN.getBossEntityManager().createActiveBossHolder(bossEntity, location, name, player); - if(activeBossHolder == null) { + if (activeBossHolder == null) { Debug.FAILED_TO_CREATE_ACTIVE_BOSS_HOLDER.debug(); return null; } @@ -485,7 +486,7 @@ public class BossAPI { PreBossSpawnEvent preBossSpawnEvent; - if(player != null && itemStack != null) { + if (player != null && itemStack != null) { preBossSpawnEvent = new PreBossSpawnItemEvent(activeBossHolder, player, itemStack); } else { preBossSpawnEvent = new PreBossSpawnEvent(activeBossHolder); @@ -502,13 +503,13 @@ public class BossAPI { * bossEntity, under the activebossholder. * * @param activeBossHolder - targeted active boss - * @param skill - the skill from the skills.json + * @param skill - the skill from the skills.json */ public static void spawnNewMinion(ActiveBossHolder activeBossHolder, Skill skill) { - if(skill.getType().equalsIgnoreCase("CUSTOM")) { + if (skill.getType().equalsIgnoreCase("CUSTOM")) { CustomSkillElement customSkillElement = PLUGIN.getBossSkillManager().getCustomSkillElement(skill); - if(customSkillElement.getCustom().getType().equalsIgnoreCase("MINIONS")) { + if (customSkillElement.getCustom().getType().equalsIgnoreCase("MINIONS")) { CustomMinionSkillElement customMinionSkillElement = customSkillElement.getCustom().getCustomMinionSkillData(); PLUGIN.getBossEntityManager().spawnMinionsOnBossHolder(activeBossHolder, skill, customMinionSkillElement); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java index 3453765..c7563d3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java @@ -24,12 +24,12 @@ public class BossCmd extends SubCommandService { @Override public void execute(CommandSender sender, String[] args) { - if(args.length == 0) { + if (args.length == 0) { Bukkit.dispatchCommand(sender, "boss help"); return; } - if(handleSubCommand(sender, args)) return; + if (handleSubCommand(sender, args)) return; Bukkit.dispatchCommand(sender, "boss help"); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java index b8ba412..023537e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java @@ -31,7 +31,7 @@ public class BossCreateCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.create.hasPermission(sender)) { + if (!Permission.create.hasPermission(sender)) { Message.Boss_Create_NoPermission.msg(sender); return; } @@ -47,21 +47,21 @@ public class BossCreateCmd extends SubCommand { String name = args[1]; String entityTypeInput = args[2]; - if(this.bossEntityContainer.exists(name)) { + if (this.bossEntityContainer.exists(name)) { Message.Boss_Create_NameAlreadyExists.msg(sender, name); return; } EntityFinder entityFinder = EntityFinder.get(entityTypeInput); - if(entityFinder == null) { + if (entityFinder == null) { Message.Boss_Create_EntityTypeNotFound.msg(sender, entityTypeInput); return; } BossEntity bossEntity = BossAPI.createBaseBossEntity(name, entityTypeInput); - if(bossEntity == null) { + if (bossEntity == null) { Message.Boss_Create_SomethingWentWrong.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java index 2266508..ff04bb7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java @@ -24,12 +24,12 @@ public class BossDebugCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.debug.hasPermission(sender)) { + if (!Permission.debug.hasPermission(sender)) { Message.Boss_Debug_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } @@ -37,7 +37,7 @@ public class BossDebugCmd extends SubCommand { Player player = (Player) sender; String toggled; - if(this.debugManager.isToggled(player.getUniqueId())) { + if (this.debugManager.isToggled(player.getUniqueId())) { this.debugManager.togglePlayerOff(player.getUniqueId()); toggled = "Off"; } else { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java index fca3648..427641d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java @@ -24,12 +24,12 @@ public class BossDropTableCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_DropTable_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java index be1e5b7..a164b64 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java @@ -28,19 +28,19 @@ public class BossEditCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_Edit_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } Player player = (Player) sender; - switch(args.length) { + switch (args.length) { default: case 1: this.bossPanelManager.getBosses().openFor(player); @@ -48,7 +48,7 @@ public class BossEditCmd extends SubCommand { case 2: String input = args[1]; - if(!this.bossEntityContainer.exists(input)) { + if (!this.bossEntityContainer.exists(input)) { Message.Boss_Edit_DoesntExist.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java index 39d4d86..42aa340 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java @@ -31,22 +31,22 @@ public class BossGiveEggCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.give.hasPermission(sender)) { + if (!Permission.give.hasPermission(sender)) { Message.Boss_GiveEgg_NoPermission.msg(sender); return; } - if(args.length < 3) { + if (args.length < 3) { Message.Boss_GiveEgg_InvalidArgs.msg(sender); return; } int amount = 1; - if(args.length == 4) { + if (args.length == 4) { String amountInput = args[3]; - if(NumberUtils.get().isInt(amountInput)) { + if (NumberUtils.get().isInt(amountInput)) { amount = Integer.valueOf(amountInput); } else { Message.General_NotNumber.msg(sender); @@ -57,7 +57,7 @@ public class BossGiveEggCmd extends SubCommand { String playerInput = args[2]; Player player = Bukkit.getPlayer(playerInput); - if(player == null) { + if (player == null) { Message.General_NotOnline.msg(sender, playerInput); return; } @@ -65,14 +65,14 @@ public class BossGiveEggCmd extends SubCommand { String bossInput = args[1]; BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); - if(bossEntity == null) { + if (bossEntity == null) { Message.Boss_GiveEgg_InvalidBoss.msg(sender); return; } ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity); - if(spawnItem == null) { + if (spawnItem == null) { Message.Boss_GiveEgg_NotSet.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java index 146fade..f286afd 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java @@ -21,13 +21,13 @@ public class BossHelpCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(Permission.admin.hasPermission(sender) || Permission.help.hasPermission(sender)) { + if (Permission.admin.hasPermission(sender) || Permission.help.hasPermission(sender)) { int pageNumber = 0; - if(args.length > 1) { + if (args.length > 1) { Integer newNumber = NumberUtils.get().getInteger(args[1]); - if(newNumber != null) pageNumber = newNumber; + if (newNumber != null) pageNumber = newNumber; } switch (pageNumber) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java index e5d372a..98e2760 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java @@ -27,12 +27,12 @@ public class BossInfoCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_Info_NoPermission.msg(sender); return; } - if(args.length != 2) { + if (args.length != 2) { Message.Boss_Info_InvalidArgs.msg(sender); return; } @@ -40,7 +40,7 @@ public class BossInfoCmd extends SubCommand { String input = args[1]; BossEntity bossEntity = this.bossesFileManager.getBossEntity(input); - if(bossEntity == null) { + if (bossEntity == null) { Message.Boss_Info_CouldntFindBoss.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java index 9489d6e..4535a9c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java @@ -24,12 +24,12 @@ public class BossItemsCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_Items_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java index cb1bec8..74df466 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java @@ -25,19 +25,19 @@ public class BossKillAllCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_KillAll_NoPermission.msg(sender); return; } World world = null; - if(args.length == 2) { + if (args.length == 2) { String worldArgs = args[1]; world = Bukkit.getWorld(worldArgs); - if(world == null) { + if (world == null) { Message.Boss_KillAll_WorldNotFound.msg(sender); return; } @@ -45,7 +45,7 @@ public class BossKillAllCmd extends SubCommand { int amount = this.bossEntityManager.killAllHolders(world); - if(args.length == 2) Message.Boss_KillAll_KilledWorld.msg(sender, amount, world.getName()); + if (args.length == 2) Message.Boss_KillAll_KilledWorld.msg(sender, amount, world.getName()); else Message.Boss_KillAll_KilledAll.msg(sender, amount); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java index 449079f..bca8f17 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java @@ -24,12 +24,12 @@ public class BossListCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_List_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java index 2a008db..bda711c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java @@ -24,12 +24,12 @@ public class BossMenuCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_Menu_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java index 59fd569..c28fa39 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java @@ -29,12 +29,12 @@ public class BossNearbyCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.nearby.hasPermission(sender)) { + if (!Permission.nearby.hasPermission(sender)) { Message.Boss_Nearby_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } @@ -45,12 +45,12 @@ public class BossNearbyCmd extends SubCommand { double maxRadius = this.plugin.getConfig().getDouble("Limits.maxNearbyRadius", 500.0); String nearbyFormat = this.plugin.getConfig().getString("Settings.nearbyFormat", "{name} ({distance}m)"); - if(args.length == 2) { + if (args.length == 2) { Integer newNumber = NumberUtils.get().getInteger(args[1]); - if(newNumber != null) radius = newNumber; + if (newNumber != null) radius = newNumber; - if(radius > maxRadius) { + if (radius > maxRadius) { Message.Boss_Nearby_MaxRadius.msg(player, maxRadius); return; } @@ -59,7 +59,7 @@ public class BossNearbyCmd extends SubCommand { Map nearbyBosses = this.plugin.getBossEntityManager().getActiveBossHoldersWithinRadius(radius, location); Map sortedMap = MapUtils.get().sortByValue(nearbyBosses); - if(sortedMap.isEmpty()) { + if (sortedMap.isEmpty()) { Message.Boss_Nearby_NoneNearby.msg(player); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java index d039c08..9ebe925 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java @@ -22,7 +22,7 @@ import java.util.List; * @author Charles Cullen * @version 1.0.0 * @since 19-Nov-18 - * + *

* boss new droptable [name] [type] * boss new skill [name] [type] [mode] * boss new command [name] [commands] @@ -53,7 +53,7 @@ public class BossNewCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_New_NoPermission.msg(sender); return; } @@ -61,17 +61,17 @@ public class BossNewCmd extends SubCommand { //-------------------- // A U T O S P A W N //-------------------- - if(args.length == 3 && args[1].equalsIgnoreCase("autospawn")) { + if (args.length == 3 && args[1].equalsIgnoreCase("autospawn")) { String nameInput = args[2]; - if(this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) { + if (this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) { Message.Boss_New_AlreadyExists.msg(sender, "AutoSpawn"); return; } AutoSpawn autoSpawn = BossAPI.createBaseAutoSpawn(nameInput); - if(autoSpawn == null) { + if (autoSpawn == null) { Message.Boss_New_SomethingWentWrong.msg(sender, "AutoSpawn"); } else { Message.Boss_New_AutoSpawn.msg(sender, nameInput); @@ -84,10 +84,10 @@ public class BossNewCmd extends SubCommand { //------------------- // C O M M A N D //------------------- - if(args.length >= 4 && args[1].equalsIgnoreCase("command")) { + if (args.length >= 4 && args[1].equalsIgnoreCase("command")) { String nameInput = args[2]; - if(this.commandsFileManager.getCommands(nameInput) != null) { + if (this.commandsFileManager.getCommands(nameInput) != null) { Message.Boss_New_AlreadyExists.msg(sender, "Command"); return; } @@ -104,10 +104,10 @@ public class BossNewCmd extends SubCommand { //------------------- // M E S S A G E //------------------- - if(args.length >= 4 && args[1].equalsIgnoreCase("message")) { + if (args.length >= 4 && args[1].equalsIgnoreCase("message")) { String nameInput = args[2]; - if(this.commandsFileManager.getCommands(nameInput) != null) { + if (this.commandsFileManager.getCommands(nameInput) != null) { Message.Boss_New_AlreadyExists.msg(sender, "Message"); return; } @@ -124,31 +124,31 @@ public class BossNewCmd extends SubCommand { //---------------------- // D R O P T A B L E //---------------------- - if(args.length == 4 && args[1].equalsIgnoreCase("droptable")) { + if (args.length == 4 && args[1].equalsIgnoreCase("droptable")) { String nameInput = args[2]; String typeInput = args[3]; boolean validType = false; - if(this.dropTableFileManager.getDropTable(nameInput) != null) { + if (this.dropTableFileManager.getDropTable(nameInput) != null) { Message.Boss_New_AlreadyExists.msg(sender, "DropTable"); return; } - for(String s : this.bossDropTableManager.getValidDropTableTypes()) { - if(s.equalsIgnoreCase(typeInput)) { + for (String s : this.bossDropTableManager.getValidDropTableTypes()) { + if (s.equalsIgnoreCase(typeInput)) { validType = true; break; } } - if(!validType) { + if (!validType) { Message.Boss_New_InvalidDropTableType.msg(sender); return; } DropTable dropTable = BossAPI.createBaseDropTable(nameInput, typeInput); - if(dropTable == null) { + if (dropTable == null) { Message.Boss_New_SomethingWentWrong.msg(sender, "DropTable"); } else { Message.Boss_New_DropTable.msg(sender, nameInput, typeInput); @@ -160,45 +160,45 @@ public class BossNewCmd extends SubCommand { //------------------- // S K I L L //------------------- - if(args.length == 5 && args[1].equalsIgnoreCase("skill")) { + if (args.length == 5 && args[1].equalsIgnoreCase("skill")) { String nameInput = args[2]; String typeInput = args[3]; String modeInput = args[4]; boolean validType = false, validMode = false; List skillModes = SkillMode.getSkillModes(); - if(this.skillsFileManager.getSkill(nameInput) != null) { + if (this.skillsFileManager.getSkill(nameInput) != null) { Message.Boss_New_AlreadyExists.msg(sender, "Skill"); return; } - for(String s : this.bossSkillManager.getValidSkillTypes()) { - if(s.equalsIgnoreCase(typeInput)) { + for (String s : this.bossSkillManager.getValidSkillTypes()) { + if (s.equalsIgnoreCase(typeInput)) { validType = true; break; } } - for(SkillMode skillMode : skillModes) { - if(skillMode.name().equalsIgnoreCase(modeInput)) { + for (SkillMode skillMode : skillModes) { + if (skillMode.name().equalsIgnoreCase(modeInput)) { validMode = true; break; } } - if(!validType) { + if (!validType) { Message.Boss_New_InvalidSkillType.msg(sender); return; } - if(!validMode) { + if (!validMode) { Message.Boss_New_InvalidSkillMode.msg(sender); return; } Skill skill = BossAPI.createBaseSkill(nameInput, typeInput, modeInput); - if(skill == null) { + if (skill == null) { Message.Boss_New_SomethingWentWrong.msg(sender, "Skill"); } else { Message.Boss_New_Skill.msg(sender, nameInput, typeInput); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java index 67aa097..7d253a9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java @@ -1,6 +1,5 @@ package com.songoda.epicbosses.commands.boss; -import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.Message; @@ -28,7 +27,7 @@ public class BossReloadCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.reload.hasPermission(sender)) { + if (!Permission.reload.hasPermission(sender)) { Message.Boss_Reload_NoPermission.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java index 0cf0dea..45bd6bc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java @@ -24,17 +24,17 @@ public class BossShopCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.shop.hasPermission(sender)) { + if (!Permission.shop.hasPermission(sender)) { Message.Boss_Shop_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } - if(!this.plugin.getConfig().getBoolean("Toggles.bossShop", true)) { + if (!this.plugin.getConfig().getBoolean("Toggles.bossShop", true)) { Message.Boss_Shop_Disabled.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java index d56bb38..2f237f9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java @@ -24,12 +24,12 @@ public class BossSkillsCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_Skills_NoPermission.msg(sender); return; } - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.General_MustBePlayer.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java index 3852f57..ebaa047 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java @@ -28,29 +28,29 @@ public class BossSpawnCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.admin.hasPermission(sender)) { + if (!Permission.admin.hasPermission(sender)) { Message.Boss_Spawn_NoPermission.msg(sender); return; } - if(args.length < 2) { + if (args.length < 2) { Message.Boss_Spawn_InvalidArgs.msg(sender); return; } Location spawnLocation; - if(args.length == 3) { + if (args.length == 3) { Location input = StringUtils.get().fromStringToLocation(args[2]); - if(input == null) { + if (input == null) { Message.Boss_Spawn_InvalidLocation.msg(sender); return; } spawnLocation = input; } else { - if(!(sender instanceof Player)) { + if (!(sender instanceof Player)) { Message.Boss_Spawn_MustBePlayer.msg(sender); return; } @@ -61,7 +61,7 @@ public class BossSpawnCmd extends SubCommand { String bossInput = args[1]; BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); - if(bossEntity == null) { + if (bossEntity == null) { Message.Boss_Spawn_InvalidBoss.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java index ab579ce..c76da7a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java @@ -31,12 +31,12 @@ public class BossTimeCmd extends SubCommand { @Override public void execute(CommandSender sender, String[] args) { - if(!Permission.time.hasPermission(sender)) { + if (!Permission.time.hasPermission(sender)) { Message.Boss_Time_NoPermission.msg(sender); return; } - if(args.length != 2) { + if (args.length != 2) { Message.Boss_Time_InvalidArgs.msg(sender); return; } @@ -45,7 +45,7 @@ public class BossTimeCmd extends SubCommand { boolean exists = this.autoSpawnManager.exists(section); List currentActive = this.autoSpawnManager.getIntervalAutoSpawns(); - if(!exists) { + if (!exists) { Message.Boss_Time_DoesntExist.msg(sender, StringUtils.get().appendList(currentActive)); return; } @@ -54,7 +54,7 @@ public class BossTimeCmd extends SubCommand { ActiveIntervalAutoSpawnHolder activeIntervalAutoSpawnHolder = (ActiveIntervalAutoSpawnHolder) activeAutoSpawnHolder; long remainingMs = activeIntervalAutoSpawnHolder.getRemainingMs(); - if(remainingMs == 0 && activeIntervalAutoSpawnHolder.isSpawnAfterLastBossIsKilled()) { + if (remainingMs == 0 && activeIntervalAutoSpawnHolder.isSpawnAfterLastBossIsKilled()) { Message.Boss_Time_CurrentlyActive.msg(sender); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java index e23cc93..54fd6be 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java @@ -13,13 +13,6 @@ import java.util.List; */ public class BossEntity { - @Expose - private String spawnItem, targeting; - @Expose - private boolean editing, buyable; - @Expose - private Double price; - @Expose private final List entityStats; @Expose @@ -30,6 +23,12 @@ public class BossEntity { private final SkillsElement skills; @Expose private final DropsElement drops; + @Expose + private String spawnItem, targeting; + @Expose + private boolean editing, buyable; + @Expose + private Double price; public BossEntity(boolean editing, String spawnItem, String targeting, boolean buyable, Double price, List entityStats, SkillsElement skills, DropsElement drops, MessagesElement messages, CommandsElement commands) { this.editing = editing; @@ -45,11 +44,11 @@ public class BossEntity { } public String getEditingValue() { - return this.editing? "Enabled" : "Disabled"; + return this.editing ? "Enabled" : "Disabled"; } public String getTargetingValue() { - if(getTargeting() == null || getTargeting().isEmpty() || getTargeting().equalsIgnoreCase("")) { + if (getTargeting() == null || getTargeting().isEmpty() || getTargeting().equalsIgnoreCase("")) { return "N/A"; } else { return getTargeting(); @@ -59,24 +58,24 @@ public class BossEntity { public List getIncompleteSectionsToEnable() { List incompleteList = new ArrayList<>(); - if(this.entityStats == null) incompleteList.add("EntityStats"); + if (this.entityStats == null) incompleteList.add("EntityStats"); else { EntityStatsElement entityStatsElement = this.entityStats.get(0); - if(entityStatsElement == null) incompleteList.add("EntityStatsElement"); + if (entityStatsElement == null) incompleteList.add("EntityStatsElement"); else { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); - if(mainStatsElement == null) incompleteList.add("MainStatsElement"); + if (mainStatsElement == null) incompleteList.add("MainStatsElement"); else { Integer position = mainStatsElement.getPosition(); String entityType = mainStatsElement.getEntityType(); Double health = mainStatsElement.getHealth(); - if(position == null) incompleteList.add("Entity Position"); - if(health == null) incompleteList.add("Entity Health"); - if(entityType == null || entityType.isEmpty()) incompleteList.add("Entity Type"); - if(getSpawnItem() == null || getSpawnItem().isEmpty()) incompleteList.add("Spawn Item"); + if (position == null) incompleteList.add("Entity Position"); + if (health == null) incompleteList.add("Entity Health"); + if (entityType == null || entityType.isEmpty()) incompleteList.add("Entity Type"); + if (getSpawnItem() == null || getSpawnItem().isEmpty()) incompleteList.add("Spawn Item"); } } } @@ -85,15 +84,15 @@ public class BossEntity { } public boolean isCompleteEnoughToSpawn() { - if(this.entityStats == null) return false; + if (this.entityStats == null) return false; EntityStatsElement entityStatsElement = this.entityStats.get(0); - if(entityStatsElement == null) return false; + if (entityStatsElement == null) return false; MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); - if(mainStatsElement == null) return false; + if (mainStatsElement == null) return false; Integer position = mainStatsElement.getPosition(); String entityType = mainStatsElement.getEntityType(); @@ -110,22 +109,42 @@ public class BossEntity { return this.spawnItem; } + public void setSpawnItem(String spawnItem) { + this.spawnItem = spawnItem; + } + public String getTargeting() { return this.targeting; } + public void setTargeting(String targeting) { + this.targeting = targeting; + } + public boolean isEditing() { return this.editing; } + public void setEditing(boolean editing) { + this.editing = editing; + } + public boolean isBuyable() { return this.buyable; } + public void setBuyable(boolean buyable) { + this.buyable = buyable; + } + public Double getPrice() { return this.price; } + public void setPrice(Double price) { + this.price = price; + } + public List getEntityStats() { return this.entityStats; } @@ -145,24 +164,4 @@ public class BossEntity { public DropsElement getDrops() { return this.drops; } - - public void setSpawnItem(String spawnItem) { - this.spawnItem = spawnItem; - } - - public void setTargeting(String targeting) { - this.targeting = targeting; - } - - public void setEditing(boolean editing) { - this.editing = editing; - } - - public void setBuyable(boolean buyable) { - this.buyable = buyable; - } - - public void setPrice(Double price) { - this.price = price; - } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java index a6103c8..031837d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/MinionEntity.java @@ -33,14 +33,14 @@ public class MinionEntity { return this.targeting; } - public boolean isEditing() { - return this.editing; - } - public void setTargeting(String targeting) { this.targeting = targeting; } + public boolean isEditing() { + return this.editing; + } + public void setEditing(boolean editing) { this.editing = editing; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java index ca7cc33..8358295 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/CommandsElement.java @@ -21,14 +21,14 @@ public class CommandsElement { return this.onSpawn; } - public String getOnDeath() { - return this.onDeath; - } - public void setOnSpawn(String onSpawn) { this.onSpawn = onSpawn; } + public String getOnDeath() { + return this.onDeath; + } + public void setOnDeath(String onDeath) { this.onDeath = onDeath; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java index cc91d83..c1a41d0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/DropsElement.java @@ -24,22 +24,22 @@ public class DropsElement { return this.naturalDrops; } - public Boolean getDropExp() { - return this.dropExp; - } - - public String getDropTable() { - return this.dropTable; - } - public void setNaturalDrops(Boolean naturalDrops) { this.naturalDrops = naturalDrops; } + public Boolean getDropExp() { + return this.dropExp; + } + public void setDropExp(Boolean dropExp) { this.dropExp = dropExp; } + public String getDropTable() { + return this.dropTable; + } + public void setDropTable(String dropTable) { this.dropTable = dropTable; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java index b439959..984933d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EntityStatsElement.java @@ -32,30 +32,30 @@ public class EntityStatsElement { return this.mainStats; } - public EquipmentElement getEquipment() { - return this.equipment; - } - - public HandsElement getHands() { - return this.hands; - } - - public List getPotions() { - return this.potions; - } - public void setMainStats(MainStatsElement mainStats) { this.mainStats = mainStats; } + public EquipmentElement getEquipment() { + return this.equipment; + } + public void setEquipment(EquipmentElement equipment) { this.equipment = equipment; } + public HandsElement getHands() { + return this.hands; + } + public void setHands(HandsElement hands) { this.hands = hands; } + public List getPotions() { + return this.potions; + } + public void setPotions(List potions) { this.potions = potions; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java index ca4962d..547e327 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/EquipmentElement.java @@ -23,30 +23,30 @@ public class EquipmentElement { return this.helmet; } - public String getChestplate() { - return this.chestplate; - } - - public String getLeggings() { - return this.leggings; - } - - public String getBoots() { - return this.boots; - } - public void setHelmet(String helmet) { this.helmet = helmet; } + public String getChestplate() { + return this.chestplate; + } + public void setChestplate(String chestplate) { this.chestplate = chestplate; } + public String getLeggings() { + return this.leggings; + } + public void setLeggings(String leggings) { this.leggings = leggings; } + public String getBoots() { + return this.boots; + } + public void setBoots(String boots) { this.boots = boots; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java index a196dbf..0e61e76 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/HandsElement.java @@ -21,14 +21,14 @@ public class HandsElement { return this.mainHand; } - public String getOffHand() { - return this.offHand; - } - public void setMainHand(String mainHand) { this.mainHand = mainHand; } + public String getOffHand() { + return this.offHand; + } + public void setOffHand(String offHand) { this.offHand = offHand; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java index 5cf2012..9eab1d9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MainStatsElement.java @@ -29,30 +29,30 @@ public class MainStatsElement { return this.position; } - public String getEntityType() { - return this.entityType; - } - - public Double getHealth() { - return this.health; - } - - public String getDisplayName() { - return this.displayName; - } - public void setPosition(Integer position) { this.position = position; } + public String getEntityType() { + return this.entityType; + } + public void setEntityType(String entityType) { this.entityType = entityType; } + public Double getHealth() { + return this.health; + } + public void setHealth(Double health) { this.health = health; } + public String getDisplayName() { + return this.displayName; + } + public void setDisplayName(String displayName) { this.displayName = displayName; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java index d1db06b..b4f30f4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/MessagesElement.java @@ -26,22 +26,22 @@ public class MessagesElement { return this.onSpawn; } - public OnDeathMessageElement getOnDeath() { - return this.onDeath; - } - - public TauntElement getTaunts() { - return this.taunts; - } - public void setOnSpawn(OnSpawnMessageElement onSpawn) { this.onSpawn = onSpawn; } + public OnDeathMessageElement getOnDeath() { + return this.onDeath; + } + public void setOnDeath(OnDeathMessageElement onDeath) { this.onDeath = onDeath; } + public TauntElement getTaunts() { + return this.taunts; + } + public void setTaunts(TauntElement taunts) { this.taunts = taunts; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java index a3a3596..f2acf29 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnDeathMessageElement.java @@ -25,30 +25,30 @@ public class OnDeathMessageElement { return this.message; } - public String getPositionMessage() { - return this.positionMessage; - } - - public Integer getRadius() { - return this.radius; - } - - public Integer getOnlyShow() { - return this.onlyShow; - } - public void setMessage(String message) { this.message = message; } + public String getPositionMessage() { + return this.positionMessage; + } + public void setPositionMessage(String positionMessage) { this.positionMessage = positionMessage; } + public Integer getRadius() { + return this.radius; + } + public void setRadius(Integer radius) { this.radius = radius; } + public Integer getOnlyShow() { + return this.onlyShow; + } + public void setOnlyShow(Integer onlyShow) { this.onlyShow = onlyShow; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java index a498547..38140fb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/OnSpawnMessageElement.java @@ -23,14 +23,14 @@ public class OnSpawnMessageElement { return this.message; } - public Integer getRadius() { - return this.radius; - } - public void setMessage(String message) { this.message = message; } + public Integer getRadius() { + return this.radius; + } + public void setRadius(Integer radius) { this.radius = radius; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java index 168040c..c226258 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/SkillsElement.java @@ -28,22 +28,22 @@ public class SkillsElement { return this.overallChance; } - public String getMasterMessage() { - return this.masterMessage; - } - - public List getSkills() { - return this.skills; - } - public void setOverallChance(Double overallChance) { this.overallChance = overallChance; } + public String getMasterMessage() { + return this.masterMessage; + } + public void setMasterMessage(String masterMessage) { this.masterMessage = masterMessage; } + public List getSkills() { + return this.skills; + } + public void setSkills(List skills) { this.skills = skills; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java index 99c5ec4..024fea9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/entity/elements/TauntElement.java @@ -26,22 +26,22 @@ public class TauntElement { return this.delay; } - public Integer getRadius() { - return this.radius; - } - - public List getTaunts() { - return this.taunts; - } - public void setDelay(Integer delay) { this.delay = delay; } + public Integer getRadius() { + return this.radius; + } + public void setRadius(Integer radius) { this.radius = radius; } + public List getTaunts() { + return this.taunts; + } + public void setTaunts(List taunts) { this.taunts = taunts; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java index 3a4cabc..3f325ee 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDamageEvent.java @@ -27,12 +27,12 @@ public class BossDamageEvent extends Event { this.damage = damageAmount; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java index 1b326dc..e26c927 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossDeathEvent.java @@ -21,12 +21,12 @@ public class BossDeathEvent extends Event { this.autoSpawn = autoSpawn; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java index 121057a..621b797 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSkillEvent.java @@ -25,12 +25,12 @@ public class BossSkillEvent extends Event { this.skill = skill; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java index 8c57912..7034503 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/BossSpawnEvent.java @@ -21,12 +21,12 @@ public class BossSpawnEvent extends Event { this.autoSpawn = autoSpawn; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java index 74858f4..1a66142 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossDeathEvent.java @@ -25,12 +25,12 @@ public class PreBossDeathEvent extends Event { this.killer = killer; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java index d79cb25..6b751de 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSkillEvent.java @@ -23,12 +23,12 @@ public class PreBossSkillEvent extends Event { this.damagingEntity = damagingEntity; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java index ec9a476..3f32f54 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnEvent.java @@ -19,12 +19,12 @@ public class PreBossSpawnEvent extends Event { this.activeBossHolder = activeBossHolder; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java index 1f62f0e..7686d73 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/events/PreBossSpawnItemEvent.java @@ -24,12 +24,12 @@ public class PreBossSpawnItemEvent extends PreBossSpawnEvent { this.player = player; } - @Override - public HandlerList getHandlers() { + public static HandlerList getHandlerList() { return handlers; } - public static HandlerList getHandlerList() { + @Override + public HandlerList getHandlers() { return handlers; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/AutoSpawnFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/AutoSpawnFileHandler.java index 9426fb6..b463673 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/AutoSpawnFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/AutoSpawnFileHandler.java @@ -44,7 +44,7 @@ public class AutoSpawnFileHandler extends FileHandler> { fileReader.close(); - if(jsonObject != null) { + if (jsonObject != null) { jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); AutoSpawn autoSpawn = GSON.fromJson(entry.getValue(), AutoSpawn.class); @@ -63,7 +63,8 @@ public class AutoSpawnFileHandler extends FileHandler> { public void saveFile(Map map) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>(){}.getType(); + Type type = new TypeToken>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(map), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/BossesFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/BossesFileHandler.java index 68d3d0f..47f47c9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/BossesFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/BossesFileHandler.java @@ -44,7 +44,7 @@ public class BossesFileHandler extends FileHandler> { fileReader.close(); - if(jsonObject != null) { + if (jsonObject != null) { jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); BossEntity bossEntity = GSON.fromJson(entry.getValue(), BossEntity.class); @@ -63,7 +63,8 @@ public class BossesFileHandler extends FileHandler> { public void saveFile(Map map) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>(){}.getType(); + Type type = new TypeToken>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(map), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/CommandsFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/CommandsFileHandler.java index 27957ce..be2916c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/CommandsFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/CommandsFileHandler.java @@ -44,8 +44,9 @@ public class CommandsFileHandler extends FileHandler>> fileReader.close(); - if(jsonObject != null) { - Type listType = new TypeToken>(){}.getType(); + if (jsonObject != null) { + Type listType = new TypeToken>() { + }.getType(); jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); @@ -65,7 +66,8 @@ public class CommandsFileHandler extends FileHandler>> public void saveFile(Map> stringListMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>>(){}.getType(); + Type type = new TypeToken>>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(stringListMap), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/DropTableFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/DropTableFileHandler.java index f1cd85f..4febffa 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/DropTableFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/DropTableFileHandler.java @@ -45,7 +45,7 @@ public class DropTableFileHandler extends FileHandler> { fileReader.close(); - if(jsonObject != null) { + if (jsonObject != null) { jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); DropTable dropTable = GSON.fromJson(entry.getValue(), DropTable.class); @@ -64,7 +64,8 @@ public class DropTableFileHandler extends FileHandler> { public void saveFile(Map stringDropTableMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>(){}.getType(); + Type type = new TypeToken>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(stringDropTableMap), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java index 589d544..ff97eae 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/ItemStackFileHandler.java @@ -44,7 +44,7 @@ public class ItemStackFileHandler extends FileHandler { String id = entry.getKey(); ItemStackHolder itemStackHolder = GSON.fromJson(entry.getValue(), ItemStackHolder.class); @@ -63,7 +63,8 @@ public class ItemStackFileHandler extends FileHandler map) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>(){}.getType(); + Type type = new TypeToken>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(map), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/MessagesFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/MessagesFileHandler.java index 5cd10f3..0f8bf64 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/MessagesFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/MessagesFileHandler.java @@ -44,8 +44,9 @@ public class MessagesFileHandler extends FileHandler>> fileReader.close(); - if(jsonObject != null) { - Type listType = new TypeToken>(){}.getType(); + if (jsonObject != null) { + Type listType = new TypeToken>() { + }.getType(); jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); @@ -65,7 +66,8 @@ public class MessagesFileHandler extends FileHandler>> public void saveFile(Map> stringListMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>>(){}.getType(); + Type type = new TypeToken>>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(stringListMap), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java index 89be6d0..9700f19 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/MinionsFileHandler.java @@ -44,7 +44,7 @@ public class MinionsFileHandler extends FileHandler> { fileReader.close(); - if(jsonObject != null) { + if (jsonObject != null) { jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); MinionEntity minionEntity = GSON.fromJson(entry.getValue(), MinionEntity.class); @@ -63,7 +63,8 @@ public class MinionsFileHandler extends FileHandler> { public void saveFile(Map stringMinionEntityMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>(){}.getType(); + Type type = new TypeToken>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(stringMinionEntityMap), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/file/SkillsFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/file/SkillsFileHandler.java index 1c2fc78..1ce5ec8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/file/SkillsFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/file/SkillsFileHandler.java @@ -44,7 +44,7 @@ public class SkillsFileHandler extends FileHandler> { fileReader.close(); - if(jsonObject != null) { + if (jsonObject != null) { jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); Skill bossEntity = GSON.fromJson(entry.getValue(), Skill.class); @@ -63,7 +63,8 @@ public class SkillsFileHandler extends FileHandler> { public void saveFile(Map skillMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken>(){}.getType(); + Type type = new TypeToken>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(skillMap), type)); fileWriter.flush(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java index 5a60c42..19871e7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossShopPriceHandler.java @@ -54,18 +54,18 @@ public class BossShopPriceHandler implements IHandler { Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); - if(!uuid.equals(getPlayer().getUniqueId())) return; - if(isHandled()) return; + if (!uuid.equals(getPlayer().getUniqueId())) return; + if (isHandled()) return; String input = event.getMessage(); - if(input.equalsIgnoreCase("-")) { + if (input.equalsIgnoreCase("-")) { input = null; } event.setCancelled(true); - if(NumberUtils.get().isDouble(input)) { + if (NumberUtils.get().isDouble(input)) { double amount = NumberUtils.get().getDouble(input); getBossEntity().setPrice(amount); getBossesFileManager().save(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableCommand.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableCommand.java index 70e7f29..c11e7f5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableCommand.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableCommand.java @@ -17,7 +17,7 @@ public class GetDropTableCommand implements IGetDropTableListItem> public List getListItem(String id) { List commands = BossAPI.getStoredCommands(id); - if(commands == null) { + if (commands == null) { Debug.FAILED_TO_LOAD_COMMANDS.debug(id); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java index 6eed199..15b6c58 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/droptable/GetDropTableItemStack.java @@ -25,14 +25,14 @@ public class GetDropTableItemStack implements IGetDropTableListItem { public ItemStack getListItem(String id) { ItemStackHolder itemStackHolder = BossAPI.getStoredItemStack(id); - if(itemStackHolder == null) { + if (itemStackHolder == null) { Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(id); return null; } ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(id); return null; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/variables/AutoSpawnLocationVariableHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/variables/AutoSpawnLocationVariableHandler.java index 5443d0f..479f695 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/variables/AutoSpawnLocationVariableHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/variables/AutoSpawnLocationVariableHandler.java @@ -25,7 +25,7 @@ public class AutoSpawnLocationVariableHandler extends AutoSpawnVariableHandler { protected boolean confirmValue(String input, IntervalSpawnElement intervalSpawnElement) { Location location = StringUtils.get().fromStringToLocation(input); - if(location == null) { + if (location == null) { Message.Boss_AutoSpawn_InvalidLocation.msg(getPlayer(), input); return false; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java index 0619ec5..e850cac 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveBossHolder.java @@ -134,22 +134,22 @@ public class ActiveBossHolder implements IActiveHolder { return this.targetHandler; } - public boolean isDead() { - return this.isDead; - } - - public boolean isCustomSpawnMessage() { - return this.customSpawnMessage; - } - public void setTargetHandler(TargetHandler targetHandler) { this.targetHandler = targetHandler; } + public boolean isDead() { + return this.isDead; + } + public void setDead(boolean isDead) { this.isDead = isDead; } + public boolean isCustomSpawnMessage() { + return this.customSpawnMessage; + } + public void setCustomSpawnMessage(boolean customSpawnMessage) { this.customSpawnMessage = customSpawnMessage; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java index b8a4349..503f324 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/ActiveMinionHolder.java @@ -17,13 +17,12 @@ import java.util.UUID; */ public class ActiveMinionHolder implements IActiveHolder { - private TargetHandler targetHandler = null; - - private Map livingEntityMap = new HashMap<>(); - private ActiveBossHolder activeBossHolder; private final MinionEntity minionEntity; private final Location location; private final String name; + private TargetHandler targetHandler = null; + private Map livingEntityMap = new HashMap<>(); + private ActiveBossHolder activeBossHolder; public ActiveMinionHolder(ActiveBossHolder activeBossHolder, MinionEntity minionEntity, Location spawnLocation, String name) { this.activeBossHolder = activeBossHolder; @@ -39,7 +38,7 @@ public class ActiveMinionHolder implements IActiveHolder { @Override public void setLivingEntity(int position, LivingEntity livingEntity) { - if(this.livingEntityMap.containsKey(position)) { + if (this.livingEntityMap.containsKey(position)) { LivingEntity target = (LivingEntity) ServerUtils.get().getEntity(this.livingEntityMap.get(position)); if (target != null) target.remove(); @@ -69,11 +68,11 @@ public class ActiveMinionHolder implements IActiveHolder { @Override public boolean isDead() { - if(this.livingEntityMap.isEmpty()) return true; + if (this.livingEntityMap.isEmpty()) return true; - for(UUID uuid : this.livingEntityMap.values()) { + for (UUID uuid : this.livingEntityMap.values()) { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(uuid); - if(livingEntity == null || livingEntity.isDead()) return true; + if (livingEntity == null || livingEntity.isDead()) return true; } return false; @@ -88,6 +87,10 @@ public class ActiveMinionHolder implements IActiveHolder { return this.targetHandler; } + public void setTargetHandler(TargetHandler targetHandler) { + this.targetHandler = targetHandler; + } + public Map getLivingEntityMap() { return this.livingEntityMap; } @@ -107,8 +110,4 @@ public class ActiveMinionHolder implements IActiveHolder { public String getName() { return this.name; } - - public void setTargetHandler(TargetHandler targetHandler) { - this.targetHandler = targetHandler; - } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java b/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java index 04aa976..f77971c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/holder/autospawn/ActiveIntervalAutoSpawnHolder.java @@ -35,11 +35,11 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { @Override public boolean canSpawn() { - if(getAutoSpawn().isEditing()) { + if (getAutoSpawn().isEditing()) { ServerUtils.get().logDebug("AutoSpawn failed to spawn due to editing enabled."); return false; } - if(!getAutoSpawn().getType().equalsIgnoreCase("INTERVAL")) { + if (!getAutoSpawn().getType().equalsIgnoreCase("INTERVAL")) { ServerUtils.get().logDebug("AutoSpawn failed to spawn due to interval type not set."); return false; } @@ -50,22 +50,22 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { Location location = this.intervalSpawnElement.getSpawnLocation(); boolean spawnIfChunkNotLoaded = ObjectUtils.getValue(getAutoSpawn().getAutoSpawnSettings().getSpawnWhenChunkIsntLoaded(), false); - if(location == null) { + if (location == null) { ServerUtils.get().logDebug("AutoSpawn failed to spawn due to location is null."); return false; } - if(!spawnIfChunkNotLoaded && !location.getChunk().isLoaded()) { + if (!spawnIfChunkNotLoaded && !location.getChunk().isLoaded()) { ServerUtils.get().logDebug("AutoSpawn failed to spawn due to spawnIfChunkNotLoaded was false and chunk wasn't loaded."); return false; } - if(isSpawnAfterLastBossIsKilled() && !getActiveBossHolders().isEmpty()) { + if (isSpawnAfterLastBossIsKilled() && !getActiveBossHolders().isEmpty()) { ServerUtils.get().logDebug("AutoSpawn failed due to spawnAfterLastBossKilled is true and activeBossHolders is not empty."); return false; } boolean returnStatement = currentActiveAmount < maxAmount; - if(!returnStatement) { + if (!returnStatement) { ServerUtils.get().logDebug("AutoSpawn failed to spawn due to currentActiveAmount is greater then maxAmount of bosses."); } @@ -79,11 +79,11 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { public void restartInterval() { stopInterval(); - if(getAutoSpawn().isEditing()) return; + if (getAutoSpawn().isEditing()) return; Integer delay = this.intervalSpawnElement.getSpawnRate(); - if(delay == null) { + if (delay == null) { Debug.AUTOSPAWN_INTERVALNOTREAL.debug("null", BossAPI.getAutoSpawnName(getAutoSpawn())); return; } @@ -96,7 +96,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { this.intervalTask = ServerUtils.get().runTimer(delayTick, delayTick, () -> { boolean canSpawn = canSpawn(); - if(!canSpawn) { + if (!canSpawn) { ServerUtils.get().logDebug("--- Failed to AutoSpawn. ---"); updateNextCompleteTime(); return; @@ -104,7 +104,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { ServerUtils.get().logDebug("AutoSpawn Spawn Attempt: " + this.intervalSpawnElement.attemptSpawn(this)); - if(isSpawnAfterLastBossIsKilled()) { + if (isSpawnAfterLastBossIsKilled()) { cancelCurrentInterval(); return; } @@ -129,7 +129,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { public long getRemainingMs() { long currentMs = System.currentTimeMillis(); - if(currentMs > this.nextCompletedTime) return 0; + if (currentMs > this.nextCompletedTime) return 0; return this.nextCompletedTime - currentMs; } @@ -139,10 +139,10 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { boolean spawnAfterLastBossIsKilled = ObjectUtils.getValue(this.intervalSpawnElement.getSpawnAfterLastBossIsKilled(), false); ActiveBossHolder activeBossHolder = event.getActiveBossHolder(); - if(getActiveBossHolders().contains(activeBossHolder)) { + if (getActiveBossHolders().contains(activeBossHolder)) { getActiveBossHolders().remove(activeBossHolder); - if(spawnAfterLastBossIsKilled) { + if (spawnAfterLastBossIsKilled) { restartInterval(); updateNextCompleteTime(); } @@ -151,7 +151,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { } private void cancelCurrentInterval() { - if(this.intervalTask != null) ServerUtils.get().cancelTask(this.intervalTask); + if (this.intervalTask != null) ServerUtils.get().cancelTask(this.intervalTask); this.nextCompletedTime = 0; } @@ -159,7 +159,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { private void updateNextCompleteTime() { Integer delay = this.intervalSpawnElement.getSpawnRate(); - if(delay == null) { + if (delay == null) { Debug.AUTOSPAWN_INTERVALNOTREAL.debug("null", BossAPI.getAutoSpawnName(getAutoSpawn())); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java index 532cc50..bdeebfb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java @@ -67,8 +67,8 @@ public class AddItemsPanel extends PanelHandler { int rawSlot = event.getRawSlot(); int slot = event.getSlot(); - if(panel.isLowerClick(rawSlot)) { - if(this.storedItemStacks.containsKey(uuid)) { + if (panel.isLowerClick(rawSlot)) { + if (this.storedItemStacks.containsKey(uuid)) { Message.Boss_Items_AlreadySet.msg(playerWhoClicked); return; } @@ -93,12 +93,12 @@ public class AddItemsPanel extends PanelHandler { return event -> { int rawSlot = event.getRawSlot(); - if(panel.isLowerClick(rawSlot)) return; + if (panel.isLowerClick(rawSlot)) return; Player player = (Player) event.getWhoClicked(); UUID uuid = player.getUniqueId(); - if(this.storedItemStacks.containsKey(uuid)) { + if (this.storedItemStacks.containsKey(uuid)) { player.getInventory().addItem(this.storedItemStacks.get(uuid)); this.storedItemStacks.remove(uuid); @@ -111,12 +111,12 @@ public class AddItemsPanel extends PanelHandler { return event -> { int rawSlot = event.getRawSlot(); - if(panel.isLowerClick(rawSlot)) return; + if (panel.isLowerClick(rawSlot)) return; Player player = (Player) event.getWhoClicked(); UUID uuid = player.getUniqueId(); - if(this.storedItemStacks.containsKey(uuid)) { + if (this.storedItemStacks.containsKey(uuid)) { this.itemsFileManager.addItemStack(UUID.randomUUID().toString(), this.storedItemStacks.get(uuid)); Message.Boss_Items_Added.msg(player); this.storedItemStacks.remove(uuid); @@ -130,12 +130,12 @@ public class AddItemsPanel extends PanelHandler { return event -> { int rawSlot = event.getRawSlot(); - if(panel.isLowerClick(rawSlot)) return; + if (panel.isLowerClick(rawSlot)) return; Player player = (Player) event.getWhoClicked(); UUID uuid = player.getUniqueId(); - if(this.storedItemStacks.containsKey(uuid)) { + if (this.storedItemStacks.containsKey(uuid)) { player.getInventory().addItem(this.storedItemStacks.get(uuid)); this.storedItemStacks.remove(uuid); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java index b278027..9fa0a70 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AutoSpawnsPanel.java @@ -47,7 +47,7 @@ public class AutoSpawnsPanel extends MainListPanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, autoSpawnMap, entryList); return true; @@ -58,31 +58,32 @@ public class AutoSpawnsPanel extends MainListPanelHandler { private void loadPage(Panel panel, int requestedPage, Map autoSpawnMap, List entryList) { panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); AutoSpawn autoSpawn = autoSpawnMap.get(name); ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(this.itemsFileManager.getItemStackHolder("DefaultAutoSpawnListItem")); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } Map replaceMap = new HashMap<>(); List entities = ObjectUtils.getValue(autoSpawn.getEntities(), new ArrayList<>()); AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); - String entitiesSize = entities.size()+""; - String maxAlive = ""+ObjectUtils.getValue(settings.getMaxAliveAtOnce(), 1); - String amountToSpawn = ""+ObjectUtils.getValue(settings.getAmountPerSpawn(), 1); - String chunkIsntLoaded = ""+ObjectUtils.getValue(settings.getSpawnWhenChunkIsntLoaded(), false); - String overrideMessage = ""+ObjectUtils.getValue(settings.getOverrideDefaultSpawnMessage(), true); - String shuffleEntities = ""+ObjectUtils.getValue(settings.getShuffleEntitiesList(), false); + String entitiesSize = entities.size() + ""; + String maxAlive = "" + ObjectUtils.getValue(settings.getMaxAliveAtOnce(), 1); + String amountToSpawn = "" + ObjectUtils.getValue(settings.getAmountPerSpawn(), 1); + String chunkIsntLoaded = "" + ObjectUtils.getValue(settings.getSpawnWhenChunkIsntLoaded(), false); + String overrideMessage = "" + ObjectUtils.getValue(settings.getOverrideDefaultSpawnMessage(), true); + String shuffleEntities = "" + ObjectUtils.getValue(settings.getShuffleEntitiesList(), false); String spawnMessage = ObjectUtils.getValue(settings.getSpawnMessage(), ""); replaceMap.put("{name}", name); replaceMap.put("{type}", StringUtils.get().formatString(autoSpawn.getType())); - replaceMap.put("{enabled}", (autoSpawn.isEditing())+""); + replaceMap.put("{enabled}", (autoSpawn.isEditing()) + ""); replaceMap.put("{entities}", entitiesSize); replaceMap.put("{maxAlive}", maxAlive); replaceMap.put("{amountPerSpawn}", amountToSpawn); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java index 1d465ea..8848ca0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomBossesPanel.java @@ -46,7 +46,7 @@ public class CustomBossesPanel extends MainListPanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentEntities, entryList); return true; @@ -57,33 +57,34 @@ public class CustomBossesPanel extends MainListPanelHandler { private void loadPage(Panel panel, int page, Map bossEntityMap, List entryList) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= bossEntityMap.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= bossEntityMap.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); BossEntity entity = bossEntityMap.get(name); ItemStack itemStack = this.bossEntityManager.getDisplaySpawnItem(entity); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } Map replaceMap = new HashMap<>(); replaceMap.put("{name}", name); - replaceMap.put("{enabled}", ""+entity.isEditing()); + replaceMap.put("{enabled}", "" + entity.isEditing()); ItemStackUtils.applyDisplayName(itemStack, this.epicBosses.getDisplay().getString("Display.Bosses.name"), replaceMap); ItemStackUtils.applyDisplayLore(itemStack, this.epicBosses.getDisplay().getStringList("Display.Bosses.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { - if(e.getClick() == ClickType.RIGHT || e.getClick() == ClickType.SHIFT_RIGHT) { + if (e.getClick() == ClickType.RIGHT || e.getClick() == ClickType.SHIFT_RIGHT) { this.bossPanelManager.getMainBossEditMenu().openFor((Player) e.getWhoClicked(), entity); - } else if(e.getClick() == ClickType.LEFT || e.getClick() == ClickType.SHIFT_LEFT) { + } else if (e.getClick() == ClickType.LEFT || e.getClick() == ClickType.SHIFT_LEFT) { ItemStack spawnItem = this.bossEntityManager.getSpawnItem(entity); - if(spawnItem == null) { + if (spawnItem == null) { Debug.FAILED_TO_GIVE_SPAWN_EGG.debug(e.getWhoClicked().getName(), name); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java index de404b8..e376694 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomItemsPanel.java @@ -40,7 +40,7 @@ public class CustomItemsPanel extends MainListPanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentItemStacks, entryList); return true; @@ -52,8 +52,9 @@ public class CustomItemsPanel extends MainListPanelHandler { private void loadPage(Panel panel, int requestedPage, Map currentItemStacks, List entryList) { panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= currentItemStacks.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= currentItemStacks.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); ItemStackHolder itemStackHolder = currentItemStacks.get(name); @@ -62,12 +63,12 @@ public class CustomItemsPanel extends MainListPanelHandler { panel.setItem(realisticSlot, itemStack.clone(), e -> { ClickType clickType = e.getClick(); - if(clickType == ClickType.RIGHT || clickType == ClickType.SHIFT_RIGHT) { + if (clickType == ClickType.RIGHT || clickType == ClickType.SHIFT_RIGHT) { int timesUsed = this.bossPanelManager.isItemStackUsed(name); - if(timesUsed > 0) { + if (timesUsed > 0) { Message.Boss_Items_CannotBeRemoved.msg(e.getWhoClicked(), timesUsed); - } else if(name.contains("Default")) { + } else if (name.contains("Default")) { Message.Boss_Items_DefaultCannotBeRemoved.msg(e.getWhoClicked(), timesUsed); } else { this.itemsFileManager.removeItemStack(name); @@ -77,9 +78,9 @@ public class CustomItemsPanel extends MainListPanelHandler { loadPage(panel, requestedPage, currentItemStacks, entryList); Message.Boss_Items_Removed.msg(e.getWhoClicked()); } - } else if(clickType == ClickType.LEFT || clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.LEFT || clickType == ClickType.SHIFT_LEFT) { e.getWhoClicked().getInventory().addItem(itemStack.clone()); - } else if(clickType == ClickType.MIDDLE) { + } else if (clickType == ClickType.MIDDLE) { String newName = UUID.randomUUID().toString(); ItemStack newItemStack = itemStack.clone(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java index e50cf39..25d4906 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/CustomSkillsPanel.java @@ -47,7 +47,7 @@ public class CustomSkillsPanel extends MainListPanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentSkills, entryList); return true; @@ -58,8 +58,9 @@ public class CustomSkillsPanel extends MainListPanelHandler { private void loadPage(Panel panel, int requestedPage, Map currentSkills, List entryList) { panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= currentSkills.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= currentSkills.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); Skill skill = currentSkills.get(name); @@ -72,10 +73,10 @@ public class CustomSkillsPanel extends MainListPanelHandler { Double radius = skill.getRadius(); String type = skill.getType(); - if(customMessage == null || customMessage.equals("")) customMessage = "N/A"; - if(radius == null) radius = 100.0; - if(displayName == null || displayName.equals("")) displayName = "N/A"; - if(type == null || type.equals("")) type = "N/A"; + if (customMessage == null || customMessage.equals("")) customMessage = "N/A"; + if (radius == null) radius = 100.0; + if (displayName == null || displayName.equals("")) displayName = "N/A"; + if (type == null || type.equals("")) type = "N/A"; replaceMap.put("{name}", name); replaceMap.put("{type}", type); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java index ff8de28..848c74b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/DropTablePanel.java @@ -47,7 +47,7 @@ public class DropTablePanel extends MainListPanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTableMap, entryList); return true; @@ -58,15 +58,16 @@ public class DropTablePanel extends MainListPanelHandler { private void loadPage(Panel panel, int requestedPage, Map dropTableMap, List entryList) { panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= dropTableMap.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= dropTableMap.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); DropTable dropTable = dropTableMap.get(name); ItemStackHolder itemStackHolder = BossAPI.getStoredItemStack("DefaultDropTableMenuItem"); ItemStack itemStack = this.itemStackConverter.from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java index 008990d..1015b24 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/EntityTypeEditorPanel.java @@ -43,7 +43,7 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, list, bossEntity, entityStatsElement); return true; @@ -80,8 +80,9 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler panel.loadPage(requestedPage, ((slot, realisticSlot) -> { - if(slot >= filteredList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= filteredList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { EntityType entityType = filteredList.get(slot); ItemStack itemStack = ItemStackUtils.getSpawnEggForEntity(entityType); @@ -90,7 +91,7 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler { EntityFinder entityFinder = EntityFinder.get(entityType.name()); - if(entityFinder != null) { + if (entityFinder != null) { Message.Boss_Statistics_SetEntityFinder.msg(e.getWhoClicked(), entityFinder.getFancyName()); entityStatsElement.getMainStats().setEntityType(entityFinder.getFancyName()); this.plugin.getBossesFileManager().save(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/MainMenuPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/MainMenuPanel.java index 3c4420d..537eaa9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/MainMenuPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/MainMenuPanel.java @@ -52,9 +52,9 @@ public class MainMenuPanel extends PanelHandler { return event -> { Player player = (Player) event.getWhoClicked(); - if(event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { + if (event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { this.bossPanelManager.getBosses().openFor(player); - } else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { + } else if (event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { Message.Boss_Create_InvalidArgs.msg(player); player.closeInventory(); } @@ -65,9 +65,9 @@ public class MainMenuPanel extends PanelHandler { return event -> { Player player = (Player) event.getWhoClicked(); - if(event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { + if (event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { this.bossPanelManager.getCustomItems().openFor(player); - } else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { + } else if (event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { this.bossPanelManager.getCustomItemAddItemsMenu().openFor(player); } }; @@ -77,9 +77,9 @@ public class MainMenuPanel extends PanelHandler { return event -> { Player player = (Player) event.getWhoClicked(); - if(event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { + if (event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { this.bossPanelManager.getAutoSpawns().openFor(player); - } else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { + } else if (event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { Message.Boss_New_CreateArgumentsAutoSpawn.msg(event.getWhoClicked()); player.closeInventory(); } @@ -90,9 +90,9 @@ public class MainMenuPanel extends PanelHandler { return event -> { Player player = (Player) event.getWhoClicked(); - if(event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { + if (event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { this.bossPanelManager.getDropTables().openFor(player); - } else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { + } else if (event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { Message.Boss_New_CreateArgumentsDropTable.msg(player); player.closeInventory(); } @@ -103,9 +103,9 @@ public class MainMenuPanel extends PanelHandler { return event -> { Player player = (Player) event.getWhoClicked(); - if(event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { + if (event.getClick() == ClickType.LEFT || event.getClick() == ClickType.SHIFT_LEFT) { this.bossPanelManager.getCustomSkills().openFor(player); - } else if(event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { + } else if (event.getClick() == ClickType.RIGHT || event.getClick() == ClickType.SHIFT_RIGHT) { Message.Boss_New_CreateArgumentsSkill.msg(player); player.closeInventory(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java index 79122d3..ff6bdf2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/ShopPanel.java @@ -50,7 +50,7 @@ public class ShopPanel extends PanelHandler { int maxPage = panel.getMaxPage(filteredMap); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, entryList, filteredMap); return true; @@ -69,15 +69,16 @@ public class ShopPanel extends PanelHandler { private void loadPage(Panel panel, int page, List entryList, Map filteredMap) { panel.loadPage(page, ((slot, realisticSlot) -> { - if(slot >= filteredMap.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= filteredMap.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); BossEntity bossEntity = filteredMap.get(name); ItemStack itemStack = this.bossEntityManager.getDisplaySpawnItem(bossEntity); double price = bossEntity.getPrice(); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } @@ -93,13 +94,13 @@ public class ShopPanel extends PanelHandler { ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity); Player player = (Player) e.getWhoClicked(); - if(spawnItem == null) { + if (spawnItem == null) { Debug.FAILED_TO_GIVE_SPAWN_EGG.debug(e.getWhoClicked().getName(), name); return; } - if(EconomyManager.hasBalance(player, price)) { + if (EconomyManager.hasBalance(player, price)) { Message.Boss_Shop_NotEnoughBalance.msg(player, NumberUtils.get().formatDouble(price)); return; } @@ -116,7 +117,7 @@ public class ShopPanel extends PanelHandler { Map newMap = new HashMap<>(); originalMap.forEach((s, bossEntity) -> { - if(bossEntity.canBeBought()) { + if (bossEntity.canBeBought()) { newMap.put(s, bossEntity); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java index e9cbc9e..32a48c4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnCustomSettingsEditorPanel.java @@ -41,12 +41,12 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler customButtons = autoSpawn.getIntervalSpawnData().getCustomSettingActions(autoSpawn, this); - if(customButtons == null || customButtons.isEmpty()) return; + if (customButtons == null || customButtons.isEmpty()) return; int maxPage = panel.getMaxPage(customButtons); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, customButtons, autoSpawn); return true; @@ -80,8 +80,9 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler clickActions, AutoSpawn autoSpawn) { panel.loadPage(page, ((slot, realisticSlot) -> { - if(slot >= clickActions.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= clickActions.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { ICustomSettingAction customSettingAction = clickActions.get(slot); ClickAction clickAction = customSettingAction.getAction(); @@ -95,7 +96,7 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler lore = this.plugin.getDisplay().getStringList("Display.AutoSpawns.CustomSettings.lore"); List newLore = new ArrayList<>(); - for(String s : lore) { - if(s.contains("{extraInformation}")) { - if(extraInfo == null || extraInfo.isEmpty()) continue; + for (String s : lore) { + if (s.contains("{extraInformation}")) { + if (extraInfo == null || extraInfo.isEmpty()) continue; newLore.add("&7"); newLore.addAll(extraInfo); } else { - for(String replaceKey : replaceMap.keySet()) { - if(s.contains(replaceKey)) { + for (String replaceKey : replaceMap.keySet()) { + if (s.contains(replaceKey)) { s = s.replace(replaceKey, replaceMap.get(replaceKey)); } } @@ -125,7 +126,7 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler { - if(!autoSpawn.isEditing()) { + if (!autoSpawn.isEditing()) { Message.Boss_AutoSpawn_MustToggleEditing.msg(event.getWhoClicked()); } else { clickAction.onClick(event); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java index bfa772d..08b350b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnEntitiesEditorPanel.java @@ -53,7 +53,7 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentEntities, entryList, autoSpawn); return true; @@ -86,8 +86,9 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler current = ObjectUtils.getValue(autoSpawn.getEntities(), new ArrayList<>()); panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); BossEntity bossEntity = currentEntities.get(name); @@ -96,11 +97,11 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler replaceMap = new HashMap<>(); replaceMap.put("{name}", name); - replaceMap.put("{editing}", ""+bossEntity.isEditing()); + replaceMap.put("{editing}", "" + bossEntity.isEditing()); replaceMap.put("{targeting}", bossEntity.getTargeting()); replaceMap.put("{dropTable}", bossEntity.getDrops().getDropTable()); - if(current.contains(name)) { + if (current.contains(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.AutoSpawns.Entities.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.AutoSpawns.Entities.name"), replaceMap); @@ -109,12 +110,12 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler { - if(!autoSpawn.isEditing()) { + if (!autoSpawn.isEditing()) { Message.Boss_AutoSpawn_MustToggleEditing.msg(event.getWhoClicked()); return; } - if(current.contains(name)) { + if (current.contains(name)) { current.remove(name); } else { current.add(name); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpecialSettingsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpecialSettingsEditorPanel.java index f406dd0..15a75ce 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpecialSettingsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnSpecialSettingsEditorPanel.java @@ -47,11 +47,11 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler replaceMap = new HashMap<>(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); AutoSpawnSettings autoSpawnSettings = autoSpawn.getAutoSpawnSettings(); - String shuffleEntities = ObjectUtils.getValue(autoSpawnSettings.getShuffleEntitiesList(), false)+""; + String shuffleEntities = ObjectUtils.getValue(autoSpawnSettings.getShuffleEntitiesList(), false) + ""; String maxAliveAtOnce = NumberUtils.get().formatDouble(ObjectUtils.getValue(autoSpawnSettings.getMaxAliveAtOnce(), 1)); String amountPerSpawn = NumberUtils.get().formatDouble(ObjectUtils.getValue(autoSpawnSettings.getAmountPerSpawn(), 1)); - String chunkIsntLoaded = ObjectUtils.getValue(autoSpawnSettings.getSpawnWhenChunkIsntLoaded(), false)+""; - String overrideSpawnMessage = ObjectUtils.getValue(autoSpawnSettings.getOverrideDefaultSpawnMessage(), false)+""; + String chunkIsntLoaded = ObjectUtils.getValue(autoSpawnSettings.getSpawnWhenChunkIsntLoaded(), false) + ""; + String overrideSpawnMessage = ObjectUtils.getValue(autoSpawnSettings.getOverrideDefaultSpawnMessage(), false) + ""; String spawnMessage = ObjectUtils.getValue(autoSpawnSettings.getSpawnMessage(), ""); replaceMap.put("{name}", BossAPI.getAutoSpawnName(autoSpawn)); @@ -86,7 +86,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); @@ -97,13 +97,13 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); ClickType clickType = event.getClick(); int amountToModifyBy; - if(clickType.name().contains("RIGHT")) { + if (clickType.name().contains("RIGHT")) { amountToModifyBy = -1; } else { amountToModifyBy = +1; @@ -112,7 +112,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); ClickType clickType = event.getClick(); int amountToModifyBy; - if(clickType.name().contains("RIGHT")) { + if (clickType.name().contains("RIGHT")) { amountToModifyBy = -1; } else { amountToModifyBy = +1; @@ -136,7 +136,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); @@ -156,7 +156,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); @@ -166,7 +166,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler { private ClickAction getIntervalSystem(AutoSpawn autoSpawn) { return event -> { - if(!autoSpawn.isEditing()) { + if (!autoSpawn.isEditing()) { Message.Boss_AutoSpawn_MustToggleEditing.msg(event.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java index a8cc81f..ee8ee5b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/MainAutoSpawnEditorPanel.java @@ -46,7 +46,7 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler { public void openFor(Player player, AutoSpawn autoSpawn) { Map replaceMap = new HashMap<>(); String type = ObjectUtils.getValue(autoSpawn.getType(), "INTERVAL"); - String editing = ""+ObjectUtils.getValue(autoSpawn.isEditing(), false); + String editing = "" + ObjectUtils.getValue(autoSpawn.isEditing(), false); String entities = StringUtils.get().appendList(autoSpawn.getEntities()); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); @@ -80,10 +80,10 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler { Player player = (Player) event.getWhoClicked(); boolean editing = autoSpawn.isEditing(); - if(!editing) { + if (!editing) { autoSpawn.setEditing(true); } else { - if(!autoSpawn.isCompleteEnoughToSpawn()) { + if (!autoSpawn.isCompleteEnoughToSpawn()) { Message.Boss_AutoSpawn_NotCompleteEnough.msg(player); return; } @@ -95,7 +95,7 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler { this.autoSpawnFileManager.save(); player.closeInventory(); - if(autoSpawn.isEditing()) { + if (autoSpawn.isEditing()) { this.autoSpawnManager.removeActiveAutoSpawnHolder(autoSpawn); } else { this.autoSpawnManager.addAndCreateActiveAutoSpawnHolder(autoSpawn); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java index 9e83a77..f362bef 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossListEditorPanel.java @@ -75,7 +75,7 @@ public abstract class BossListEditorPanel extends VariablePanelHandler panel.setOnClick(slot, event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java index 9fd5277..e0d164f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/BossShopEditorPanel.java @@ -46,7 +46,7 @@ public class BossShopEditorPanel extends VariablePanelHandler { PanelBuilderCounter counter = panelBuilder.getPanelBuilderCounter(); replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity)); - replaceMap.put("{buyable}", bossEntity.isBuyable()+""); + replaceMap.put("{buyable}", bossEntity.isBuyable() + ""); replaceMap.put("{price}", NumberUtils.get().formatDouble(ObjectUtils.getValue(bossEntity.getPrice(), 0.0))); panelBuilder.addReplaceData(replaceMap); @@ -55,7 +55,7 @@ public class BossShopEditorPanel extends VariablePanelHandler { counter.getSlotsWith("Buyable").forEach(slot -> panel.setOnClick(slot, getBuyableAction(bossEntity))); counter.getSlotsWith("Price").forEach(slot -> panel.setOnClick(slot, event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -78,7 +78,7 @@ public class BossShopEditorPanel extends VariablePanelHandler { public ClickAction getBuyableAction(BossEntity bossEntity) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java index c73faaa..405270f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsEditorPanel.java @@ -59,7 +59,7 @@ public class DropsEditorPanel extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTableMap, entryList, bossEntity); return true; @@ -103,14 +103,15 @@ public class DropsEditorPanel extends VariablePanelHandler { String dropTableName = bossEntity.getDrops().getDropTable(); panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= dropTableMap.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= dropTableMap.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); DropTable dropTable = dropTableMap.get(name); ItemStackHolder itemStackHolder; - if(dropTableName.equalsIgnoreCase(name)) { + if (dropTableName.equalsIgnoreCase(name)) { itemStackHolder = BossAPI.getStoredItemStack("DefaultSelectedDropTableItem"); } else { itemStackHolder = BossAPI.getStoredItemStack("DefaultDropTableMenuItem"); @@ -118,7 +119,7 @@ public class DropsEditorPanel extends VariablePanelHandler { ItemStack itemStack = this.itemStackConverter.from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } @@ -131,7 +132,7 @@ public class DropsEditorPanel extends VariablePanelHandler { ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Boss.Drops.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java index a427e50..90b2b59 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/DropsMainEditorPanel.java @@ -45,13 +45,13 @@ public class DropsMainEditorPanel extends VariablePanelHandler { String dropTable = bossEntity.getDrops().getDropTable(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(naturalDrops == null) naturalDrops = true; - if(naturalExp == null) naturalExp = true; - if(dropTable == null) dropTable = "N/A"; + if (naturalDrops == null) naturalDrops = true; + if (naturalExp == null) naturalExp = true; + if (dropTable == null) dropTable = "N/A"; replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity)); - replaceMap.put("{naturalDrops}", ""+naturalDrops); - replaceMap.put("{naturalExp}", ""+naturalExp); + replaceMap.put("{naturalDrops}", "" + naturalDrops); + replaceMap.put("{naturalExp}", "" + naturalExp); replaceMap.put("{dropTable}", dropTable); panelBuilder.addReplaceData(replaceMap); @@ -81,7 +81,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler { private ClickAction getNaturalDropsAction(BossEntity bossEntity, Boolean current) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -95,7 +95,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler { private ClickAction getNaturalExpAction(BossEntity bossEntity, Boolean current) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java index 5c5c270..44377b2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/MainBossEditPanel.java @@ -88,12 +88,12 @@ public class MainBossEditPanel extends VariablePanelHandler { return event -> { Player player = (Player) event.getWhoClicked(); - if(bossEntity.isCompleteEnoughToSpawn()) { + if (bossEntity.isCompleteEnoughToSpawn()) { bossEntity.setEditing(!bossEntity.isEditing()); this.bossesFileManager.save(); Message.Boss_Edit_Toggled.msg(player, BossAPI.getBossEntityName(bossEntity), bossEntity.getEditingValue()); - if(bossEntity.isEditing()) { + if (bossEntity.isEditing()) { this.bossEntityManager.killAllHolders(bossEntity); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java index 3c77897..fc4409d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillListEditorPanel.java @@ -51,7 +51,7 @@ public class SkillListEditorPanel extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentSkills, entryList, bossEntity); return true; @@ -86,8 +86,9 @@ public class SkillListEditorPanel extends VariablePanelHandler { private void loadPage(Panel panel, int requestedPage, Map currentSkills, List entryList, BossEntity bossEntity) { panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= currentSkills.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= currentSkills.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); Skill skill = currentSkills.get(name); @@ -102,7 +103,7 @@ public class SkillListEditorPanel extends VariablePanelHandler { replaceMap.put("{customMessage}", StringUtils.get().formatString(skill.getCustomMessage())); replaceMap.put("{radius}", NumberUtils.get().formatDouble(skill.getRadius())); - if(bossEntity.getSkills().getSkills().contains(name)) { + if (bossEntity.getSkills().getSkills().contains(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Skills.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Skills.name"), replaceMap); @@ -111,14 +112,14 @@ public class SkillListEditorPanel extends VariablePanelHandler { ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Boss.Skills.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, e -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked()); return; } List currentSkillList = bossEntity.getSkills().getSkills(); - if(currentSkillList.contains(name)) { + if (currentSkillList.contains(name)) { currentSkillList.remove(name); } else { currentSkillList.add(name); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java index ad71084..5847bac 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SkillMainEditorPanel.java @@ -45,7 +45,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler { Double chance = bossEntity.getSkills().getOverallChance(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(chance == null) chance = 0.0; + if (chance == null) chance = 0.0; replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity)); replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance)); @@ -74,7 +74,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler { private ClickAction getOverallChanceAction(BossEntity bossEntity) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -82,28 +82,28 @@ public class SkillMainEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); double chanceToModifyBy = 0.0; - if(clickType == ClickType.LEFT) { + if (clickType == ClickType.LEFT) { chanceToModifyBy = 1.0; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { chanceToModifyBy = 0.1; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { chanceToModifyBy = -1.0; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { chanceToModifyBy = -0.1; } - String modifyValue = chanceToModifyBy > 0.0? "increased" : "decreased"; + String modifyValue = chanceToModifyBy > 0.0 ? "increased" : "decreased"; Double currentChance = bossEntity.getSkills().getOverallChance(); - if(currentChance == null) currentChance = 0.0; + if (currentChance == null) currentChance = 0.0; double newChance = currentChance + chanceToModifyBy; - if(newChance < 0.0) { + if (newChance < 0.0) { newChance = 0.0; } - if(newChance > 100.0) { + if (newChance > 100.0) { newChance = 100.0; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java index 63e7d01..5125803 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/SpawnItemEditorPanel.java @@ -53,7 +53,7 @@ public class SpawnItemEditorPanel extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, itemStackHolderMap, entryList, bossEntity); return true; @@ -77,7 +77,7 @@ public class SpawnItemEditorPanel extends VariablePanelHandler { ServerUtils.get().runTaskAsync(() -> { panelBuilderCounter.getSlotsWith("AddNew").forEach(slot -> panel.setOnClick(slot, event -> openAddItemsPanel(player, bossEntity))); panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -110,18 +110,19 @@ public class SpawnItemEditorPanel extends VariablePanelHandler { String current = ObjectUtils.getValue(bossEntity.getSpawnItem(), ""); panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= filteredMap.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= filteredMap.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); ItemStackHolder itemStackHolder = filteredMap.get(name); ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } - if(name.equalsIgnoreCase(current)) { + if (name.equalsIgnoreCase(current)) { Map replaceMap = new HashMap<>(); replaceMap.put("{name}", ItemStackUtils.getName(itemStack)); @@ -130,7 +131,7 @@ public class SpawnItemEditorPanel extends VariablePanelHandler { } panel.setItem(realisticSlot, itemStack, e -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java index 13adde5..e8395fe 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/StatisticMainEditorPanel.java @@ -49,8 +49,8 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -101,7 +101,7 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -109,24 +109,24 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler 0.0? "increased" : "decreased"; + String modifyValue = healthToModifyBy > 0.0 ? "increased" : "decreased"; Double currentChance = entityStatsElement.getMainStats().getHealth(); - if(currentChance == null) currentChance = 0.0; + if (currentChance == null) currentChance = 0.0; double newHealth = currentChance + healthToModifyBy; - if(newHealth < 0.0) { + if (newHealth < 0.0) { newHealth = 1.0; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/TargetingEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/TargetingEditorPanel.java index c00bfcd..08f2e31 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/TargetingEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/TargetingEditorPanel.java @@ -58,8 +58,8 @@ public class TargetingEditorPanel extends VariablePanelHandler { ItemStack currentStack = panel.getInventory().getItem(slot); ItemStack newItemStack = getItemStack(current, (String) returnValue, currentStack); - panel.setItem(slot, newItemStack , event -> { - if(!bossEntity.isEditing()) { + panel.setItem(slot, newItemStack, event -> { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -84,7 +84,7 @@ public class TargetingEditorPanel extends VariablePanelHandler { ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(this.itemsFileManager.getItemStackHolder("DefaultSelectedTargetingItem")); ItemStack cloneStack = currentItemStack.clone(); - if(thisType.equalsIgnoreCase(current)) { + if (thisType.equalsIgnoreCase(current)) { cloneStack.setType(itemStack.getType()); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java index 019e41f..724faf9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnDeathCommandEditor.java @@ -50,7 +50,7 @@ public class OnDeathCommandEditor extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentCommands, entryList, bossEntity); return true; @@ -85,8 +85,9 @@ public class OnDeathCommandEditor extends VariablePanelHandler { private void loadPage(Panel panel, int page, Map> currentCommands, List entryList, BossEntity bossEntity) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); List commands = currentCommands.get(name); @@ -97,7 +98,7 @@ public class OnDeathCommandEditor extends VariablePanelHandler { replaceMap.put("{name}", name); - if(bossEntity.getCommands().getOnDeath() != null && bossEntity.getCommands().getOnDeath().equalsIgnoreCase(name)) { + if (bossEntity.getCommands().getOnDeath() != null && bossEntity.getCommands().getOnDeath().equalsIgnoreCase(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap); @@ -107,9 +108,9 @@ public class OnDeathCommandEditor extends VariablePanelHandler { List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); - for(String s : presetLore) { - if(s.contains("{commands}")) { - for(String command : commands) { + for (String s : presetLore) { + if (s.contains("{commands}")) { + for (String command : commands) { newLore.add(StringUtils.get().translateColor("&7" + command)); } } else { @@ -121,7 +122,7 @@ public class OnDeathCommandEditor extends VariablePanelHandler { itemStack.setItemMeta(itemMeta); panel.setItem(realisticSlot, itemStack, e -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java index 0319c63..de924b5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/commands/OnSpawnCommandEditor.java @@ -50,7 +50,7 @@ public class OnSpawnCommandEditor extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentCommands, entryList, bossEntity); return true; @@ -85,8 +85,9 @@ public class OnSpawnCommandEditor extends VariablePanelHandler { private void loadPage(Panel panel, int page, Map> currentCommands, List entryList, BossEntity bossEntity) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); List commands = currentCommands.get(name); @@ -97,7 +98,7 @@ public class OnSpawnCommandEditor extends VariablePanelHandler { replaceMap.put("{name}", name); - if(bossEntity.getCommands().getOnSpawn() != null && bossEntity.getCommands().getOnSpawn().equalsIgnoreCase(name)) { + if (bossEntity.getCommands().getOnSpawn() != null && bossEntity.getCommands().getOnSpawn().equalsIgnoreCase(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap); @@ -107,9 +108,9 @@ public class OnSpawnCommandEditor extends VariablePanelHandler { List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); - for(String s : presetLore) { - if(s.contains("{commands}")) { - for(String command : commands) { + for (String s : presetLore) { + if (s.contains("{commands}")) { + for (String command : commands) { newLore.add(StringUtils.get().translateColor("&7" + command)); } } else { @@ -121,7 +122,7 @@ public class OnSpawnCommandEditor extends VariablePanelHandler { itemStack.setItemMeta(itemMeta); panel.setItem(realisticSlot, itemStack, e -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java index 78dd427..8dcd465 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/BootsEditorPanel.java @@ -31,7 +31,7 @@ public class BootsEditorPanel extends ItemStackSubListPanelHandler { originalMap.forEach((string, holder) -> { ItemStack itemStack = this.itemStackConverter.from(holder); - if(itemStack.getType().name().contains("BOOTS")) { + if (itemStack.getType().name().contains("BOOTS")) { newMap.put(string, holder); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java index 76c15b7..f3469d4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/ChestplateEditorPanel.java @@ -31,7 +31,7 @@ public class ChestplateEditorPanel extends ItemStackSubListPanelHandler { originalMap.forEach((string, holder) -> { ItemStack itemStack = this.itemStackConverter.from(holder); - if(itemStack.getType().name().contains("CHESTPLATE")) { + if (itemStack.getType().name().contains("CHESTPLATE")) { newMap.put(string, holder); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java index 46f2cf2..f456d1d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/HelmetEditorPanel.java @@ -31,7 +31,7 @@ public class HelmetEditorPanel extends ItemStackSubListPanelHandler { originalMap.forEach((string, holder) -> { ItemStack itemStack = this.itemStackConverter.from(holder); - if(itemStack.getType().name().contains("HELMET") || itemStack.getType().isBlock()) { + if (itemStack.getType().name().contains("HELMET") || itemStack.getType().isBlock()) { newMap.put(string, holder); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java index df8ec95..c32a823 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/equipment/LeggingsEditorPanel.java @@ -31,7 +31,7 @@ public class LeggingsEditorPanel extends ItemStackSubListPanelHandler { originalMap.forEach((string, holder) -> { ItemStack itemStack = this.itemStackConverter.from(holder); - if(itemStack.getType().name().contains("LEGGINGS")) { + if (itemStack.getType().name().contains("LEGGINGS")) { newMap.put(string, holder); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java index b8374e9..12f20fc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/DeathTextEditorPanel.java @@ -50,10 +50,10 @@ public class DeathTextEditorPanel extends VariablePanelHandler { String positionMessage = onDeathMessageElement.getPositionMessage(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(radius == null) radius = 0; - if(onlyShow == null) onlyShow = 3; - if(mainMessage == null) mainMessage = "N/A"; - if(positionMessage == null) positionMessage = "N/A"; + if (radius == null) radius = 0; + if (onlyShow == null) onlyShow = 3; + if (mainMessage == null) mainMessage = "N/A"; + if (positionMessage == null) positionMessage = "N/A"; replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity)); replaceMap.put("{radius}", NumberUtils.get().formatDouble(radius)); @@ -86,7 +86,7 @@ public class DeathTextEditorPanel extends VariablePanelHandler { private ClickAction getRadiusAction(BossEntity bossEntity) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -94,24 +94,24 @@ public class DeathTextEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); int radiusToModifyBy = 0; - if(clickType == ClickType.LEFT) { + if (clickType == ClickType.LEFT) { radiusToModifyBy = 1; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { radiusToModifyBy = 10; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { radiusToModifyBy = -1; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { radiusToModifyBy = -10; } - String modifyValue = radiusToModifyBy > 0? "increased" : "decreased"; + String modifyValue = radiusToModifyBy > 0 ? "increased" : "decreased"; Integer currentRadius = bossEntity.getMessages().getOnDeath().getRadius(); - if(currentRadius == null) currentRadius = 0; + if (currentRadius == null) currentRadius = 0; int newRadius = currentRadius + radiusToModifyBy; - if(newRadius < -1) { + if (newRadius < -1) { newRadius = -1; } @@ -124,7 +124,7 @@ public class DeathTextEditorPanel extends VariablePanelHandler { private ClickAction getOnlyShowAction(BossEntity bossEntity) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -132,20 +132,20 @@ public class DeathTextEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); int amountToModifyBy = 0; - if(clickType.name().contains("LEFT")) { + if (clickType.name().contains("LEFT")) { amountToModifyBy = 1; - } else if(clickType.name().contains("RIGHT")) { + } else if (clickType.name().contains("RIGHT")) { amountToModifyBy = -1; } - String modifyValue = amountToModifyBy > 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; Integer currentAmount = bossEntity.getMessages().getOnDeath().getOnlyShow(); - if(currentAmount == null) currentAmount = 3; + if (currentAmount == null) currentAmount = 3; int newAmount = currentAmount + amountToModifyBy; - if(newAmount < -1) { + if (newAmount < -1) { newAmount = -1; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java index 35d8760..988b1df 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/SpawnTextEditorPanel.java @@ -46,8 +46,8 @@ public class SpawnTextEditorPanel extends VariablePanelHandler { String message = bossEntity.getMessages().getOnSpawn().getMessage(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(radius == null) radius = 0; - if(message == null) message = "N/A"; + if (radius == null) radius = 0; + if (message == null) message = "N/A"; replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity)); replaceMap.put("{radius}", NumberUtils.get().formatDouble(radius)); @@ -77,7 +77,7 @@ public class SpawnTextEditorPanel extends VariablePanelHandler { private ClickAction getRadiusAction(BossEntity bossEntity) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -85,24 +85,24 @@ public class SpawnTextEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); int radiusToModifyBy = 0; - if(clickType == ClickType.LEFT) { + if (clickType == ClickType.LEFT) { radiusToModifyBy = 1; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { radiusToModifyBy = 10; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { radiusToModifyBy = -1; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { radiusToModifyBy = -10; } - String modifyValue = radiusToModifyBy > 0? "increased" : "decreased"; + String modifyValue = radiusToModifyBy > 0 ? "increased" : "decreased"; Integer currentRadius = bossEntity.getMessages().getOnSpawn().getRadius(); - if(currentRadius == null) currentRadius = 0; + if (currentRadius == null) currentRadius = 0; int newRadius = currentRadius + radiusToModifyBy; - if(newRadius < -1) { + if (newRadius < -1) { newRadius = -1; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java index ac364a1..8378c26 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/bosses/text/TauntTextEditorPanel.java @@ -52,9 +52,9 @@ public class TauntTextEditorPanel extends VariablePanelHandler { List taunts = tauntElement.getTaunts(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(radius == null) radius = 100; - if(delay == null) delay = 60; - if(taunts == null || taunts.isEmpty()) taunts = Arrays.asList("N/A"); + if (radius == null) radius = 100; + if (delay == null) delay = 60; + if (taunts == null || taunts.isEmpty()) taunts = Arrays.asList("N/A"); replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity)); replaceMap.put("{radius}", NumberUtils.get().formatDouble(radius)); @@ -85,7 +85,7 @@ public class TauntTextEditorPanel extends VariablePanelHandler { private ClickAction getRadiusAction(BossEntity bossEntity) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -93,24 +93,24 @@ public class TauntTextEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); int radiusToModifyBy = 0; - if(clickType == ClickType.LEFT) { + if (clickType == ClickType.LEFT) { radiusToModifyBy = 1; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { radiusToModifyBy = 10; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { radiusToModifyBy = -1; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { radiusToModifyBy = -10; } - String modifyValue = radiusToModifyBy > 0? "increased" : "decreased"; + String modifyValue = radiusToModifyBy > 0 ? "increased" : "decreased"; Integer currentRadius = bossEntity.getMessages().getTaunts().getRadius(); - if(currentRadius == null) currentRadius = 0; + if (currentRadius == null) currentRadius = 0; int newRadius = currentRadius + radiusToModifyBy; - if(newRadius < -1) { + if (newRadius < -1) { newRadius = -1; } @@ -123,7 +123,7 @@ public class TauntTextEditorPanel extends VariablePanelHandler { private ClickAction getDelayAction(BossEntity bossEntity) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -131,24 +131,24 @@ public class TauntTextEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); int delayToModifyBy = 0; - if(clickType == ClickType.LEFT) { + if (clickType == ClickType.LEFT) { delayToModifyBy = 1; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { delayToModifyBy = 10; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { delayToModifyBy = -1; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { delayToModifyBy = -10; } - String modifyValue = delayToModifyBy > 0? "increased" : "decreased"; + String modifyValue = delayToModifyBy > 0 ? "increased" : "decreased"; Integer currentDelay = bossEntity.getMessages().getTaunts().getDelay(); - if(currentDelay == null) currentDelay = 0; + if (currentDelay == null) currentDelay = 0; int newDelay = currentDelay + delayToModifyBy; - if(newDelay < -1) { + if (newDelay < -1) { newDelay = -1; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java index 3316624..78e16ce 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/MainDropTableEditorPanel.java @@ -63,11 +63,11 @@ public class MainDropTableEditorPanel extends VariablePanelHandler { String dropTableType = dropTable.getDropType(); Player player = (Player) event.getWhoClicked(); - if(dropTableType.equalsIgnoreCase("SPRAY")) { + if (dropTableType.equalsIgnoreCase("SPRAY")) { this.bossPanelManager.getSprayDropTableMainEditMenu().openFor(player, dropTable, dropTable.getSprayTableData()); - } else if(dropTableType.equalsIgnoreCase("GIVE")) { + } else if (dropTableType.equalsIgnoreCase("GIVE")) { this.bossPanelManager.getGiveRewardPositionListMenu().openFor(player, dropTable, dropTable.getGiveTableData()); - } else if(dropTableType.equalsIgnoreCase("DROP")) { + } else if (dropTableType.equalsIgnoreCase("DROP")) { this.bossPanelManager.getDropDropTableMainEditMenu().openFor(player, dropTable, dropTable.getDropTableData()); } else { Debug.FAILED_TO_FIND_DROP_TABLE_TYPE.debug(dropTableType); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java index 577a80d..442e009 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableNewRewardEditorPanel.java @@ -45,7 +45,7 @@ public abstract class DropTableNewRewardEditorPanel extends SubVari int maxPage = panel.getMaxPage(filteredKeys); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTable, subVariable, filteredKeys, itemStacks); return true; @@ -70,8 +70,9 @@ public abstract class DropTableNewRewardEditorPanel extends SubVari private void loadPage(Panel panel, int page, DropTable dropTable, SubVariable subVariable, List filteredKeys, Map itemStacks) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= filteredKeys.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{}); + if (slot >= filteredKeys.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = filteredKeys.get(slot); ItemStackHolder itemStackHolder = itemStacks.get(name); @@ -94,7 +95,7 @@ public abstract class DropTableNewRewardEditorPanel extends SubVari List filteredList = new ArrayList<>(); itemStacks.keySet().forEach(string -> { - if(currentKeys.contains(string)) return; + if (currentKeys.contains(string)) return; filteredList.add(string); }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java index c72691e..9cdb952 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardMainEditorPanel.java @@ -69,26 +69,26 @@ public abstract class DropTableRewardMainEditorPanel extends SubSub ClickType clickType = event.getClick(); double amountToModifyBy; - if(clickType == ClickType.SHIFT_LEFT) { + if (clickType == ClickType.SHIFT_LEFT) { amountToModifyBy = 0.1; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { amountToModifyBy = -1.0; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { amountToModifyBy = -0.1; } else { amountToModifyBy = 1.0; } - String modifyValue = amountToModifyBy > 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; Map rewards = getRewards(subVariable); double currentValue = rewards.getOrDefault(name, 50.0); double newValue = currentValue + amountToModifyBy; - if(newValue < 0) { + if (newValue < 0) { newValue = 0; } - if(newValue > 100) { + if (newValue > 100) { newValue = 100; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java index c9af3d2..f5e5f28 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/rewards/DropTableRewardsListEditorPanel.java @@ -47,7 +47,7 @@ public abstract class DropTableRewardsListEditorPanel extends SubVa int maxPage = panel.getMaxPage(keyList); panel.setOnPageChange((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTable, subVariable, rewardMap, keyList); return true; @@ -83,14 +83,15 @@ public abstract class DropTableRewardsListEditorPanel extends SubVa private void loadPage(Panel panel, int page, DropTable dropTable, SubVariable subVariable, Map rewardMap, List keyList) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= keyList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= keyList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = keyList.get(slot); Double chance = rewardMap.get(name); Map replaceMap = new HashMap<>(); - if(chance == null) chance = 100.0; + if (chance == null) chance = 100.0; replaceMap.put("{itemName}", name); replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance)); @@ -103,7 +104,7 @@ public abstract class DropTableRewardsListEditorPanel extends SubVa ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(itemStackHolder); - if(itemStack == null || itemStack.getType() == Material.AIR) return; + if (itemStack == null || itemStack.getType() == Material.AIR) return; ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.DropTable.RewardList.name"), replaceMap); ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.DropTable.RewardList.lore"), replaceMap); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java index c36737a..20d6397 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/drop/DropDropTableMainEditorPanel.java @@ -48,11 +48,11 @@ public class DropDropTableMainEditorPanel extends SubVariablePanelHandler { Boolean currentValue = dropTableElement.getRandomDrops(); - if(currentValue == null) currentValue = false; + if (currentValue == null) currentValue = false; boolean newValue = !currentValue; @@ -94,24 +94,24 @@ public class DropDropTableMainEditorPanel extends SubVariablePanelHandler 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; Integer currentAmount = dropTableElement.getDropMaxDrops(); - if(currentAmount == null) currentAmount = -1; + if (currentAmount == null) currentAmount = -1; int newAmount = currentAmount + amountToModifyBy; - if(newAmount < -1) { + if (newAmount < -1) { newAmount = -1; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java index 88f9b90..b27e0d6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardMainEditPanel.java @@ -53,13 +53,13 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; double currentAmount = ObjectUtils.getValue(giveTableSubElement.getRequiredPercentage(), 0.0); double newAmount = currentAmount + amountToModifyBy; - if(newAmount < 0) { + if (newAmount < 0) { newAmount = 0; } - if(newAmount > 100) { + if (newAmount > 100) { newAmount = 100; } @@ -131,22 +131,22 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; int currentAmount = ObjectUtils.getValue(giveTableSubElement.getMaxCommands(), 3); int newAmount = currentAmount + amountToModifyBy; - if(newAmount < -1) { + if (newAmount < -1) { newAmount = -1; } @@ -163,22 +163,22 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; int currentAmount = ObjectUtils.getValue(giveTableSubElement.getMaxDrops(), 3); int newAmount = currentAmount + amountToModifyBy; - if(newAmount < -1) { + if (newAmount < -1) { newAmount = -1; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java index f20024d..43b2e76 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardPositionListPanel.java @@ -51,7 +51,7 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTable, giveTableElement, keys, rewardSections); return true; @@ -87,8 +87,9 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler keys, Map> rewards) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= keys.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{}); + if (slot >= keys.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String position = keys.get(slot); Map innerRewards = rewards.get(position); @@ -105,7 +106,7 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler { ClickType clickType = event.getClick(); - if(clickType == ClickType.SHIFT_RIGHT) { + if (clickType == ClickType.SHIFT_RIGHT) { rewards.remove(position); giveTableElement.setGiveRewards(rewards); saveDropTable((Player) event.getWhoClicked(), dropTable, giveTableElement, BossAPI.convertObjectToJsonObject(giveTableElement)); @@ -122,9 +123,9 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler> rewards = giveTableElement.getGiveRewards(); List keys = new ArrayList<>(giveTableElement.getGiveRewards().keySet()); int nextAvailable = NumberUtils.get().getNextAvailablePosition(keys); - String nextKey = ""+nextAvailable; + String nextKey = "" + nextAvailable; - if(rewards.containsKey(nextKey)) { + if (rewards.containsKey(nextKey)) { Debug.FAILED_TO_CREATE_NEWPOSITION.debug(nextKey, BossAPI.getDropTableName(dropTable)); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java index 46bb602..43d528e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/GiveRewardRewardsListPanel.java @@ -77,7 +77,7 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTable, giveTableElement, key, keys, rewardSections); return true; @@ -91,8 +91,9 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler { - if(slot >= keys.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{}); + if (slot >= keys.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String rewardSectionPosition = keys.get(slot); GiveTableSubElement giveTableSubElement = rewards.get(rewardSectionPosition); @@ -112,10 +113,10 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler { ClickType clickType = event.getClick(); - if(clickType == ClickType.SHIFT_RIGHT) { + if (clickType == ClickType.SHIFT_RIGHT) { rewards.remove(rewardSectionPosition); rewardSections.put(key, rewards); giveTableElement.setGiveRewards(rewardSections); @@ -144,9 +145,9 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler rewards = rewardSections.get(key); List keys = new ArrayList<>(rewards.keySet()); int nextAvailable = NumberUtils.get().getNextAvailablePosition(keys); - String nextKey = ""+nextAvailable; + String nextKey = "" + nextAvailable; - if(rewards.containsKey(nextKey)) { + if (rewards.containsKey(nextKey)) { Debug.FAILED_TO_CREATE_NEWPOSITION.debug(nextKey, BossAPI.getDropTableName(dropTable)); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java index 4b089b4..77b3fd1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandNewRewardPanel.java @@ -57,7 +57,7 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTable, giveRewardEditHandler, filteredKeys, commands); return true; @@ -82,8 +82,9 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler filteredKeys, Map> commands) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= filteredKeys.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{}); + if (slot >= filteredKeys.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = filteredKeys.get(slot); List innerCommands = commands.get(name); @@ -100,9 +101,9 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); - for(String s : presetLore) { - if(s.contains("{commands}")) { - for(String command : innerCommands) { + for (String s : presetLore) { + if (s.contains("{commands}")) { + for (String command : innerCommands) { newLore.add(StringUtils.get().translateColor("&7" + command)); } } else { @@ -127,7 +128,6 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler getCurrentKeys(GiveRewardEditHandler giveRewardEditHandler) { return new ArrayList<>(giveRewardEditHandler.getGiveTableSubElement().getCommands().keySet()); } @@ -136,7 +136,7 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler filteredList = new ArrayList<>(); commands.keySet().forEach(string -> { - if(currentKeys.contains(string)) return; + if (currentKeys.contains(string)) return; filteredList.add(string); }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java index de9aa65..9ca49df 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardListPanel.java @@ -47,7 +47,7 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, dropTable, giveRewardEditHandler, rewardMap, keyList); return true; @@ -68,7 +68,7 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler{ + ServerUtils.get().runTaskAsync(() -> { panelBuilderCounter.getSlotsWith("NewReward").forEach(slot -> panel.setOnClick(slot, event -> this.bossPanelManager.getGiveCommandNewRewardPanel().openFor((Player) event.getWhoClicked(), dropTable, giveRewardEditHandler))); fillPanel(panel, dropTable, giveRewardEditHandler); }); @@ -83,14 +83,15 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler rewardMap, List keyList) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= keyList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= keyList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = keyList.get(slot); Double chance = rewardMap.get(name); Map replaceMap = new HashMap<>(); - if(chance == null) chance = 100.0; + if (chance == null) chance = 100.0; replaceMap.put("{commandName}", name); replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java index c6967d5..c1f163b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/commands/GiveCommandRewardMainEditPanel.java @@ -72,26 +72,26 @@ public class GiveCommandRewardMainEditPanel extends SubSubVariablePanelHandler 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; Map rewards = giveRewardEditHandler.getGiveTableSubElement().getCommands(); double currentValue = rewards.getOrDefault(name, 50.0); double newValue = currentValue + amountToModifyBy; - if(newValue < 0) { + if (newValue < 0) { newValue = 0; } - if(newValue > 100) { + if (newValue > 100) { newValue = 100; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java index 6f2d9e1..a31f52a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/spray/SprayDropTableMainEditorPanel.java @@ -49,12 +49,12 @@ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler { Boolean currentValue = sprayTableElement.getRandomSprayDrops(); - if(currentValue == null) currentValue = false; + if (currentValue == null) currentValue = false; boolean newValue = !currentValue; @@ -99,24 +99,24 @@ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; Integer currentAmount = sprayTableElement.getSprayMaxDistance(); - if(currentAmount == null) currentAmount = 100; + if (currentAmount == null) currentAmount = 100; int newAmount = currentAmount + amountToModifyBy; - if(newAmount < 0) { + if (newAmount < 0) { newAmount = 0; } @@ -132,24 +132,24 @@ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler 0? "increased" : "decreased"; + String modifyValue = amountToModifyBy > 0 ? "increased" : "decreased"; Integer currentAmount = sprayTableElement.getSprayMaxDrops(); - if(currentAmount == null) currentAmount = -1; + if (currentAmount == null) currentAmount = -1; int newAmount = currentAmount + amountToModifyBy; - if(newAmount < -1) { + if (newAmount < -1) { newAmount = -1; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java index fac55f4..1712c3d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ItemStackSubListPanelHandler.java @@ -65,7 +65,7 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, filteredMap, entryList, bossEntity, entityStatsElement); return true; @@ -94,7 +94,7 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl ServerUtils.get().runTaskAsync(() -> { panelBuilderCounter.getSlotsWith("AddNew").forEach(slot -> panel.setOnClick(slot, event -> openAddItemsPanel(player, bossEntity, entityStatsElement))); panelBuilderCounter.getSlotsWith("Remove").forEach(slot -> panel.setOnClick(slot, event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -127,18 +127,19 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl String current = getCurrent(entityStatsElement); panel.loadPage(requestedPage, (slot, realisticSlot) -> { - if(slot >= filteredMap.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= filteredMap.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); ItemStackHolder itemStackHolder = filteredMap.get(name); ItemStack itemStack = this.itemStackConverter.from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } - if(name.equalsIgnoreCase(current)) { + if (name.equalsIgnoreCase(current)) { Map replaceMap = new HashMap<>(); replaceMap.put("{name}", ItemStackUtils.getName(itemStack)); @@ -147,7 +148,7 @@ public abstract class ItemStackSubListPanelHandler extends SubVariablePanelHandl } panel.setItem(realisticSlot, itemStack, e -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java index 15cc136..bb514ee 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListCommandListEditor.java @@ -57,7 +57,7 @@ public abstract class ListCommandListEditor extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentTexts, entryList, object); return true; @@ -94,8 +94,9 @@ public abstract class ListCommandListEditor extends VariablePanelHandler { List current = getCurrent(object); panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); List messages = currentMessages.get(name); @@ -106,7 +107,7 @@ public abstract class ListCommandListEditor extends VariablePanelHandler { replaceMap.put("{name}", name); - if(current.contains(name)) { + if (current.contains(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Command.name"), replaceMap); @@ -116,9 +117,9 @@ public abstract class ListCommandListEditor extends VariablePanelHandler { List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List newLore = new ArrayList<>(); - for(String s : presetLore) { - if(s.contains("{commands}")) { - for(String message : messages) { + for (String s : presetLore) { + if (s.contains("{commands}")) { + for (String message : messages) { List split = StringUtils.get().splitString(message, 45); split.forEach(string -> newLore.add(StringUtils.get().translateColor("&7") + string)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java index 556d65a..1d012eb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/ListMessageListEditor.java @@ -57,7 +57,7 @@ public abstract class ListMessageListEditor extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentTexts, entryList, object); return true; @@ -94,8 +94,9 @@ public abstract class ListMessageListEditor extends VariablePanelHandler { List current = getCurrent(object); panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); List messages = currentMessages.get(name); @@ -106,7 +107,7 @@ public abstract class ListMessageListEditor extends VariablePanelHandler { replaceMap.put("{name}", name); - if(current.contains(name)) { + if (current.contains(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.name"), replaceMap); @@ -116,9 +117,9 @@ public abstract class ListMessageListEditor extends VariablePanelHandler { List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Text.lore"); List newLore = new ArrayList<>(); - for(String s : presetLore) { - if(s.contains("{message}")) { - for(String message : messages) { + for (String s : presetLore) { + if (s.contains("{message}")) { + for (String message : messages) { List split = StringUtils.get().splitString(message, 45); split.forEach(string -> newLore.add(StringUtils.get().translateColor("&7") + string)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java index 1154584..a06330c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/handlers/SingleMessageListEditor.java @@ -57,7 +57,7 @@ public abstract class SingleMessageListEditor extends VariablePanelHandler int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentTexts, entryList, object); return true; @@ -93,8 +93,9 @@ public abstract class SingleMessageListEditor extends VariablePanelHandler String current = getCurrent(object); panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); List messages = currentMessages.get(name); @@ -105,7 +106,7 @@ public abstract class SingleMessageListEditor extends VariablePanelHandler replaceMap.put("{name}", name); - if(current != null && current.equalsIgnoreCase(name)) { + if (current != null && current.equalsIgnoreCase(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Text.name"), replaceMap); @@ -115,9 +116,9 @@ public abstract class SingleMessageListEditor extends VariablePanelHandler List presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Text.lore"); List newLore = new ArrayList<>(); - for(String s : presetLore) { - if(s.contains("{message}")) { - for(String message : messages) { + for (String s : presetLore) { + if (s.contains("{message}")) { + for (String message : messages) { List split = StringUtils.get().splitString(message, 45); split.forEach(string -> newLore.add(StringUtils.get().translateColor("&7") + string)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java index 31b08b3..f592871 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/MainSkillEditorPanel.java @@ -51,11 +51,11 @@ public class MainSkillEditorPanel extends VariablePanelHandler { String type = skill.getType(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(customMessage == null || customMessage.equals("")) customMessage = "N/A"; - if(radius == null) radius = 100.0; - if(mode == null || mode.equals("")) mode = "N/A"; - if(displayName == null || displayName.equals("")) displayName = "N/A"; - if(type == null || type.equals("")) type = "N/A"; + if (customMessage == null || customMessage.equals("")) customMessage = "N/A"; + if (radius == null) radius = 100.0; + if (mode == null || mode.equals("")) mode = "N/A"; + if (displayName == null || displayName.equals("")) displayName = "N/A"; + if (type == null || type.equals("")) type = "N/A"; replaceMap.put("{name}", BossAPI.getSkillName(skill)); replaceMap.put("{customMessage}", customMessage); @@ -93,13 +93,13 @@ public class MainSkillEditorPanel extends VariablePanelHandler { String type = skill.getType(); Player player = (Player) event.getWhoClicked(); - if(type.equalsIgnoreCase("POTION")) { + if (type.equalsIgnoreCase("POTION")) { this.bossPanelManager.getPotionSkillEditorPanel().openFor(player, skill); - } else if(type.equalsIgnoreCase("GROUP")) { + } else if (type.equalsIgnoreCase("GROUP")) { this.bossPanelManager.getGroupSkillEditorPanel().openFor(player, skill); - } else if(type.equalsIgnoreCase("CUSTOM")) { + } else if (type.equalsIgnoreCase("CUSTOM")) { this.bossPanelManager.getCustomSkillEditorPanel().openFor(player, skill); - } else if(type.equalsIgnoreCase("COMMAND")) { + } else if (type.equalsIgnoreCase("COMMAND")) { this.bossPanelManager.getCommandSkillEditorPanel().openFor(player, skill); } }; @@ -121,7 +121,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); Player player = (Player) event.getWhoClicked(); - if(clickType.name().contains("RIGHT")) { + if (clickType.name().contains("RIGHT")) { skill.setCustomMessage(""); saveSkill(skill, player); } else { @@ -147,24 +147,24 @@ public class MainSkillEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); int radiusToModifyBy = 0; - if(clickType == ClickType.LEFT) { + if (clickType == ClickType.LEFT) { radiusToModifyBy = 1; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { radiusToModifyBy = 10; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { radiusToModifyBy = -1; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { radiusToModifyBy = -10; } - String modifyValue = radiusToModifyBy > 0? "increased" : "decreased"; + String modifyValue = radiusToModifyBy > 0 ? "increased" : "decreased"; Double currentRadius = skill.getRadius(); - if(currentRadius == null) currentRadius = 0.0; + if (currentRadius == null) currentRadius = 0.0; double newRadius = currentRadius + radiusToModifyBy; - if(newRadius < 0) { + if (newRadius < 0) { newRadius = 0; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java index 52e1b5a..9f200ca 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CommandSkillEditorPanel.java @@ -44,7 +44,7 @@ public class CommandSkillEditorPanel extends VariablePanelHandler { int maxPage = panel.getMaxPage(subCommandSkillElements); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, subCommandSkillElements, skill); return true; @@ -101,16 +101,17 @@ public class CommandSkillEditorPanel extends VariablePanelHandler { private void loadPage(Panel panel, int page, List subCommandSkillElements, Skill skill) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= subCommandSkillElements.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= subCommandSkillElements.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { SubCommandSkillElement subCommandSkillElement = subCommandSkillElements.get(slot); Map replaceMap = new HashMap<>(); Double chance = subCommandSkillElement.getChance(); List commands = subCommandSkillElement.getCommands(); - if(chance == null) chance = 100.0; - if(commands == null) commands = new ArrayList<>(); + if (chance == null) chance = 100.0; + if (commands == null) commands = new ArrayList<>(); replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance)); replaceMap.put("{commands}", StringUtils.get().appendList(commands)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java index 27e1663..ce9322b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/CustomSkillEditorPanel.java @@ -47,7 +47,7 @@ public class CustomSkillEditorPanel extends VariablePanelHandler { PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); CustomSkillElement customSkillElement = this.bossSkillManager.getCustomSkillElement(skill); Double multiplier = customSkillElement.getCustom().getMultiplier(); - String multiplierValue = multiplier == null? "N/A" : NumberUtils.get().formatDouble(multiplier); + String multiplierValue = multiplier == null ? "N/A" : NumberUtils.get().formatDouble(multiplier); replaceMap.put("{name}", BossAPI.getSkillName(skill)); replaceMap.put("{type}", customSkillElement.getCustom().getType()); @@ -82,13 +82,13 @@ public class CustomSkillEditorPanel extends VariablePanelHandler { ClickType clickType = event.getClick(); Double amountToModifyBy; - if(clickType == ClickType.SHIFT_LEFT) { + if (clickType == ClickType.SHIFT_LEFT) { amountToModifyBy = 0.1; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { amountToModifyBy = -1.0; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { amountToModifyBy = -0.1; - } else if(clickType == ClickType.MIDDLE) { + } else if (clickType == ClickType.MIDDLE) { amountToModifyBy = null; } else { amountToModifyBy = 1.0; @@ -98,12 +98,12 @@ public class CustomSkillEditorPanel extends VariablePanelHandler { String modifyValue; Double newAmount; - if(currentAmount == null) currentAmount = 0.0; + if (currentAmount == null) currentAmount = 0.0; - if(amountToModifyBy == null) { + if (amountToModifyBy == null) { modifyValue = "removed"; newAmount = null; - } else if(amountToModifyBy > 0.0) { + } else if (amountToModifyBy > 0.0) { modifyValue = "increased"; newAmount = currentAmount + amountToModifyBy; } else { @@ -111,8 +111,8 @@ public class CustomSkillEditorPanel extends VariablePanelHandler { newAmount = currentAmount + amountToModifyBy; } - if(newAmount != null) { - if(newAmount <= 0.0) { + if (newAmount != null) { + if (newAmount <= 0.0) { newAmount = null; modifyValue = "removed"; } @@ -124,7 +124,7 @@ public class CustomSkillEditorPanel extends VariablePanelHandler { skill.setCustomData(jsonObject); this.skillsFileManager.save(); - Message.Boss_Skills_SetMultiplier.msg(event.getWhoClicked(), modifyValue, NumberUtils.get().formatDouble((newAmount == null? 0.0 : newAmount))); + Message.Boss_Skills_SetMultiplier.msg(event.getWhoClicked(), modifyValue, NumberUtils.get().formatDouble((newAmount == null ? 0.0 : newAmount))); openFor((Player) event.getWhoClicked(), skill); }; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java index 4c2af52..d237077 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/GroupSkillEditorPanel.java @@ -50,7 +50,7 @@ public class GroupSkillEditorPanel extends VariablePanelHandler { int maxPage = panel.getMaxPage(entryList); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, skill, groupSkillElement, skillMap, entryList); return true; @@ -84,8 +84,9 @@ public class GroupSkillEditorPanel extends VariablePanelHandler { List currentSkills = groupSkillElement.getGroupedSkills(); panel.loadPage(page, ((slot, realisticSlot) -> { - if(slot >= skillMap.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= skillMap.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); Skill innerSkill = skillMap.get(name); @@ -98,11 +99,11 @@ public class GroupSkillEditorPanel extends VariablePanelHandler { ItemStack itemStack = this.itemStackConverter.from(this.itemsFileManager.getItemStackHolder("DefaultSkillMenuItem")); boolean isCurrent = currentSkills.contains(name); - if(customMessage == null || customMessage.equals("")) customMessage = "N/A"; - if(radius == null) radius = 100.0; - if(mode == null || mode.equals("")) mode = "N/A"; - if(displayName == null || displayName.equals("")) displayName = "N/A"; - if(type == null || type.equals("")) type = "N/A"; + if (customMessage == null || customMessage.equals("")) customMessage = "N/A"; + if (radius == null) radius = 100.0; + if (mode == null || mode.equals("")) mode = "N/A"; + if (displayName == null || displayName.equals("")) displayName = "N/A"; + if (type == null || type.equals("")) type = "N/A"; replaceMap.put("{name}", BossAPI.getSkillName(skill)); replaceMap.put("{customMessage}", customMessage); @@ -111,7 +112,7 @@ public class GroupSkillEditorPanel extends VariablePanelHandler { replaceMap.put("{displayName}", displayName); replaceMap.put("{type}", type); - if(isCurrent) { + if (isCurrent) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Group.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Group.name"), replaceMap); @@ -120,7 +121,7 @@ public class GroupSkillEditorPanel extends VariablePanelHandler { ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Skills.Group.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> { - if(isCurrent) { + if (isCurrent) { currentSkills.remove(name); } else { currentSkills.add(name); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java index 6bdd34f..fef437f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/PotionSkillEditorPanel.java @@ -19,7 +19,6 @@ import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; import com.songoda.epicbosses.utils.panel.builder.PanelBuilderCounter; import com.songoda.epicbosses.utils.potion.PotionEffectConverter; import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -61,7 +60,7 @@ public class PotionSkillEditorPanel extends VariablePanelHandler { int maxPage = panel.getMaxPage(potionEffectHolders); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, potionEffectHolders, potionSkillElement, skill); return true; @@ -101,8 +100,9 @@ public class PotionSkillEditorPanel extends VariablePanelHandler { private void loadPage(Panel panel, int page, List potionEffectHolders, PotionSkillElement potionSkillElement, Skill skill) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= potionEffectHolders.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= potionEffectHolders.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { PotionEffectHolder potionEffectHolder = potionEffectHolders.get(slot); PotionEffect potionEffect = this.potionEffectConverter.from(potionEffectHolder); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java index 5a19f20..e9392e2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/CommandListSkillEditorPanel.java @@ -56,7 +56,7 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, commands, currentCommands, entryList, skill, subCommandSkillElement); return true; @@ -88,8 +88,9 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler commands, Map> allCommands, List entryList, Skill skill, SubCommandSkillElement subCommandSkillElement) { panel.loadPage(page, (slot, realisticSlot) -> { - if(slot >= allCommands.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= allCommands.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); List boundCommands = allCommands.get(name); @@ -100,7 +101,7 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler presetLore = this.plugin.getDisplay().getStringList("Display.Skills.CommandList.lore"); List newLore = new ArrayList<>(); - for(String s : presetLore) { - if(s.contains("{commands}")) { - for(String command : boundCommands) { + for (String s : presetLore) { + if (s.contains("{commands}")) { + for (String command : boundCommands) { List split = StringUtils.get().splitString(command, 45); split.forEach(string -> newLore.add(StringUtils.get().translateColor("&7") + string)); @@ -127,7 +128,7 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler { - if(commands.contains(name)) { + if (commands.contains(name)) { commands.remove(name); } else { commands.add(name); @@ -140,8 +141,8 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler subCommandSkillElements = commandSkillElement.getCommands(); List newElements = new ArrayList<>(); - for(SubCommandSkillElement subElement : subCommandSkillElements) { - if(subElement.getName().equals(subCommandSkillElement.getName())) { + for (SubCommandSkillElement subElement : subCommandSkillElements) { + if (subElement.getName().equals(subCommandSkillElement.getName())) { newElements.add(subCommandSkillElement); } else { newElements.add(subElement); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java index 2a4e2bc..a92c0c6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/commands/ModifyCommandEditorPanel.java @@ -55,8 +55,8 @@ public class ModifyCommandEditorPanel extends SubVariablePanelHandler(); - if(chance == null) chance = 100.0; + if (commands == null) commands = new ArrayList<>(); + if (chance == null) chance = 100.0; replaceMap.put("{commands}", StringUtils.get().appendList(commands)); replaceMap.put("{chance}", NumberUtils.get().formatDouble(chance)); @@ -84,28 +84,28 @@ public class ModifyCommandEditorPanel extends SubVariablePanelHandler 0.0? "increased" : "decreased"; + String modifyValue = amountToModify > 0.0 ? "increased" : "decreased"; Double currentValue = subCommandSkillElement.getChance(); - if(currentValue == null) currentValue = 100.0; + if (currentValue == null) currentValue = 100.0; double newValue = currentValue + amountToModify; - if(newValue < 0.0) { + if (newValue < 0.0) { newValue = 0.0; } - if(newValue > 100.0) { + if (newValue > 100.0) { newValue = 100.0; } @@ -115,8 +115,8 @@ public class ModifyCommandEditorPanel extends SubVariablePanelHandler subCommandSkillElements = commandSkillElement.getCommands(); List newElements = new ArrayList<>(); - for(SubCommandSkillElement subElement : subCommandSkillElements) { - if(subElement.getName().equals(subCommandSkillElement.getName())) { + for (SubCommandSkillElement subElement : subCommandSkillElements) { + if (subElement.getName().equals(subCommandSkillElement.getName())) { newElements.add(subCommandSkillElement); } else { newElements.add(subElement); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/CustomSkillTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/CustomSkillTypeEditorPanel.java index 5185a4a..907d1f5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/CustomSkillTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/CustomSkillTypeEditorPanel.java @@ -65,7 +65,7 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, skill, customSkillElement, customSkillHandlers); return true; @@ -83,21 +83,22 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler { - if(slot >= customSkillHandlers.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= customSkillHandlers.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { CustomSkillHandler customSkillHandler = customSkillHandlers.get(slot); String name = customSkillHandler.getSkillName(); Map replaceMap = new HashMap<>(); - String hasCustomData = customSkillHandler.getOtherSkillData() == null? "false" : "true"; + String hasCustomData = customSkillHandler.getOtherSkillData() == null ? "false" : "true"; replaceMap.put("{name}", name); - replaceMap.put("{multiplier}", ""+customSkillHandler.doesUseMultiplier()); + replaceMap.put("{multiplier}", "" + customSkillHandler.doesUseMultiplier()); replaceMap.put("{customData}", hasCustomData); ItemStack itemStack; - if(name.equalsIgnoreCase(current)) { + if (name.equalsIgnoreCase(current)) { itemStack = this.itemStackConverter.from(this.plugin.getItemStackManager().getItemStackHolder("DefaultSelectedCustomSkillTypeItem")); ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CustomType.selectedName"), replaceMap); @@ -111,7 +112,7 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler { IOtherSkillDataElement otherSkillDataElement = customSkillHandler.getOtherSkillData(); - JsonObject otherData = otherSkillDataElement == null? null : BossAPI.convertObjectToJsonObject(otherSkillDataElement); + JsonObject otherData = otherSkillDataElement == null ? null : BossAPI.convertObjectToJsonObject(otherSkillDataElement); customSkillElement.getCustom().setType(name); customSkillElement.getCustom().setOtherSkillData(otherData); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java index b61ddb6..20da7f9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MaterialTypeEditorPanel.java @@ -45,7 +45,7 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, filteredList, skill, customSkillElement); return true; @@ -72,24 +72,25 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler { - if(slot >= filteredList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{}); + if (slot >= filteredList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { Material material = filteredList.get(slot); ItemStack itemStack; - if(material == Material.AIR) itemStack = new ItemStack(Material.GLASS); + if (material == Material.AIR) itemStack = new ItemStack(Material.GLASS); else itemStack = new ItemStack(material); Map replaceMap = new HashMap<>(); - if(itemStack.getType() == Material.AIR) return; + if (itemStack.getType() == Material.AIR) return; String name = material.name(); replaceMap.put("{type}", StringUtils.get().formatString(name)); - if(current.equalsIgnoreCase(name)) { + if (current.equalsIgnoreCase(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Material.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Material.name"), replaceMap); @@ -107,7 +108,7 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler materials = new ArrayList<>(); masterList.forEach(material -> { - if((material.isBlock() && material.isSolid() && material.isItem()) || (material == Material.AIR)) { + if ((material.isBlock() && material.isSolid() && material.isItem()) || (material == Material.AIR)) { materials.add(material); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java index 565229b..11d128f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/MinionSelectEditorPanel.java @@ -54,7 +54,7 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, currentEntities, entryList, skill, customSkillElement); return true; @@ -82,8 +82,9 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler { - if(slot >= entryList.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{}); + if (slot >= entryList.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { String name = entryList.get(slot); MinionEntity minionEntity = currentEntities.get(name); @@ -92,10 +93,10 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler replaceMap = new HashMap<>(); replaceMap.put("{name}", name); - replaceMap.put("{editing}", ""+minionEntity.isEditing()); + replaceMap.put("{editing}", "" + minionEntity.isEditing()); replaceMap.put("{targeting}", minionEntity.getTargeting()); - if(current.equalsIgnoreCase(name)) { + if (current.equalsIgnoreCase(name)) { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.MinionList.selectedName"), replaceMap); } else { ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.MinionList.name"), replaceMap); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java index 5ca5fb4..c3413c4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/custom/SpecialSettingsEditorPanel.java @@ -62,19 +62,19 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler cSH.getSkillName().equalsIgnoreCase(currentSkillName)).findFirst().orElse(null); - if(customSkillHandler == null) { + if (customSkillHandler == null) { Debug.FAILED_TO_FIND_ASSIGNED_CUSTOMSKILLHANDLER.debug(currentSkillName); return; } List customButtons = customSkillHandler.getOtherSkillDataActions(skill, customSkillElement); - if(customButtons == null || customButtons.isEmpty()) return; + if (customButtons == null || customButtons.isEmpty()) return; int maxPage = panel.getMaxPage(customButtons); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, customButtons); return true; @@ -91,8 +91,9 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler clickActions) { panel.loadPage(page, ((slot, realisticSlot) -> { - if(slot >= clickActions.size()) { - panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {}); + if (slot >= clickActions.size()) { + panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> { + }); } else { ICustomSettingAction customSkillAction = clickActions.get(slot); ClickAction clickAction = customSkillAction.getAction(); @@ -105,7 +106,7 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler 255) { + if (totalAmount > 255) { totalAmount = 255; } @@ -144,11 +144,11 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler currentList = potionSkillElement.getPotions(); currentList.add(potionEffectHolder); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java index 4f8aa04..594405d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/Skill.java @@ -29,46 +29,46 @@ public class Skill { return this.mode; } - public String getType() { - return this.type; - } - - public String getDisplayName() { - return this.displayName; - } - - public String getCustomMessage() { - return this.customMessage; - } - - public Double getRadius() { - return this.radius; - } - - public JsonObject getCustomData() { - return this.customData; - } - public void setMode(String mode) { this.mode = mode; } + public String getType() { + return this.type; + } + public void setType(String type) { this.type = type; } + public String getDisplayName() { + return this.displayName; + } + public void setDisplayName(String displayName) { this.displayName = displayName; } + public String getCustomMessage() { + return this.customMessage; + } + public void setCustomMessage(String customMessage) { this.customMessage = customMessage; } + public Double getRadius() { + return this.radius; + } + public void setRadius(Double radius) { this.radius = radius; } + public JsonObject getCustomData() { + return this.customData; + } + public void setCustomData(JsonObject customData) { this.customData = customData; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/SkillMode.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/SkillMode.java index 01857fb..760d655 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/SkillMode.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/SkillMode.java @@ -22,15 +22,11 @@ public enum SkillMode { this.rank = rank; } - public SkillMode getNext() { - return get(this.rank+1); - } - public static SkillMode getCurrent(String input) { - if(input == null || input.isEmpty()) return BLANK; + if (input == null || input.isEmpty()) return BLANK; - for(SkillMode skillMode : values()) { - if(skillMode.name().equalsIgnoreCase(input)) return skillMode; + for (SkillMode skillMode : values()) { + if (skillMode.name().equalsIgnoreCase(input)) return skillMode; } return BLANK; @@ -39,16 +35,16 @@ public enum SkillMode { public static List getSkillModes() { List list = new ArrayList<>(); - for(SkillMode skillMode : values()) { - if(skillMode.rank > 0) list.add(skillMode); + for (SkillMode skillMode : values()) { + if (skillMode.rank > 0) list.add(skillMode); } return list; } private static SkillMode get(int rank) { - for(SkillMode skillMode : values()) { - if(skillMode.rank == rank) { + for (SkillMode skillMode : values()) { + if (skillMode.rank == rank) { return skillMode; } } @@ -56,4 +52,8 @@ public enum SkillMode { return ALL; } + public SkillMode getNext() { + return get(this.rank + 1); + } + } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java index 7db4245..89da042 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java @@ -17,7 +17,10 @@ import com.songoda.epicbosses.skills.elements.SubCustomSkillElement; import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; import com.songoda.epicbosses.skills.interfaces.IOtherSkillDataElement; import com.songoda.epicbosses.skills.types.CustomSkillElement; -import com.songoda.epicbosses.utils.*; +import com.songoda.epicbosses.utils.Debug; +import com.songoda.epicbosses.utils.NumberUtils; +import com.songoda.epicbosses.utils.ObjectUtils; +import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.itemstack.converters.MaterialConverter; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler; @@ -104,7 +107,7 @@ public class Cage extends CustomSkillHandler { nearbyEntities.forEach(livingEntity -> { UUID uuid = livingEntity.getUniqueId(); - if(getPlayersInCage().contains(uuid)) return; + if (getPlayersInCage().contains(uuid)) return; getPlayersInCage().add(uuid); @@ -132,16 +135,16 @@ public class Cage extends CustomSkillHandler { private void restoreBlocks(Queue queue) { queue.forEach(blockState -> { - if(blockState == null) return; + if (blockState == null) return; Location location = blockState.getLocation(); CageLocationData cageLocationData = getCageLocationDataMap().getOrDefault(location, new CageLocationData(location, 1)); int amountOfCages = cageLocationData.getAmountOfCages(); - if(amountOfCages == 1) { + if (amountOfCages == 1) { BlockState oldState = cageLocationData.getOldBlockState(); - if(oldState != null) { + if (oldState != null) { if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) { location.getBlock().setBlockData(oldState.getBlockData()); } else { @@ -164,7 +167,7 @@ public class Cage extends CustomSkillHandler { getCageLocationDataMap().remove(location); } else { - cageLocationData.setAmountOfCages(amountOfCages-1); + cageLocationData.setAmountOfCages(amountOfCages - 1); getCageLocationDataMap().put(location, cageLocationData); } }); @@ -181,22 +184,23 @@ public class Cage extends CustomSkillHandler { private void setBlocks(Queue queue, String materialType, Skill skill) { Material material = MATERIAL_CONVERTER.from(materialType); - if(material == null) { + if (material == null) { Debug.SKILL_CAGE_INVALID_MATERIAL.debug(materialType, skill.getDisplayName()); return; } queue.forEach(blockState -> { - if(blockState == null) return; + if (blockState == null) return; Location location = blockState.getLocation(); CageLocationData cageLocationData = getCageLocationDataMap().getOrDefault(location, new CageLocationData(location, 0)); int currentAmount = cageLocationData.getAmountOfCages(); - if(currentAmount == 0 || cageLocationData.getOldBlockState() == null) cageLocationData.setOldBlockState(blockState); + if (currentAmount == 0 || cageLocationData.getOldBlockState() == null) + cageLocationData.setOldBlockState(blockState); blockState.getBlock().setType(material); - cageLocationData.setAmountOfCages(currentAmount+1); + cageLocationData.setAmountOfCages(currentAmount + 1); getCageLocationDataMap().put(location, cageLocationData); }); } @@ -218,7 +222,7 @@ public class Cage extends CustomSkillHandler { ClickType clickType = event.getClick(); int amountToModifyBy; - if(clickType.name().contains("RIGHT")) { + if (clickType.name().contains("RIGHT")) { amountToModifyBy = -1; } else { amountToModifyBy = +1; @@ -229,7 +233,7 @@ public class Cage extends CustomSkillHandler { int currentAmount = ObjectUtils.getValue(customCageSkillElement.getDuration(), 5); int newAmount = currentAmount + amountToModifyBy; - if(newAmount <= 1) newAmount = 1; + if (newAmount <= 1) newAmount = 1; customCageSkillElement.setDuration(newAmount); subCustomSkillElement.setOtherSkillData(BossAPI.convertObjectToJsonObject(customCageSkillElement)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java index 91ab0fe..88e723d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java @@ -49,7 +49,7 @@ public class Disarm extends CustomSkillHandler { switch (itemSlot) { case 0: - if(livingEntity instanceof HumanEntity) { + if (livingEntity instanceof HumanEntity) { HumanEntity humanEntity = (HumanEntity) livingEntity; itemStack = EpicBosses.getInstance().getVersionHandler().getItemInHand(humanEntity); @@ -75,7 +75,7 @@ public class Disarm extends CustomSkillHandler { break; } - if(itemStack == null || itemStack.getType() == Material.AIR) return; + if (itemStack == null || itemStack.getType() == Material.AIR) return; livingEntity.getWorld().dropItemNaturally(livingEntity.getLocation(), itemStack); Message.General_Disarmed.msg(livingEntity); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java index d79baf7..d56711b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Fireball.java @@ -37,11 +37,11 @@ public class Fireball extends CustomSkillHandler { public void castSkill(Skill skill, CustomSkillElement customSkillElement, ActiveBossHolder activeBossHolder, List nearbyEntities) { LivingEntity boss = activeBossHolder.getLivingEntity(); - if(boss == null) return; + if (boss == null) return; Double multiplier = customSkillElement.getCustom().getMultiplier(); - if(multiplier == null) multiplier = 1.0; + if (multiplier == null) multiplier = 1.0; double finalMultiplier = multiplier; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Grapple.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Grapple.java index 42682d0..0929e5e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Grapple.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Grapple.java @@ -39,7 +39,7 @@ public class Grapple extends CustomSkillHandler { Location bossLocation = activeBossHolder.getLocation(); Double multiplier = customSkillElement.getCustom().getMultiplier(); - if(multiplier == null) multiplier = 1.0; + if (multiplier == null) multiplier = 1.0; double finalMultiplier = multiplier; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Insidious.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Insidious.java index cec1024..f5afe14 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Insidious.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Insidious.java @@ -36,7 +36,7 @@ public class Insidious extends CustomSkillHandler { public void castSkill(Skill skill, CustomSkillElement customSkillElement, ActiveBossHolder activeBossHolder, List nearbyEntities) { Double multiplier = customSkillElement.getCustom().getMultiplier(); - if(multiplier == null) multiplier = 2.5; + if (multiplier == null) multiplier = 2.5; double finalMultiplier = multiplier; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Knockback.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Knockback.java index c418736..7d11ee2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Knockback.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Knockback.java @@ -38,7 +38,7 @@ public class Knockback extends CustomSkillHandler { public void castSkill(Skill skill, CustomSkillElement customSkillElement, ActiveBossHolder activeBossHolder, List nearbyEntities) { Double multiplier = customSkillElement.getCustom().getMultiplier(); - if(multiplier == null) multiplier = 2.5; + if (multiplier == null) multiplier = 2.5; double finalMultiplier = multiplier; Location bossLocation = activeBossHolder.getLocation(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java index 1f24e86..4e58363 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java @@ -10,11 +10,10 @@ import org.bukkit.block.BlockState; */ public class CageLocationData { + private final Location location; private BlockState oldBlockState; private int amountOfCages = 0; - private final Location location; - public CageLocationData(Location location, int amountOfCages) { this(location); @@ -29,19 +28,19 @@ public class CageLocationData { return this.oldBlockState; } - public int getAmountOfCages() { - return this.amountOfCages; - } - - public Location getLocation() { - return this.location; - } - public void setOldBlockState(BlockState oldBlockState) { this.oldBlockState = oldBlockState; } + public int getAmountOfCages() { + return this.amountOfCages; + } + public void setAmountOfCages(int amountOfCages) { this.amountOfCages = amountOfCages; } + + public Location getLocation() { + return this.location; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java index d81031d..b4c6989 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CagePlayerData.java @@ -33,8 +33,8 @@ public class CagePlayerData { World world = playerLocation.getWorld(); Queue locationQueue = new LinkedList<>(); - for(int x = 1; x >= -1; x--) { - for(int z = 1; z >= -1; z--) { + for (int x = 1; x >= -1; x--) { + for (int z = 1; z >= -1; z--) { Location location1 = new Location(world, x, +2, z); Location location2 = new Location(world, x, -1, z); @@ -53,7 +53,7 @@ public class CagePlayerData { World world = playerLocation.getWorld(); Queue locationQueue = new LinkedList<>(); - for(int y = 1; y >= 0; y--) { + for (int y = 1; y >= 0; y--) { Location innerLocation = new Location(world, 0, y, 0); locationQueue.add(innerLocation); @@ -66,8 +66,8 @@ public class CagePlayerData { World world = playerLocation.getWorld(); Queue locationQueue = new LinkedList<>(); - for(int x = 1; x >= -1; x--) { - for(int z = 1; z >= -1; z--) { + for (int x = 1; x >= -1; x--) { + for (int z = 1; z >= -1; z--) { Location location1 = new Location(world, x, 1, z); Location location2 = new Location(world, x, 0, z); @@ -83,10 +83,10 @@ public class CagePlayerData { Queue blockStateQueue = new LinkedList<>(); World world = playerLocation.getWorld(); - while(!queue.isEmpty()) { + while (!queue.isEmpty()) { Location temp = queue.poll(); - if(temp == null) continue; + if (temp == null) continue; Block block = world.getBlockAt(temp.add(playerLocation).clone()); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java index 42a4244..83e4ff4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomCageSkillElement.java @@ -26,30 +26,30 @@ public class CustomCageSkillElement implements IOtherSkillDataElement { return this.flatType; } - public String getWallType() { - return this.wallType; - } - - public String getInsideType() { - return this.insideType; - } - - public int getDuration() { - return this.duration; - } - public void setFlatType(String flatType) { this.flatType = flatType; } + public String getWallType() { + return this.wallType; + } + public void setWallType(String wallType) { this.wallType = wallType; } + public String getInsideType() { + return this.insideType; + } + public void setInsideType(String insideType) { this.insideType = insideType; } + public int getDuration() { + return this.duration; + } + public void setDuration(int duration) { this.duration = duration; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java index b99d251..d4a4c36 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/CustomMinionSkillElement.java @@ -24,14 +24,14 @@ public class CustomMinionSkillElement implements IOtherSkillDataElement { return this.minionToSpawn; } - public Integer getAmount() { - return this.amount; - } - public void setMinionToSpawn(String minionToSpawn) { this.minionToSpawn = minionToSpawn; } + public Integer getAmount() { + return this.amount; + } + public void setAmount(Integer amount) { this.amount = amount; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java index 660bc17..6b63d11 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCommandSkillElement.java @@ -33,14 +33,14 @@ public class SubCommandSkillElement { return this.chance; } - public List getCommands() { - return this.commands; - } - public void setChance(Double chance) { this.chance = chance; } + public List getCommands() { + return this.commands; + } + public void setCommands(List commands) { this.commands = commands; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java index 6f3a4c1..80d0c2d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/elements/SubCustomSkillElement.java @@ -25,7 +25,7 @@ public class SubCustomSkillElement { } public CustomCageSkillElement getCustomCageSkillData() { - if(getType().equalsIgnoreCase("CAGE")) { + if (getType().equalsIgnoreCase("CAGE")) { return BossesGson.get().fromJson(this.otherSkillData, CustomCageSkillElement.class); } @@ -33,7 +33,7 @@ public class SubCustomSkillElement { } public CustomMinionSkillElement getCustomMinionSkillData() { - if(getType().equalsIgnoreCase("MINIONS")) { + if (getType().equalsIgnoreCase("MINIONS")) { return BossesGson.get().fromJson(this.otherSkillData, CustomMinionSkillElement.class); } @@ -44,14 +44,14 @@ public class SubCustomSkillElement { return this.type; } - public Double getMultiplier() { - return this.multiplier; - } - public void setType(String type) { this.type = type; } + public Double getMultiplier() { + return this.multiplier; + } + public void setMultiplier(Double multiplier) { this.multiplier = multiplier; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java index 088adbe..9eaef5b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/CommandSkillElement.java @@ -31,7 +31,7 @@ public class CommandSkillElement implements ISkillHandler { List commandSkillElements = getCommands(); ServerUtils serverUtils = ServerUtils.get(); - if(commandSkillElements.isEmpty()) { + if (commandSkillElements.isEmpty()) { Debug.SKILL_COMMANDS_ARE_EMPTY.debug(); return; } @@ -41,9 +41,9 @@ public class CommandSkillElement implements ISkillHandler { Double chance = commandSkillEle.getChance(); List commands = commandSkillEle.getCommands(); - if(commands == null || commands.isEmpty()) return; - if(chance == null) chance = 100.0; - if(!RandomUtils.get().canPreformAction(chance)) return; + if (commands == null || commands.isEmpty()) return; + if (chance == null) chance = 100.0; + if (!RandomUtils.get().canPreformAction(chance)) return; commands.replaceAll(s -> s.replace("%player%", livingEntity.getName())); commands.forEach(serverUtils::sendConsoleCommand); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java index 297b7f6..83673c2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/GroupSkillElement.java @@ -36,7 +36,7 @@ public class GroupSkillElement implements ISkillHandler { currentGroupedSkills.forEach(string -> { Skill innerSkill = skillsFileManager.getSkill(string); - if(innerSkill == null) { + if (innerSkill == null) { Debug.SKILL_NOT_FOUND.debug(); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java index 4b6e6d4..fefc8ad 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/types/PotionSkillElement.java @@ -34,11 +34,11 @@ public class PotionSkillElement implements ISkillHandler { public void castSkill(Skill skill, PotionSkillElement customSkillElement, ActiveBossHolder activeBossHolder, List nearbyEntities) { List potionElements = getPotions(); - if(this.potionEffectConverter == null) this.potionEffectConverter = new PotionEffectConverter(); + if (this.potionEffectConverter == null) this.potionEffectConverter = new PotionEffectConverter(); - if(nearbyEntities == null || nearbyEntities.isEmpty()) return; - if(potionElements == null) return; - if(potionElements.isEmpty()) { + if (nearbyEntities == null || nearbyEntities.isEmpty()) return; + if (potionElements == null) return; + if (potionElements.isEmpty()) { Debug.SKILL_POTIONS_ARE_EMPTY.debug(); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java index daf2cd9..65a917d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java @@ -72,12 +72,20 @@ public enum Debug { this.message = message; } + public static void debugMessage(String message) { + PLAIN.debug(message); + } + + public static void setPlugin(EpicBosses plugin) { + PLUGIN = plugin; + } + public void debug(Object... objects) { int current = 0; String message = this.message; - for(Object object : objects) { - if(object == null) continue; + for (Object object : objects) { + if (object == null) continue; String placeholder = "{" + current + "}"; @@ -92,18 +100,10 @@ public enum Debug { PLUGIN.getDebugManager().getToggledPlayers().forEach(uuid -> { Player player = Bukkit.getPlayer(uuid); - if(player == null) return; + if (player == null) return; player.sendMessage(finalMsg); }); } - public static void debugMessage(String message) { - PLAIN.debug(message); - } - - public static void setPlugin(EpicBosses plugin) { - PLUGIN = plugin; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java index 3943fef..464a794 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EnchantFinder.java @@ -57,11 +57,11 @@ public enum EnchantFinder { } public static EnchantFinder getByName(String name) { - for(EnchantFinder enchantFinder : values()) { + for (EnchantFinder enchantFinder : values()) { List names = enchantFinder.getNames(); - for(String s : names) { - if(s.equalsIgnoreCase(name)) return enchantFinder; + for (String s : names) { + if (s.equalsIgnoreCase(name)) return enchantFinder; } } @@ -69,14 +69,14 @@ public enum EnchantFinder { } public static EnchantFinder getByEnchant(Enchantment enchantment) { - if(enchantment == null) return null; + if (enchantment == null) return null; - for(EnchantFinder enchantFinder : values()) { + for (EnchantFinder enchantFinder : values()) { Enchantment enchantFinderEnchant = enchantFinder.getEnchantment(); - if(enchantFinderEnchant == null) continue; + if (enchantFinderEnchant == null) continue; - if(enchantFinderEnchant.equals(enchantment)) return enchantFinder; + if (enchantFinderEnchant.equals(enchantment)) return enchantFinder; } return null; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java index 4e05852..72600df 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java @@ -106,13 +106,23 @@ public enum EntityFinder { this.customEntityHandler = null; } + public static EntityFinder get(String name) { + for (EntityFinder entityFinder : values()) { + for (String s : entityFinder.getNames()) { + if (name.equalsIgnoreCase(s)) return entityFinder; + } + } + + return null; + } + @Override public String toString() { return this.fancyName; } public LivingEntity spawnNewLivingEntity(String input, Location location) { - if(this.customEntityHandler != null) { + if (this.customEntityHandler != null) { LivingEntity livingEntity; try { @@ -128,16 +138,6 @@ public enum EntityFinder { } } - public static EntityFinder get(String name) { - for(EntityFinder entityFinder : values()) { - for (String s : entityFinder.getNames()) { - if(name.equalsIgnoreCase(s)) return entityFinder; - } - } - - return null; - } - public ICustomEntityHandler getCustomEntityHandler() { return this.customEntityHandler; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/MapUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/MapUtils.java index 80d17ce..a7e0f66 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/MapUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/MapUtils.java @@ -14,6 +14,10 @@ public class MapUtils { private static MapUtils INSTANCE = new MapUtils(); + public static MapUtils get() { + return INSTANCE; + } + public > Map sortByValue(Map map) { List> list = new ArrayList<>(map.entrySet()); Map resultMap = new LinkedHashMap<>(); @@ -24,8 +28,4 @@ public class MapUtils { return resultMap; } - public static MapUtils get() { - return INSTANCE; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java index 2730db4..f42a018 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java @@ -79,59 +79,59 @@ public enum Message { Boss_Help_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Help_Page1( "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 1/4) &3&l]&8&m--------*----\n" + - "&b/boss help (page) &8» &7Displays boss commands.\n" + - "&b/boss create [name] [entity] &8» &7Start the creation of a boss.\n" + - "&b/boss edit (name) &8» &7Edit the specified boss.\n" + - "&b/boss info [name] &8» &7Shows information on the specified boss.\n" + - "&b/boss nearby (radius) &8» &7Shows the nearby bosses.\n" + - "&b/boss reload &8» &7Reloads the boss plugin.\n" + - "&7\n" + - "&7Use /boss help 2 to view the next page.\n" + - "&8&m----*-----------------------------------*----"), + "&b/boss help (page) &8» &7Displays boss commands.\n" + + "&b/boss create [name] [entity] &8» &7Start the creation of a boss.\n" + + "&b/boss edit (name) &8» &7Edit the specified boss.\n" + + "&b/boss info [name] &8» &7Shows information on the specified boss.\n" + + "&b/boss nearby (radius) &8» &7Shows the nearby bosses.\n" + + "&b/boss reload &8» &7Reloads the boss plugin.\n" + + "&7\n" + + "&7Use /boss help 2 to view the next page.\n" + + "&8&m----*-----------------------------------*----"), Boss_Help_Page2( "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 2/4) &3&l]&8&m--------*----\n" + - "&b/boss spawn [name] (location) &8» &7Spawns a boss at your" + - " location or the specified location.\n" + - "&7&o(Separate location with commas, an example is: world,0,100,0)\n" + - "&b/boss droptable &8» &7Shows all current drop tables.\n" + - "&b/boss items &8» &7Shows all current custom items.\n" + + "&b/boss spawn [name] (location) &8» &7Spawns a boss at your" + + " location or the specified location.\n" + + "&7&o(Separate location with commas, an example is: world,0,100,0)\n" + + "&b/boss droptable &8» &7Shows all current drop tables.\n" + + "&b/boss items &8» &7Shows all current custom items.\n" + "&b/boss skills &8» &7Shows all current set skills.\n" + - "&b/boss killall (world) &8» &7Kills all bosses/minions.\n" + - "&7\n" + - "&7Use /boss help 3 to view the next page.\n" + - "&8&m----*-----------------------------------*----"), + "&b/boss killall (world) &8» &7Kills all bosses/minions.\n" + + "&7\n" + + "&7Use /boss help 3 to view the next page.\n" + + "&8&m----*-----------------------------------*----"), Boss_Help_Page3( "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 3/4) &3&l]&8&m--------*----\n" + - "&b/boss time [section] &8» &7Shows the time left till next auto spawn.\n" + - "&b/boss giveegg [name] [player] (amount) &8» &7Used to be given a " + - "spawn item of the boss.\n" + - "&b/boss list &8» &7Shows all the list of current boss entities.\n" + - "&b/boss new skill [name] [type] [mode] &8» &7Create a new skill section.\n" + - "&b/boss new droptable [name] [type] &8» &7Create a new drop table section.\n" + - "&7\n" + - "&7Use /boss help 4 to view the next page.\n" + - "&8&m----*-----------------------------------*----"), + "&b/boss time [section] &8» &7Shows the time left till next auto spawn.\n" + + "&b/boss giveegg [name] [player] (amount) &8» &7Used to be given a " + + "spawn item of the boss.\n" + + "&b/boss list &8» &7Shows all the list of current boss entities.\n" + + "&b/boss new skill [name] [type] [mode] &8» &7Create a new skill section.\n" + + "&b/boss new droptable [name] [type] &8» &7Create a new drop table section.\n" + + "&7\n" + + "&7Use /boss help 4 to view the next page.\n" + + "&8&m----*-----------------------------------*----"), Boss_Help_Page4( "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 4/4) &3&l]&8&m--------*----\n" + - "&b/boss new command [name] [commands] &8» &7Used to create a new command section.\n" + - "&7&o(To add a new line use &7||&7&o in-between the messages.)\n" + - "&b/boss new message [name] [messages] &8» &7Used to create a new message section.\n" + - "&7&o(To add a new line use &7||&7&o in-between the messages.)\n" + - "&7/boss new autospawn [name] &8» &7Used to create a new auto spawn section.\n" + - "&b/boss debug &8» &7Used to toggle the debug aspect of the plugin.\n" + - "&7\n" + - "&7\n" + - "&7Use /boss help [page] to view the next page.\n" + - "&8&m----*-----------------------------------*----"), + "&b/boss new command [name] [commands] &8» &7Used to create a new command section.\n" + + "&7&o(To add a new line use &7||&7&o in-between the messages.)\n" + + "&b/boss new message [name] [messages] &8» &7Used to create a new message section.\n" + + "&7&o(To add a new line use &7||&7&o in-between the messages.)\n" + + "&7/boss new autospawn [name] &8» &7Used to create a new auto spawn section.\n" + + "&b/boss debug &8» &7Used to toggle the debug aspect of the plugin.\n" + + "&7\n" + + "&7\n" + + "&7Use /boss help [page] to view the next page.\n" + + "&8&m----*-----------------------------------*----"), Boss_Info_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Info_InvalidArgs("&c&l(!) &cYou must use &n/boss info [name]&c to view info on a boss."), Boss_Info_CouldntFindBoss("&c&l(!) &cThe specified boss was not able to be retrieved, please try again."), Boss_Info_Display( "&8&m----*--------&3&l[ &b&l{0} Info &3&l]&8&m--------*----\n" + - "&bEditing: &f{1}\n" + - "&bCurrently Active: &f{2}\n" + - "&bComplete enough to spawn: &f{3}"), + "&bEditing: &f{1}\n" + + "&bCurrently Active: &f{2}\n" + + "&bComplete enough to spawn: &f{3}"), Boss_Items_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Items_CannotBeRemoved("&c&l(!) &cThe selected item cannot be removed because it is still used in {0} different positions on the bosses."), @@ -247,10 +247,10 @@ public enum Message { public void msg(CommandSender p, Object... order) { String s = toString(order); - if(s.contains("\n")) { + if (s.contains("\n")) { String[] split = s.split("\n"); - for(String inner : split) { + for (String inner : split) { sendMessage(p, inner, order); } } else { @@ -261,16 +261,16 @@ public enum Message { public void broadcast(Object... order) { String s = toString(); - if(s.contains("\n")) { + if (s.contains("\n")) { String[] split = s.split("\n"); - for(String inner : split) { - for(Player player : Bukkit.getOnlinePlayers()) { + for (String inner : split) { + for (Player player : Bukkit.getOnlinePlayers()) { sendMessage(player, inner, order); } } } else { - for(Player player : Bukkit.getOnlinePlayers()) { + for (Player player : Bukkit.getOnlinePlayers()) { sendMessage(player, s, order); } } @@ -279,38 +279,31 @@ public enum Message { private String getFinalized(String string, Object... order) { int current = 0; - for(Object object : order) { + for (Object object : order) { String placeholder = "{" + current + "}"; - if(string.contains(placeholder)) { - if(object instanceof CommandSender) { + if (string.contains(placeholder)) { + if (object instanceof CommandSender) { string = string.replace(placeholder, ((CommandSender) object).getName()); - } - else if(object instanceof OfflinePlayer) { + } else if (object instanceof OfflinePlayer) { string = string.replace(placeholder, ((OfflinePlayer) object).getName()); - } - else if(object instanceof Location) { + } else if (object instanceof Location) { Location location = (Location) object; String repl = location.getWorld().getName() + ", " + location.getBlockX() + ", " + location.getBlockY() + ", " + location.getBlockZ(); string = string.replace(placeholder, repl); - } - else if(object instanceof String) { + } else if (object instanceof String) { string = string.replace(placeholder, StringUtils.get().translateColor((String) object)); - } - else if(object instanceof Long) { - string = string.replace(placeholder, ""+object); - } - else if(object instanceof Double) { - string = string.replace(placeholder, ""+object); - } - else if(object instanceof Integer) { - string = string.replace(placeholder, ""+object); - } - else if(object instanceof ItemStack) { + } else if (object instanceof Long) { + string = string.replace(placeholder, "" + object); + } else if (object instanceof Double) { + string = string.replace(placeholder, "" + object); + } else if (object instanceof Integer) { + string = string.replace(placeholder, "" + object); + } else if (object instanceof ItemStack) { string = string.replace(placeholder, getItemStackName((ItemStack) object)); - } else if(object instanceof Boolean) { - string = string.replace(placeholder, ""+object); + } else if (object instanceof Boolean) { + string = string.replace(placeholder, "" + object); } } @@ -327,7 +320,7 @@ public enum Message { private String getItemStackName(ItemStack itemStack) { String name = itemStack.getType().toString().replace("_", " "); - if(itemStack.hasItemMeta() && itemStack.getItemMeta().hasDisplayName()) { + if (itemStack.hasItemMeta() && itemStack.getItemMeta().hasDisplayName()) { return itemStack.getItemMeta().getDisplayName(); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java index e952ea9..36b5b06 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/MessageUtils.java @@ -16,12 +16,16 @@ public class MessageUtils { private static MessageUtils INSTANCE = new MessageUtils(); + public static MessageUtils get() { + return INSTANCE; + } + public void sendMessage(LivingEntity player, String... messages) { sendMessage(player, Arrays.asList(messages)); } public void sendMessage(LivingEntity player, List messages) { - for(String s : messages) { + for (String s : messages) { player.sendMessage(StringUtils.get().translateColor(s)); } } @@ -33,19 +37,15 @@ public class MessageUtils { public void sendMessage(Location center, int radius, List messages) { messages.replaceAll(s -> s.replace('&', '§')); - if(radius == -1) { + if (radius == -1) { Bukkit.getOnlinePlayers().forEach(player -> messages.forEach(string -> player.sendMessage(string))); } else { Bukkit.getOnlinePlayers().forEach(player -> { - if((player.getWorld().equals(center.getWorld())) && (player.getLocation().distanceSquared(center) <= radius)) { + if ((player.getWorld().equals(center.getWorld())) && (player.getLocation().distanceSquared(center) <= radius)) { messages.forEach(string -> player.sendMessage(string)); } }); } } - public static MessageUtils get() { - return INSTANCE; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/NumberUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/NumberUtils.java index f7d5998..18324a1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/NumberUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/NumberUtils.java @@ -14,6 +14,10 @@ public class NumberUtils { private static NumberUtils INSTANCE = new NumberUtils(); + public static NumberUtils get() { + return INSTANCE; + } + public boolean isInt(String string) { try { Integer.valueOf(string); @@ -25,13 +29,13 @@ public class NumberUtils { } public Integer getInteger(String input) { - if(!isInt(input)) return null; + if (!isInt(input)) return null; return Integer.valueOf(input); } public int getSquared(int original) { - if(original == -1) return -1; + if (original == -1) return -1; return original * original; } @@ -47,7 +51,7 @@ public class NumberUtils { } public Double getDouble(String input) { - if(!isDouble(input)) return null; + if (!isDouble(input)) return null; return Double.valueOf(input); } @@ -75,8 +79,4 @@ public class NumberUtils { return currentIds.size() + 1; } - public static NumberUtils get() { - return INSTANCE; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ObjectUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ObjectUtils.java index c7f4e52..5b4aeb9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ObjectUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ObjectUtils.java @@ -8,7 +8,7 @@ package com.songoda.epicbosses.utils; public class ObjectUtils { public static T getValue(T input, T defaultValue) { - if(input == null) return defaultValue; + if (input == null) return defaultValue; return input; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java index e4d5afb..c4c0b79 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/PotionEffectFinder.java @@ -57,11 +57,11 @@ public enum PotionEffectFinder { } public static PotionEffectFinder getByName(String name) { - for(PotionEffectFinder potionEffectFinder : values()) { + for (PotionEffectFinder potionEffectFinder : values()) { List names = potionEffectFinder.getNames(); - for(String s : names) { - if(s.equalsIgnoreCase(name)) return potionEffectFinder; + for (String s : names) { + if (s.equalsIgnoreCase(name)) return potionEffectFinder; } } @@ -69,11 +69,11 @@ public enum PotionEffectFinder { } public static PotionEffectFinder getByEffect(PotionEffectType potionEffectType) { - for(PotionEffectFinder potionEffectFinder : values()) { + for (PotionEffectFinder potionEffectFinder : values()) { PotionEffectType effectType = potionEffectFinder.getPotionEffectType(); - if(effectType == null) continue; - if(potionEffectType.equals(effectType)) return potionEffectFinder; + if (effectType == null) continue; + if (potionEffectType.equals(effectType)) return potionEffectFinder; } return null; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java index 0050999..6294fbb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/RandomUtils.java @@ -13,6 +13,10 @@ public class RandomUtils { private Random random = new Random(); + public static RandomUtils get() { + return INSTANCE; + } + public boolean preformRandomAction() { int rand = getRandomNumber(2); @@ -41,8 +45,4 @@ public class RandomUtils { return (randomChance <= chanceOfSuccess); } - public static RandomUtils get() { - return INSTANCE; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ReflectionUtil.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ReflectionUtil.java index 194ac5a..f0998e9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ReflectionUtil.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ReflectionUtil.java @@ -18,6 +18,10 @@ public class ReflectionUtil { this.nmsVersion = this.nmsVersion.substring(this.nmsVersion.lastIndexOf(".") + 1); } + public static ReflectionUtil get() { + return instance; + } + public String getVersion() { return this.nmsVersion; } @@ -25,7 +29,7 @@ public class ReflectionUtil { public Class getNMSClass(String name) { try { return Class.forName("net.minecraft.server." + this.nmsVersion + "." + name); - } catch(ClassNotFoundException e) { + } catch (ClassNotFoundException e) { e.printStackTrace(); return null; } @@ -34,14 +38,10 @@ public class ReflectionUtil { public Class getOBCClass(String name) { try { return Class.forName("org.bukkit.craftbukkit." + this.nmsVersion + "." + name); - } catch(ClassNotFoundException e) { + } catch (ClassNotFoundException e) { e.printStackTrace(); return null; } } - public static ReflectionUtil get() { - return instance; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java index 0052217..3a23c6e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/ServerUtils.java @@ -29,6 +29,10 @@ public class ServerUtils { serverUtils = this; } + public static ServerUtils get() { + return serverUtils; + } + public void log(String log) { Bukkit.getConsoleSender().sendMessage(StringUtils.get().translateColor(log)); } @@ -72,7 +76,7 @@ public class ServerUtils { } public void cancelTask(BukkitTask bukkitTask) { - if(bukkitTask == null) return; + if (bukkitTask == null) return; bukkitTask.cancel(); } @@ -96,8 +100,4 @@ public class ServerUtils { return entity; return null; } - - public static ServerUtils get() { - return serverUtils; - } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java index 3efef29..ef13281 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/StringUtils.java @@ -19,6 +19,10 @@ public class StringUtils { private static StringUtils INSTANCE = new StringUtils(); + public static StringUtils get() { + return INSTANCE; + } + public List splitString(String input, int splitSize) { List messages = new ArrayList<>(); int index = 0; @@ -47,13 +51,13 @@ public class StringUtils { return Message.General_LocationFormat.toString() .replace("{world}", world) - .replace("{x}", ""+x) - .replace("{y}", ""+y) - .replace("{z}", ""+z); + .replace("{x}", "" + x) + .replace("{y}", "" + y) + .replace("{z}", "" + z); } public Location fromStringToLocation(String input) { - if(input == null) return null; + if (input == null) return null; String[] split = input.split(","); @@ -64,7 +68,7 @@ public class StringUtils { String zInput = split[3].trim(); World world = Bukkit.getWorld(worldInput); - if(NumberUtils.get().isInt(xInput) && NumberUtils.get().isInt(yInput) && NumberUtils.get().isInt(zInput)) { + if (NumberUtils.get().isInt(xInput) && NumberUtils.get().isInt(yInput) && NumberUtils.get().isInt(zInput)) { return new Location(world, Integer.valueOf(xInput), Integer.valueOf(yInput), Integer.valueOf(zInput)); } } catch (Exception ex) { @@ -80,14 +84,14 @@ public class StringUtils { Queue queue = new LinkedList<>(list); StringBuilder stringBuilder = new StringBuilder(); - while(!queue.isEmpty()) { + while (!queue.isEmpty()) { T object = queue.poll(); - if(object == null) continue; + if (object == null) continue; stringBuilder.append(object.toString()); - if(queue.isEmpty()) { + if (queue.isEmpty()) { stringBuilder.append("."); } else { stringBuilder.append(", "); @@ -98,25 +102,25 @@ public class StringUtils { } public String formatString(String string) { - if(string == null) return "null"; + if (string == null) return "null"; string = string.toLowerCase(); StringBuilder stringBuilder = new StringBuilder(); - if(string.contains(" ")) { - for(String z : string.split(" ")) { + if (string.contains(" ")) { + for (String z : string.split(" ")) { stringBuilder.append(Character.toUpperCase(z.charAt(0))).append(z.substring(1).toLowerCase()); } - } else if(string.contains("_")) { + } else if (string.contains("_")) { String[] split = string.split("_"); - for(int i = 0; i < split.length; i++) { + for (int i = 0; i < split.length; i++) { String z = split[i]; stringBuilder.append(Character.toUpperCase(z.charAt(0))).append(z.substring(1).toLowerCase()); - if(i != (split.length - 1)) { + if (i != (split.length - 1)) { stringBuilder.append(" "); } } @@ -127,8 +131,4 @@ public class StringUtils { return stringBuilder.toString(); } - public static StringUtils get() { - return INSTANCE; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/adapters/PotionEffectTypeAdapter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/adapters/PotionEffectTypeAdapter.java index 59feefd..d1e4d0a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/adapters/PotionEffectTypeAdapter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/adapters/PotionEffectTypeAdapter.java @@ -18,7 +18,7 @@ public class PotionEffectTypeAdapter implements BaseAdapter { String effectType = jsonElement.getAsString(); PotionEffectType potionEffectType = PotionEffectType.getByName(effectType.toUpperCase()); - if(potionEffectType == null) return null; + if (potionEffectType == null) return null; return potionEffectType; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java index 50f093e..c426eba 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java @@ -33,13 +33,13 @@ public abstract class CommandService extends BukkitComm this.description = cmd.getAnnotation(Description.class).value(); this.aliases = new String[]{}; - if(cmd.isAnnotationPresent(Alias.class)) + if (cmd.isAnnotationPresent(Alias.class)) this.aliases = cmd.getAnnotation(Alias.class).value(); - if(cmd.isAnnotationPresent(Permission.class)) + if (cmd.isAnnotationPresent(Permission.class)) this.permission = cmd.getAnnotation(Permission.class).value(); - if(cmd.isAnnotationPresent(NoPermission.class)) + if (cmd.isAnnotationPresent(NoPermission.class)) this.noPermissionMsg = cmd.getAnnotation(NoPermission.class).value(); getGenericClass(); @@ -48,10 +48,10 @@ public abstract class CommandService extends BukkitComm @Override public final boolean execute(CommandSender commandSender, String s, String[] args) { - if(this.permission != null && !testPermission(commandSender)) return false; + if (this.permission != null && !testPermission(commandSender)) return false; - if(!parameterClass.isInstance(commandSender)) { + if (!parameterClass.isInstance(commandSender)) { commandSender.sendMessage(StringUtils.get().translateColor("&4You cannot use that command.")); return false; } @@ -90,21 +90,20 @@ public abstract class CommandService extends BukkitComm setFields(); _commandMap.register(command, this); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } private void setFields() { - if(this.aliases != null) setAliases(Arrays.asList(this.aliases)); - if(this.description != null) setDescription(this.description); - if(this.permission != null) setPermission(this.permission); - if(this.noPermissionMsg != null) setPermissionMessage(this.noPermissionMsg); + if (this.aliases != null) setAliases(Arrays.asList(this.aliases)); + if (this.description != null) setDescription(this.description); + if (this.permission != null) setPermission(this.permission); + if (this.noPermissionMsg != null) setPermissionMessage(this.noPermissionMsg); } private void getGenericClass() { - if(this.parameterClass == null) { + if (this.parameterClass == null) { Type superClass = getClass().getGenericSuperclass(); Type tType = ((ParameterizedType) superClass).getActualTypeArguments()[0]; String className = tType.toString().split(" ")[1]; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java index 192eff8..a6b56fc 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java @@ -25,8 +25,8 @@ public abstract class SubCommandService extends Command @Override public boolean handleSubCommand(CommandSender commandSender, String[] args) { - for(SubCommand subCommand : this.subCommands) { - if(subCommand.isSubCommand(args[0])) { + for (SubCommand subCommand : this.subCommands) { + if (subCommand.isSubCommand(args[0])) { subCommand.execute(commandSender, args); return true; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java index 7761ae8..7439d71 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java @@ -6,7 +6,7 @@ import java.lang.annotation.*; * Created by charl on 03-May-17. */ @Documented -@Target({ ElementType.TYPE }) +@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Alias { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java index a30a93b..50624d7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java @@ -6,7 +6,7 @@ import java.lang.annotation.*; * Created by charl on 03-May-17. */ @Documented -@Target({ ElementType.TYPE }) +@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Description { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java index cf568ef..8e3d160 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java @@ -6,7 +6,7 @@ import java.lang.annotation.*; * Created by LukeBingham on 03/04/2017. */ @Documented -@Target({ ElementType.TYPE }) +@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Name { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java index 78085ad..b172470 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java @@ -8,7 +8,7 @@ import java.lang.annotation.*; * @since 08-Jun-17 */ @Documented -@Target({ ElementType.TYPE }) +@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface NoPermission { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java index cd66ef3..636f120 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java @@ -6,7 +6,7 @@ import java.lang.annotation.*; * Created by charl on 11-May-17. */ @Documented -@Target({ ElementType.TYPE }) +@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Permission { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java index 889755f..ec41fed 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java @@ -6,7 +6,7 @@ import java.lang.annotation.*; * Created by LukeBingham on 03/04/2017. */ @Documented -@Target({ ElementType.TYPE }) +@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Suggest { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java index 41177a1..b72bd0c 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/dependencies/ASkyblockHelper.java @@ -16,7 +16,7 @@ public class ASkyblockHelper implements IASkyblockHelper { public boolean isOnOwnIsland(Player player) { Island island = ASkyBlock.getPlugin().getGrid().getProtectedIslandAt(player.getLocation()); - if(island == null) return false; + if (island == null) return false; return island.getMembers().contains(player.getUniqueId()); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java index 454e160..f640959 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java @@ -10,7 +10,7 @@ public class CatHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) { throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java index 17454ed..78b0220 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java @@ -13,7 +13,7 @@ public class DrownedHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) { throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java index f9657fd..f1b6044 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java @@ -18,7 +18,7 @@ public class ElderGuardianHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ELDER_GUARDIAN); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java index 712424d..28ce5d1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java @@ -18,7 +18,7 @@ public class EndermiteHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.ENDERMITE); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java index 8f3c4f4..b97a2a5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EvokerHandler.java @@ -15,7 +15,7 @@ public class EvokerHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_11)) { throw new NullPointerException("This feature is only implemented in version 1.11 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java index ec97d9f..52d47fa 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java @@ -13,7 +13,7 @@ public class FishHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java index 7aa1117..c6af784 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java @@ -13,7 +13,7 @@ public class FoxHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.FOX); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java index 785cf26..37dc562 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/KillerBunnyHandler.java @@ -16,7 +16,7 @@ public class KillerBunnyHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) throw new NullPointerException("This feature is only implemented in version 1.8 and above of Minecraft."); Rabbit rabbit = (Rabbit) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.RABBIT); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java index 0b5e94c..f2ba492 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java @@ -13,7 +13,7 @@ public class PandaHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PANDA); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java index 8070e52..45cf3a4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ParrotHandler.java @@ -16,7 +16,7 @@ public class ParrotHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_12)) - throw new NullPointerException("This feature is only implemented in version 1.12 and above of Minecraft."); + throw new NullPointerException("This feature is only implemented in version 1.12 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.PARROT); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java index dbac2b4..ef1ac57 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PolarBearHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -16,7 +15,7 @@ public class PolarBearHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_10)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_10)) throw new NullPointerException("This feature is only implemented in version 1.10 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.POLAR_BEAR); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java index b723742..fde782e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/RavagerHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -12,7 +11,7 @@ public class RavagerHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) { throw new NullPointerException("This feature is only implemented in version 1.14 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java index 585deb9..a19e170 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java @@ -18,7 +18,7 @@ public class ShulkerHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { throw new NullPointerException("This feature is only implemented in version 1.9 and above of Minecraft."); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java index 5c28486..18beda0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/StraySkeletonHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -17,10 +16,10 @@ public class StraySkeletonHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_10)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_10)) throw new NullPointerException("This feature is only implemented in version 1.10 and above of Minecraft."); - if(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_10)) + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_10)) return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.STRAY); Skeleton skeleton = (Skeleton) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.SKELETON); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java index ab4435d..24ec2c7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java @@ -10,7 +10,7 @@ public class TurtleHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) throw new NullPointerException("This feature is only implemented in version 1.13 and above of Minecraft."); return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.TURTLE); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java index 5ac92a1..3a58f70 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VexHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VillagerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VillagerHandler.java index 5332267..f960366 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VillagerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/VillagerHandler.java @@ -18,7 +18,7 @@ public class VillagerHandler implements ICustomEntityHandler { Villager villager = (Villager) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.VILLAGER); String[] split = entityType.split(":"); - if(split.length == 2) { + if (split.length == 2) { String type = split[1]; Villager.Profession profession; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java index ada2add..52b94af 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java @@ -19,7 +19,7 @@ public class WitherSkeletonHandler implements ICustomEntityHandler { @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { - if(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) { return (LivingEntity) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.WITHER_SKELETON); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileUtils.java index c8a3b1e..aa87130 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/FileUtils.java @@ -15,6 +15,10 @@ public class FileUtils { private static FileUtils INSTANCE = new FileUtils(); + public static FileUtils get() { + return INSTANCE; + } + public void saveFile(File file, FileConfiguration fileConfiguration) { try { fileConfiguration.save(file); @@ -35,8 +39,4 @@ public class FileUtils { return YamlConfiguration.loadConfiguration(file); } - public static FileUtils get() { - return INSTANCE; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/reader/SpigotYmlReader.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/reader/SpigotYmlReader.java index 3459ad2..55f438e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/reader/SpigotYmlReader.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/reader/SpigotYmlReader.java @@ -25,13 +25,13 @@ public class SpigotYmlReader implements IYmlReader { this.spigotConfig = FileUtils.get().loadFile(spigotFile); } + public static SpigotYmlReader get() { + return instance; + } + @Override public Object getObject(String path) { return this.spigotConfig.get(path); } - public static SpigotYmlReader get() { - return instance; - } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java index 5c89d81..b81d41b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java @@ -41,44 +41,44 @@ public class ItemStackConverter implements IReplaceableConverter lore = null, enchants = null; - if(durability == 0) { + if (durability == 0) { durability = null; } type = this.materialConverter.to(material); - if(itemStack.hasItemMeta()) { + if (itemStack.hasItemMeta()) { ItemMeta itemMeta = itemStack.getItemMeta(); - if(itemMeta.hasDisplayName()) { + if (itemMeta.hasDisplayName()) { name = itemMeta.getDisplayName().replace('§', '&'); } - if(itemMeta.hasLore()) { + if (itemMeta.hasLore()) { lore = new ArrayList<>(); - for(String string : itemMeta.getLore()) { + for (String string : itemMeta.getLore()) { lore.add(string.replace('§', '&')); } } - if(itemMeta.hasEnchants()) { + if (itemMeta.hasEnchants()) { enchants = this.enchantConverter.to(itemMeta.getEnchants()); } - if(itemMeta instanceof SkullMeta) { + if (itemMeta instanceof SkullMeta) { SkullMeta skullMeta = (SkullMeta) itemMeta; - if(skullMeta.hasOwner()) { + if (skullMeta.hasOwner()) { skullOwner = skullMeta.getOwner(); } } - if(itemMeta instanceof BlockStateMeta) { + if (itemMeta instanceof BlockStateMeta) { BlockStateMeta blockStateMeta = (BlockStateMeta) itemMeta; BlockState blockState = blockStateMeta.getBlockState(); - if(blockState instanceof CreatureSpawner) { + if (blockState instanceof CreatureSpawner) { CreatureSpawner creatureSpawner = (CreatureSpawner) blockState; spawnerId = creatureSpawner.getSpawnedType().getTypeId(); @@ -98,13 +98,13 @@ public class ItemStackConverter implements IReplaceableConverter replaceMap) { ItemStack itemStack = new ItemStack(Material.AIR); - if(itemStackHolder == null) return itemStack; - if(itemStackHolder.getType() == null) return itemStack; + if (itemStackHolder == null) return itemStack; + if (itemStackHolder.getType() == null) return itemStack; String type = itemStackHolder.getType(); Material material = this.materialConverter.from(type); - if(material == null) return itemStack; + if (material == null) return itemStack; itemStack.setType(material); @@ -113,20 +113,20 @@ public class ItemStackConverter implements IReplaceableConverter lore = itemStackHolder.getLore(), enchants = itemStackHolder.getEnchants(); - if(type.contains(":")) { + if (type.contains(":")) { durability = Short.valueOf(type.split(":")[1]); } - if(durability != null) itemStack.setDurability(durability); - if(enchants != null) itemStack.addUnsafeEnchantments(this.enchantConverter.from(enchants)); + if (durability != null) itemStack.setDurability(durability); + if (enchants != null) itemStack.addUnsafeEnchantments(this.enchantConverter.from(enchants)); - if(name != null || skullOwner != null || lore != null || spawnerId != null) { + if (name != null || skullOwner != null || lore != null || spawnerId != null) { ItemMeta itemMeta = itemStack.getItemMeta(); //----------- // SET NAME //----------- - if(name != null) { + if (name != null) { name = StringUtils.get().translateColor(name); itemMeta.setDisplayName(replaceString(name, replaceMap)); @@ -135,7 +135,7 @@ public class ItemStackConverter implements IReplaceableConverter replacedLore = new ArrayList<>(lore); replacedLore.replaceAll(s -> s.replace('&', '§')); @@ -147,12 +147,12 @@ public class ItemStackConverter implements IReplaceableConverter 1) { + if (amount != null && amount > 1) { itemStack.setAmount(amount); } @@ -173,10 +173,10 @@ public class ItemStackConverter implements IReplaceableConverter replaceMap) { - if(replaceMap == null) return input; + if (replaceMap == null) return input; - for(String replaceKey : replaceMap.keySet()) { - if(input.contains(replaceKey)) { + for (String replaceKey : replaceMap.keySet()) { + if (input.contains(replaceKey)) { input = input.replace(replaceKey, replaceMap.get(replaceKey)); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java index 97cdb63..6e8b0d8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java @@ -18,7 +18,7 @@ public class ItemStackHolderConverter implements IConverter, Map to(Map enchantmentIntegerMap) { List enchants = new ArrayList<>(); - for(Map.Entry entry : enchantmentIntegerMap.entrySet()) { + for (Map.Entry entry : enchantmentIntegerMap.entrySet()) { int level = entry.getValue(); Enchantment enchantment = entry.getKey(); EnchantFinder enchantFinder = EnchantFinder.getByEnchant(enchantment); - if(enchantFinder == null) continue; + if (enchantFinder == null) continue; enchants.add(enchantFinder.getFancyName() + ":" + level); } @@ -37,13 +37,13 @@ public class EnchantConverter implements IConverter, Map from(List strings) { Map enchantments = new HashMap<>(); - for(String s : strings) { + for (String s : strings) { String[] split = s.split(":"); String fancyName = split[0]; Integer level = Integer.parseInt(split[1]); EnchantFinder enchantFinder = EnchantFinder.getByName(fancyName); - if(enchantFinder == null) continue; + if (enchantFinder == null) continue; enchantments.put(enchantFinder.getEnchantment(), level); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/converters/MaterialConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/converters/MaterialConverter.java index 14b217f..41fbd32 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/converters/MaterialConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/converters/MaterialConverter.java @@ -19,13 +19,13 @@ public class MaterialConverter implements IConverter { @Override public Material from(String input) { - if(input.contains(":")) { + if (input.contains(":")) { String[] split = input.split(":"); input = split[0]; } - if(NumberUtils.get().isInt(input)) { + if (NumberUtils.get().isInt(input)) { return MaterialUtils.fromId(NumberUtils.get().getInteger(input)); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java index 57ed006..a3a1029 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/Panel.java @@ -63,7 +63,8 @@ public class Panel implements Listener, ICloneable { private int viewers = 0; private PageAction onPageChange = (player, currentPage, requestedPage) -> false; - private PanelCloseAction panelClose = (p) -> {}; + private PanelCloseAction panelClose = (p) -> { + }; //-------------------------------------------------- // @@ -75,12 +76,12 @@ public class Panel implements Listener, ICloneable { * Creates a Panel with the specified arguments * * @param title - Panel title - * @param size - Panel size + * @param size - Panel size */ public Panel(String title, int size) { Bukkit.getPluginManager().registerEvents(this, PLUGIN); - if(size % 9 != 0 && size != 5) { + if (size % 9 != 0 && size != 5) { throw new UnsupportedOperationException("Inventory size must be a multiple of 9 or 5"); } @@ -94,7 +95,7 @@ public class Panel implements Listener, ICloneable { * Creates a Panel with the specified arguments * * @param inventory - Panel inventory - * @param title - Panel title + * @param title - Panel title */ public Panel(Inventory inventory, String title) { this(inventory, title, null, null); @@ -103,10 +104,10 @@ public class Panel implements Listener, ICloneable { /** * Creates a Panel with the specified arguments * - * @param inventory - Panel inventory - * @param title - Panel title + * @param inventory - Panel inventory + * @param title - Panel title * @param panelBuilderSettings - Panel builder settings - * @param panelBuilderCounter - Panel builder counter + * @param panelBuilderCounter - Panel builder counter */ public Panel(Inventory inventory, String title, PanelBuilderSettings panelBuilderSettings, PanelBuilderCounter panelBuilderCounter) { Bukkit.getPluginManager().registerEvents(this, PLUGIN); @@ -136,35 +137,25 @@ public class Panel implements Listener, ICloneable { // //-------------------------------------------------- + public static void setPlugin(JavaPlugin javaPlugin) { + PLUGIN = javaPlugin; + } + @EventHandler protected void onClick(InventoryClickEvent event) { - if(event.getInventory() == null || event.getCursor() == null || getInventory() == null) return; - if(!getInventory().equals(event.getInventory())) return; + if (event.getInventory() == null || event.getCursor() == null || getInventory() == null) return; + if (!getInventory().equals(event.getInventory())) return; Player player = (Player) event.getWhoClicked(); - if(isCancelLowerClick() && isLowerClick(event.getRawSlot())) { + if (isCancelLowerClick() && isLowerClick(event.getRawSlot())) { event.setCancelled(true); return; } - if(getClickSound() != null) player.playSound(player.getLocation(), getClickSound(), 3F, 1F); - if(isCancelClick()) event.setCancelled(true); - if(getInventory().equals(inventory)) executeAction(event.getSlot(), event); - } - - @EventHandler - protected void onClose(InventoryCloseEvent event) { - if(event.getInventory() == null || getInventory() == null) return; - if(!getInventory().equals(event.getInventory())) return; - - Player player = (Player) event.getPlayer(); - - this.panelClose.onClose(player); - this.openedUsers.remove(player.getUniqueId()); - this.viewers--; - - if(getViewers() <= 0 && isDestroyWhenDone()) destroy(); + if (getClickSound() != null) player.playSound(player.getLocation(), getClickSound(), 3F, 1F); + if (isCancelClick()) event.setCancelled(true); + if (getInventory().equals(inventory)) executeAction(event.getSlot(), event); } //-------------------------------------------------- @@ -173,11 +164,25 @@ public class Panel implements Listener, ICloneable { // //-------------------------------------------------- + @EventHandler + protected void onClose(InventoryCloseEvent event) { + if (event.getInventory() == null || getInventory() == null) return; + if (!getInventory().equals(event.getInventory())) return; + + Player player = (Player) event.getPlayer(); + + this.panelClose.onClose(player); + this.openedUsers.remove(player.getUniqueId()); + this.viewers--; + + if (getViewers() <= 0 && isDestroyWhenDone()) destroy(); + } + /** * Used to set an action for when a player clicks * the panel. * - * @param slot - the slot for the action to happen + * @param slot - the slot for the action to happen * @param clickAction - the action to happen * @return an instance of the Panel. */ @@ -218,7 +223,7 @@ public class Panel implements Listener, ICloneable { * @param item - the item to be set. * @return an instance of the Panel. */ - public Panel setItem(int slot, ItemStack item){ + public Panel setItem(int slot, ItemStack item) { this.inventory.setItem(slot, item); return this; } @@ -228,8 +233,8 @@ public class Panel implements Listener, ICloneable { * panel and for an action to also be set to that * specified slot. * - * @param slot - the slot for the action and item to be set to - * @param item - the item to be set + * @param slot - the slot for the action and item to be set to + * @param item - the item to be set * @param action - the action to be applied * @return an instance of the Panel. */ @@ -239,18 +244,6 @@ public class Panel implements Listener, ICloneable { return setOnClick(slot, action); } - /** - * Used to set the click sound for when a player - * clicks the panel. - * - * @param clickSound - the sound to be played. - * @return an instance of the Panel. - */ - public Panel setClickSound(Sound clickSound) { - this.clickSound = clickSound; - return this; - } - /** * Used to open the panel for the specified player. * @@ -288,41 +281,6 @@ public class Panel implements Listener, ICloneable { return this; } - /** - * Used to set if clicks are cancelled in the panel. - * - * @param cancelClick - boolean if clicks are cancelled. - * @return an instance of the Panel. - */ - public Panel setCancelClick(boolean cancelClick) { - this.cancelClick = cancelClick; - return this; - } - - /** - * Used to specify if the panel is destroyed when the - * last person closes it. - * - * @param destroyWhenDone - the boolean to set if the panel destroys on close. - * @return an instance of the Panel. - */ - public Panel setDestroyWhenDone(boolean destroyWhenDone) { - this.destroyWhenDone = destroyWhenDone; - return this; - } - - /** - * Used to set if the click is cancelled on the bottom - * GUI. - * - * @param cancelClick - if the click is cancelled. - * @return an instance of the Panel. - */ - public Panel setCancelLowerClick(boolean cancelClick) { - this.cancelLowerClick = cancelClick; - return this; - } - public boolean isLowerClick(int rawSlot) { return rawSlot >= inventory.getSize(); } @@ -336,7 +294,7 @@ public class Panel implements Listener, ICloneable { * @return the current Panel */ public Panel setParentPanel(Panel parentPanel) { - if(!this.panelBuilderSettings.isBackButton()) return this; + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -349,14 +307,14 @@ public class Panel implements Listener, ICloneable { * will be used if the Back Button is also set up for this * panel. * - * @param panelBuilder - the parent panelBuilder - * @param cancelClick - cancelClick on the parent panel + * @param panelBuilder - the parent panelBuilder + * @param cancelClick - cancelClick on the parent panel * @param cancelLowerClick - cancelLowerClick on the parent panel - * @param destroyWhenDone - destroy parent panel when done + * @param destroyWhenDone - destroy parent panel when done * @return the current Panel */ public Panel setParentPanel(PanelBuilder panelBuilder, boolean cancelClick, boolean destroyWhenDone, boolean cancelLowerClick) { - if(!this.panelBuilderSettings.isBackButton()) return this; + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -380,7 +338,7 @@ public class Panel implements Listener, ICloneable { * @return the current Panel */ public Panel setParentPanelHandler(IPanelHandler panelHandler) { - if(!this.panelBuilderSettings.isBackButton()) return this; + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -394,11 +352,11 @@ public class Panel implements Listener, ICloneable { * panel. * * @param variablePanelHandler - the parent variable panel handler - * @param variable - the variable to handle when opening the parent panel + * @param variable - the variable to handle when opening the parent panel * @return the current Panel */ public Panel setParentPanelHandler(IVariablePanelHandler variablePanelHandler, T variable) { - if(!this.panelBuilderSettings.isBackButton()) return this; + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -412,12 +370,12 @@ public class Panel implements Listener, ICloneable { * panel. * * @param variablePanelHandler - the parent variable panel handler - * @param variable - the main variable to handle when opening the parent panel - * @param subVariable - the sub variable to handle when opening the parent panel + * @param variable - the main variable to handle when opening the parent panel + * @param subVariable - the sub variable to handle when opening the parent panel * @return the current Panel */ public Panel setParentPanelHandler(ISubVariablePanelHandler variablePanelHandler, T variable, Y subVariable) { - if(!this.panelBuilderSettings.isBackButton()) return this; + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -425,8 +383,8 @@ public class Panel implements Listener, ICloneable { return this; } - public Panel setParentPanelHandler(ISubSubVariablePanelHandler panelHandler, T variable, Y subVariable, Z subSubVariable) { - if(!this.panelBuilderSettings.isBackButton()) return this; + public Panel setParentPanelHandler(ISubSubVariablePanelHandler panelHandler, T variable, Y subVariable, Z subSubVariable) { + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -441,7 +399,7 @@ public class Panel implements Listener, ICloneable { * @return the current panel */ public Panel setExitButton() { - if(!this.panelBuilderSettings.isExitButton()) return this; + if (!this.panelBuilderSettings.isExitButton()) return this; int slot = this.panelBuilderSettings.getExitButtonSlot(); @@ -449,17 +407,10 @@ public class Panel implements Listener, ICloneable { return this; } - - //-------------------------------------------------- - // - // O T H E R P A N E L M E T H O D S - // - //-------------------------------------------------- - /** * Used to destroy a panel, no matter how many people * are in it or what's happening in it. - * + *

* ** ONLY USE THIS IF YOU KNOW WHAT YOU'RE DOING ** */ public void destroy() { @@ -471,7 +422,7 @@ public class Panel implements Listener, ICloneable { this.openedUsers.forEach(uuid -> { Player player = Bukkit.getPlayer(uuid); - if(player == null) return; + if (player == null) return; player.closeInventory(); }); @@ -491,10 +442,10 @@ public class Panel implements Listener, ICloneable { public Inventory cloneInventory() { Inventory newInventory = Bukkit.createInventory(this.inventory.getHolder(), this.inventory.getSize(), this.title); - for(int i = 0; i < this.inventory.getSize(); i++) { + for (int i = 0; i < this.inventory.getSize(); i++) { ItemStack itemStack = this.inventory.getItem(i); - if(itemStack == null) continue; + if (itemStack == null) continue; newInventory.setItem(i, itemStack); } @@ -521,10 +472,10 @@ public class Panel implements Listener, ICloneable { panel.onPageChange = this.onPageChange; panel.panelClose = this.panelClose; - for(int i = 0; i < this.inventory.getSize(); i++) { + for (int i = 0; i < this.inventory.getSize(); i++) { ItemStack itemStack = this.inventory.getItem(i); - if(itemStack != null) { + if (itemStack != null) { panel.inventory.setItem(i, itemStack); } } @@ -532,9 +483,10 @@ public class Panel implements Listener, ICloneable { return panel; } + //-------------------------------------------------- // - // P A N E L P A G E M E T H O D S + // O T H E R P A N E L M E T H O D S // //-------------------------------------------------- @@ -542,15 +494,15 @@ public class Panel implements Listener, ICloneable { * Load the specified page of the list panel * with the new page data. * - * @param page - page number to load + * @param page - page number to load * @param pageHandler - page handler that is used when loading the page */ public void loadPage(int page, IPageHandler pageHandler) { int fillTo = getPanelBuilderSettings().getFillTo(); int startIndex = page * fillTo; - for(int i = startIndex; i < startIndex + fillTo; i++) { - pageHandler.handleSlot(i, i-startIndex); + for (int i = startIndex; i < startIndex + fillTo; i++) { + pageHandler.handleSlot(i, i - startIndex); } } @@ -572,52 +524,46 @@ public class Panel implements Listener, ICloneable { * @param map - the map to gain size from * @return integer amount of pages */ - public int getMaxPage(Map map) { + public int getMaxPage(Map map) { return (int) Math.ceil((double) map.size() / (double) getPanelBuilderSettings().getFillTo()) - 1; } //-------------------------------------------------- // - // P A N E L E X E C U T E A C T I O N + // P A N E L P A G E M E T H O D S // //-------------------------------------------------- private void executeAction(int slot, InventoryClickEvent e) { Player clicker = (Player) e.getWhoClicked(); - if(getPanelBuilderCounter().getPageData().containsKey(slot)) { + if (getPanelBuilderCounter().getPageData().containsKey(slot)) { int currentPage = this.currentPageContainer.getOrDefault(clicker.getUniqueId(), 0); - if(getPanelBuilderCounter().getPageData().get(slot) > 0) { - if(this.onPageChange.onPageAction(clicker, currentPage, currentPage+1)) { - this.currentPageContainer.put(clicker.getUniqueId(), currentPage+1); + if (getPanelBuilderCounter().getPageData().get(slot) > 0) { + if (this.onPageChange.onPageAction(clicker, currentPage, currentPage + 1)) { + this.currentPageContainer.put(clicker.getUniqueId(), currentPage + 1); } } else { - if(currentPage != 0) { - if (this.onPageChange.onPageAction(clicker, currentPage, currentPage-1)) { + if (currentPage != 0) { + if (this.onPageChange.onPageAction(clicker, currentPage, currentPage - 1)) { this.currentPageContainer.put(clicker.getUniqueId(), currentPage - 1); } } } } - if(this.targettedSlotActions.containsKey(slot)) { + if (this.targettedSlotActions.containsKey(slot)) { this.targettedSlotActions.get(slot).onClick(e); } - if(!this.allSlotActions.isEmpty()) { - for(ClickAction clickAction : this.allSlotActions) { + if (!this.allSlotActions.isEmpty()) { + for (ClickAction clickAction : this.allSlotActions) { clickAction.onClick(e); } } } - //-------------------------------------------------- - // - // P A N E L P R I V A T E M E T H O D - // - //-------------------------------------------------- - /** * Used to fill the empty spaces in the panel with the specified * EmptySpaceFiller item if it's set up in the config. @@ -625,45 +571,88 @@ public class Panel implements Listener, ICloneable { private void fillEmptySpace() { ItemStackHolder itemStackHolder = this.panelBuilderSettings.getEmptySpaceFillerItem(); - if(itemStackHolder == null) return; + if (itemStackHolder == null) return; ItemStack itemStack = ITEM_STACK_CONVERTER.from(itemStackHolder); - if(itemStack == null) return; + if (itemStack == null) return; - for(int i = 0; i < getInventory().getSize(); i++) { + for (int i = 0; i < getInventory().getSize(); i++) { ItemStack itemAtSlot = getInventory().getItem(i); - if(getPanelBuilderCounter().isButtonAtSlot(i)) continue; + if (getPanelBuilderCounter().isButtonAtSlot(i)) continue; - if(itemAtSlot == null || itemAtSlot.getType() == Material.AIR) { + if (itemAtSlot == null || itemAtSlot.getType() == Material.AIR) { getInventory().setItem(i, itemStack); } } } + public boolean isCancelClick() { + return this.cancelClick; + } + + //-------------------------------------------------- + // + // P A N E L E X E C U T E A C T I O N + // + //-------------------------------------------------- + + /** + * Used to set if clicks are cancelled in the panel. + * + * @param cancelClick - boolean if clicks are cancelled. + * @return an instance of the Panel. + */ + public Panel setCancelClick(boolean cancelClick) { + this.cancelClick = cancelClick; + return this; + } + + //-------------------------------------------------- + // + // P A N E L P R I V A T E M E T H O D + // + //-------------------------------------------------- + + public boolean isDestroyWhenDone() { + return this.destroyWhenDone; + } + //-------------------------------------------------- // // P A N E L S T A T I C M E T H O D // //-------------------------------------------------- - public static void setPlugin(JavaPlugin javaPlugin) { - PLUGIN = javaPlugin; - } - - public boolean isCancelClick() { - return this.cancelClick; - } - - public boolean isDestroyWhenDone() { - return this.destroyWhenDone; + /** + * Used to specify if the panel is destroyed when the + * last person closes it. + * + * @param destroyWhenDone - the boolean to set if the panel destroys on close. + * @return an instance of the Panel. + */ + public Panel setDestroyWhenDone(boolean destroyWhenDone) { + this.destroyWhenDone = destroyWhenDone; + return this; } public boolean isCancelLowerClick() { return this.cancelLowerClick; } + /** + * Used to set if the click is cancelled on the bottom + * GUI. + * + * @param cancelClick - if the click is cancelled. + * @return an instance of the Panel. + */ + public Panel setCancelLowerClick(boolean cancelClick) { + this.cancelLowerClick = cancelClick; + return this; + } + public PanelBuilderSettings getPanelBuilderSettings() { return this.panelBuilderSettings; } @@ -676,6 +665,18 @@ public class Panel implements Listener, ICloneable { return this.clickSound; } + /** + * Used to set the click sound for when a player + * clicks the panel. + * + * @param clickSound - the sound to be played. + * @return an instance of the Panel. + */ + public Panel setClickSound(Sound clickSound) { + this.clickSound = clickSound; + return this; + } + public String getTitle() { return this.title; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/BasePanelHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/BasePanelHandler.java index 8fbe983..033320e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/BasePanelHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/base/handlers/BasePanelHandler.java @@ -14,9 +14,8 @@ import org.bukkit.configuration.ConfigurationSection; public abstract class BasePanelHandler implements IBasicPanelHandler { protected final BossPanelManager bossPanelManager; - - private PanelBuilder panelBuilder; protected Panel panel = null; + private PanelBuilder panelBuilder; public BasePanelHandler(BossPanelManager bossPanelManager, ConfigurationSection configurationSection) { this(bossPanelManager, new PanelBuilder(configurationSection)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java index ee182f0..4bde6aa 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilder.java @@ -42,7 +42,7 @@ public class PanelBuilder { this.panelBuilderCounter = new PanelBuilderCounter(); this.configurationSection = configurationSection; - if(replaceMap != null) this.replaceMap.putAll(replaceMap); + if (replaceMap != null) this.replaceMap.putAll(replaceMap); } public PanelBuilder setSize(int size) { @@ -51,7 +51,7 @@ public class PanelBuilder { } public PanelBuilder addReplaceData(Map replaceMap) { - if(replaceMap != null) this.replaceMap.putAll(replaceMap); + if (replaceMap != null) this.replaceMap.putAll(replaceMap); return this; } @@ -80,10 +80,10 @@ public class PanelBuilder { Map clickActionMap = this.panelBuilderCounter.getClickActions(); this.panelBuilderCounter.getSlotsWithCounter().forEach((identifier, slotsWith) -> { - if(itemStackMap.containsKey(identifier)) { + if (itemStackMap.containsKey(identifier)) { slotsWith.forEach(slot -> panel.setItem(slot, itemStackMap.get(identifier))); } - if(clickActionMap.containsKey(identifier)) { + if (clickActionMap.containsKey(identifier)) { slotsWith.forEach(slot -> panel.setOnClick(slot, clickActionMap.get(identifier))); } }); @@ -92,26 +92,28 @@ public class PanelBuilder { } private void build() { - String name = configurationSection.contains("name")? StringUtils.get().translateColor(configurationSection.getString("name")) : "?!? naming convention error ?!?"; - int slots = this.size != 0? this.size : configurationSection.contains("slots")? configurationSection.getInt("slots") : 9; - ConfigurationSection itemSection = configurationSection.contains("Items")? configurationSection.getConfigurationSection("Items") : null; + String name = configurationSection.contains("name") ? StringUtils.get().translateColor(configurationSection.getString("name")) : "?!? naming convention error ?!?"; + int slots = this.size != 0 ? this.size : configurationSection.contains("slots") ? configurationSection.getInt("slots") : 9; + ConfigurationSection itemSection = configurationSection.contains("Items") ? configurationSection.getConfigurationSection("Items") : null; name = replace(name); this.title = name; this.inventory = Bukkit.createInventory(null, slots, name); - if(itemSection != null) { + if (itemSection != null) { Map> slotsWith = this.panelBuilderCounter.getSlotsWithCounter(); Map> specialSlotsWith = this.panelBuilderCounter.getSpecialValuesCounter(); - for(String s : itemSection.getKeys(false)) { - int slot = NumberUtils.get().isInt(s)? Integer.valueOf(s) - 1 : 0; + for (String s : itemSection.getKeys(false)) { + int slot = NumberUtils.get().isInt(s) ? Integer.valueOf(s) - 1 : 0; ConfigurationSection innerSection = itemSection.getConfigurationSection(s); - if(innerSection.contains("NextPage") && innerSection.getBoolean("NextPage")) this.panelBuilderCounter.addPageData(slot, 1); - if(innerSection.contains("PreviousPage") && innerSection.getBoolean("PreviousPage")) this.panelBuilderCounter.addPageData(slot, -1); + if (innerSection.contains("NextPage") && innerSection.getBoolean("NextPage")) + this.panelBuilderCounter.addPageData(slot, 1); + if (innerSection.contains("PreviousPage") && innerSection.getBoolean("PreviousPage")) + this.panelBuilderCounter.addPageData(slot, -1); - if(innerSection.contains("Button")) { + if (innerSection.contains("Button")) { String identifier = innerSection.getString("Button"); Set current = slotsWith.getOrDefault(identifier, new HashSet<>()); @@ -119,8 +121,8 @@ public class PanelBuilder { this.panelBuilderCounter.getSlotsWithCounter().put(identifier, current); } - for(String identifier : specialSlotsWith.keySet()) { - if(innerSection.contains(identifier)) { + for (String identifier : specialSlotsWith.keySet()) { + if (innerSection.contains(identifier)) { Map current = specialSlotsWith.get(identifier); current.put(slot, innerSection.get(identifier)); @@ -128,12 +130,12 @@ public class PanelBuilder { } } - if(slot > inventory.getSize() - 1) continue; + if (slot > inventory.getSize() - 1) continue; this.defaultSlots.add(slot); - if(innerSection.contains("Item")) innerSection = innerSection.getConfigurationSection("Item"); - if(!innerSection.contains("type")) continue; + if (innerSection.contains("Item")) innerSection = innerSection.getConfigurationSection("Item"); + if (!innerSection.contains("type")) continue; this.inventory.setItem(slot, ItemStackUtils.createItemStack(innerSection, 1, replaceMap)); } @@ -141,8 +143,8 @@ public class PanelBuilder { } private String replace(String input) { - for(Map.Entry entry : replaceMap.entrySet()) { - if(input.contains(entry.getKey())) { + for (Map.Entry entry : replaceMap.entrySet()) { + if (input.contains(entry.getKey())) { input = input.replace(entry.getKey(), entry.getValue()); } } @@ -150,7 +152,7 @@ public class PanelBuilder { String nameKey = "{name}"; //Apply replace twice, to go over any missed replaced values, or new values that had been set in the replacement - if(replaceMap.containsKey(nameKey) && input.contains(nameKey)) { + if (replaceMap.containsKey(nameKey) && input.contains(nameKey)) { input = input.replace(nameKey, replaceMap.get(nameKey)); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java index 8e92f1f..cd3bcfd 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderCounter.java @@ -24,11 +24,11 @@ public class PanelBuilderCounter { public boolean isButtonAtSlot(int slot) { for (Set integers : this.slotsWithCounter.values()) { - if(integers.contains(slot)) return true; + if (integers.contains(slot)) return true; } - for(Map map : this.specialValuesCounter.values()) { - if(map.containsKey(slot)) return true; + for (Map map : this.specialValuesCounter.values()) { + if (map.containsKey(slot)) return true; } return false; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java index 64aa7b8..8dd1329 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/panel/builder/PanelBuilderSettings.java @@ -21,11 +21,11 @@ public class PanelBuilderSettings { ConfigurationSection buttonsSection = configurationSection.getConfigurationSection("Buttons"); this.emptySpaceFiller = settingsSection != null && settingsSection.getBoolean("emptySpaceFiller", false); - this.backButton = settingsSection != null && settingsSection.getBoolean("backButton", false); - this.exitButton = settingsSection != null && settingsSection.getBoolean("exitButton", false); - this.fillTo = settingsSection == null? 0 : settingsSection.getInt("fillTo", 0); - this.backButtonSlot = buttonsSection == null? -1 : buttonsSection.getInt("backButton", -1); - this.exitButtonSlot = buttonsSection == null? -1 : buttonsSection.getInt("exitButton", -1); + this.backButton = settingsSection != null && settingsSection.getBoolean("backButton", false); + this.exitButton = settingsSection != null && settingsSection.getBoolean("exitButton", false); + this.fillTo = settingsSection == null ? 0 : settingsSection.getInt("fillTo", 0); + this.backButtonSlot = buttonsSection == null ? -1 : buttonsSection.getInt("backButton", -1); + this.exitButtonSlot = buttonsSection == null ? -1 : buttonsSection.getInt("exitButton", -1); this.emptySpaceFillerItem = itemStackHolderConverter.to(configurationSection.getConfigurationSection("EmptySpaceFiller")); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/PotionEffectConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/PotionEffectConverter.java index 31b9ac5..85c7748 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/PotionEffectConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/PotionEffectConverter.java @@ -25,7 +25,7 @@ public class PotionEffectConverter implements IConverter { updateTarget(); - if(this.currentTarget == null || this.currentTarget.isDead()) return; + if (this.currentTarget == null || this.currentTarget.isDead()) return; createAutoTarget(); }); } - } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUnit.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUnit.java index a7b33af..1492384 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUnit.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUnit.java @@ -4,7 +4,7 @@ package com.songoda.epicbosses.utils.time; * @author AMinecraftDev * @version 1.0.0 * @since 23-May-17 - * + *

* Makes it easy to convert * time */ @@ -26,29 +26,6 @@ public enum TimeUnit { this.seconds = seconds; } - /** - * Returns a double, representing - * the amount of time in the requested - * TimeUnit - * - * @param timeUnit TimeUnit - * @param input double - * @return double - */ - public double to(TimeUnit timeUnit, double input) { - return (input*seconds) / timeUnit.getSeconds(); - } - - /** - * Returns the amound of seconds - * that fit into this TimeUnit - * - * @return double - */ - public double getSeconds() { - return seconds; - } - /** * Returns the TimeUnit that belongs * to the specified String @@ -100,4 +77,27 @@ public enum TimeUnit { } } + /** + * Returns a double, representing + * the amount of time in the requested + * TimeUnit + * + * @param timeUnit TimeUnit + * @param input double + * @return double + */ + public double to(TimeUnit timeUnit, double input) { + return (input * seconds) / timeUnit.getSeconds(); + } + + /** + * Returns the amound of seconds + * that fit into this TimeUnit + * + * @return double + */ + public double getSeconds() { + return seconds; + } + } \ No newline at end of file diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUtil.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUtil.java index c20b132..97f4356 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUtil.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/time/TimeUtil.java @@ -6,7 +6,7 @@ public class TimeUtil { * Returns the amount of time in the * requested TimeUnit from a formatted string * - * @param string String + * @param string String * @param timeUnit TimeUnit * @return double * @throws IllegalArgumentException when the string is formatted wrongly @@ -16,41 +16,41 @@ public class TimeUtil { String timeString = string.trim().toLowerCase(); - if(timeString.contains(" ")) { + if (timeString.contains(" ")) { String[] split = timeString.split(" "); - for(String line : split) { + for (String line : split) { int index = 0; - while(isInteger(String.valueOf(line.charAt(index)))) { + while (isInteger(String.valueOf(line.charAt(index)))) { index++; } int time = Integer.parseInt(line.substring(0, index)); - String unit = line.substring(index+1, line.length()); + String unit = line.substring(index + 1, line.length()); TimeUnit tempUnit = TimeUnit.fromString(unit); - if(tempUnit == null) throw new IllegalArgumentException("Invalid time format: " + unit); + if (tempUnit == null) throw new IllegalArgumentException("Invalid time format: " + unit); seconds += tempUnit.to(TimeUnit.SECONDS, time); } } else { int index = 0; int prevIndex = 0; - while(index < timeString.length()-1) { + while (index < timeString.length() - 1) { double time; - while(isInteger(String.valueOf(timeString.charAt(index)))) { + while (isInteger(String.valueOf(timeString.charAt(index)))) { index++; } time = Integer.parseInt(timeString.substring(prevIndex, index)); prevIndex = index; - while(!isInteger(String.valueOf(timeString.charAt(index)))) { + while (!isInteger(String.valueOf(timeString.charAt(index)))) { index++; - if(index >= timeString.length()) break; + if (index >= timeString.length()) break; } String unit = timeString.substring(prevIndex, index); TimeUnit tempUnit = TimeUnit.fromString(unit); - if(tempUnit == null) throw new IllegalArgumentException("Invalid time format: " + unit); + if (tempUnit == null) throw new IllegalArgumentException("Invalid time format: " + unit); seconds += tempUnit.to(TimeUnit.SECONDS, time); @@ -66,7 +66,7 @@ public class TimeUtil { * belonging to this amount of time * * @param unit TimeUnit - * @param a int amount of time + * @param a int amount of time * @return String */ public static String getFormattedTime(TimeUnit unit, int a) { @@ -77,8 +77,8 @@ public class TimeUtil { * Returns the formatted time string * belonging to this amount of time * - * @param unit TimeUnit - * @param a int amount of time + * @param unit TimeUnit + * @param a int amount of time * @param splitter String * @return String */ @@ -100,7 +100,7 @@ public class TimeUtil { StringBuilder sb = new StringBuilder(); - if(splitter == null) { + if (splitter == null) { if (years > 0) { sb.append(years).append(" year").append(years != 1 ? "s" : "").append(", "); } @@ -123,25 +123,25 @@ public class TimeUtil { sb.append(minutes > 0 ? "and " : "").append(seconds).append(" second").append(seconds != 1 ? "s" : ""); } } else { - if(years > 0) { + if (years > 0) { sb.append(years).append(splitter); } - if(months > 0 || sb.length() > 0) { + if (months > 0 || sb.length() > 0) { sb.append(months).append(splitter); } - if(weeks > 0 || sb.length() > 0) { + if (weeks > 0 || sb.length() > 0) { sb.append(weeks).append(splitter); } - if(days > 0 || sb.length() > 0) { + if (days > 0 || sb.length() > 0) { sb.append(days).append(splitter); } - if(hours > 0 || sb.length() > 0) { + if (hours > 0 || sb.length() > 0) { sb.append(hours).append(splitter); } - if(minutes > 0 || sb.length() > 0) { + if (minutes > 0 || sb.length() > 0) { sb.append(minutes).append(splitter); } - if(seconds > 0 || sb.length() > 0) { + if (seconds > 0 || sb.length() > 0) { sb.append(seconds); } } diff --git a/plugin-modules/FactionHelper/pom.xml b/plugin-modules/FactionHelper/pom.xml index 08a26a4..d6415cb 100644 --- a/plugin-modules/FactionHelper/pom.xml +++ b/plugin-modules/FactionHelper/pom.xml @@ -1,6 +1,6 @@ - EpicBosses diff --git a/pom.xml b/pom.xml index 9f7a835..c4c506e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ - 4.0.0 From 0eae353afad60cef82bbc12fe438fc901e8ccf1f Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 18:34:11 -0400 Subject: [PATCH 05/16] Converted more versioning. --- plugin-modules/Core/resources-json/items.json | 25 +- plugin-modules/Core/resources-yml/display.yml | 216 +- plugin-modules/Core/resources-yml/editor.yml | 2006 ++++++++--------- .../com/songoda/epicbosses/EpicBosses.java | 14 +- .../epicbosses/autospawns/AutoSpawn.java | 38 +- .../epicbosses/autospawns/SpawnType.java | 22 +- .../handlers/IntervalSpawnHandler.java | 10 +- .../settings/AutoSpawnSettings.java | 40 +- .../types/IntervalSpawnElement.java | 42 +- .../container/BossEntityContainer.java | 10 +- .../container/MinionEntityContainer.java | 10 +- .../epicbosses/droptable/DropTable.java | 14 +- .../droptable/elements/DropTableElement.java | 16 +- .../elements/GiveTableSubElement.java | 48 +- .../droptable/elements/SprayTableElement.java | 24 +- .../handlers/AutoSpawnVariableHandler.java | 10 +- .../handlers/BossDisplayNameHandler.java | 6 +- .../handlers/SkillDisplayNameHandler.java | 6 +- .../listeners/after/BossDeathListener.java | 44 +- .../listeners/during/BossDamageListener.java | 16 +- .../listeners/during/BossSkillListener.java | 14 +- .../listeners/pre/BossSpawnListener.java | 34 +- .../epicbosses/managers/AutoSpawnManager.java | 20 +- .../managers/BossCommandManager.java | 3 +- .../managers/BossDropTableManager.java | 52 +- .../managers/BossEntityManager.java | 88 +- .../epicbosses/managers/BossHookManager.java | 6 +- .../managers/BossListenerManager.java | 2 +- .../managers/BossLocationManager.java | 5 +- .../managers/BossMechanicManager.java | 16 +- .../epicbosses/managers/BossPanelManager.java | 17 +- .../epicbosses/managers/BossSkillManager.java | 60 +- .../managers/BossTargetManager.java | 14 +- .../epicbosses/managers/BossTauntManager.java | 18 +- .../managers/MinionMechanicManager.java | 16 +- .../managers/files/AutoSpawnFileManager.java | 2 +- .../managers/files/BossesFileManager.java | 2 +- .../managers/files/CommandsFileManager.java | 2 +- .../managers/files/DropTableFileManager.java | 2 +- .../managers/files/MessagesFileManager.java | 2 +- .../mechanics/boss/EntityTypeMechanic.java | 12 +- .../mechanics/boss/EquipmentMechanic.java | 22 +- .../mechanics/boss/HealthMechanic.java | 8 +- .../mechanics/boss/PotionMechanic.java | 8 +- .../mechanics/boss/SettingsMechanic.java | 16 +- .../mechanics/boss/WeaponMechanic.java | 24 +- .../mechanics/minions/EntityTypeMechanic.java | 14 +- .../mechanics/minions/EquipmentMechanic.java | 23 +- .../mechanics/minions/HealthMechanic.java | 9 +- .../mechanics/minions/PotionMechanic.java | 8 +- .../mechanics/minions/SettingsMechanic.java | 17 +- .../mechanics/minions/WeaponMechanic.java | 21 +- .../epicbosses/skills/custom/Cage.java | 2 - .../epicbosses/skills/custom/Disarm.java | 4 +- .../epicbosses/targeting/TargetHandler.java | 20 +- .../targeting/types/ClosestTargetHandler.java | 4 +- .../types/NotDamagedNearbyTargetHandler.java | 6 +- .../types/TopDamagerTargetHandler.java | 2 +- .../utils/entity/handlers/DolphinHandler.java | 3 - .../utils/entity/handlers/DrownedHandler.java | 3 - .../entity/handlers/ElderGuardianHandler.java | 3 - .../entity/handlers/EndermiteHandler.java | 3 - .../utils/entity/handlers/FishHandler.java | 3 - .../utils/entity/handlers/FoxHandler.java | 3 - .../utils/entity/handlers/PandaHandler.java | 3 - .../entity/handlers/PillagerHandler.java | 3 - .../utils/entity/handlers/ShulkerHandler.java | 3 - .../handlers/WitherSkeletonHandler.java | 3 - .../utils/itemstack/ItemStackUtils.java | 2 - .../utils/version/VersionHandler.java | 33 - 70 files changed, 1595 insertions(+), 1682 deletions(-) delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java diff --git a/plugin-modules/Core/resources-json/items.json b/plugin-modules/Core/resources-json/items.json index ca8ed68..fcdd9cb 100644 --- a/plugin-modules/Core/resources-json/items.json +++ b/plugin-modules/Core/resources-json/items.json @@ -61,23 +61,38 @@ }, "SKHelmet": { "type": "GOLDEN_HELMET", - "enchants": [ "protection:4", "unbreaking:3" ] + "enchants": [ + "protection:4", + "unbreaking:3" + ] }, "SKChestplate": { "type": "GOLDEN_CHESTPLATE", - "enchants": [ "protection:4", "unbreaking:3" ] + "enchants": [ + "protection:4", + "unbreaking:3" + ] }, "SKLeggings": { "type": "GOLDEN_LEGGINGS", - "enchants": [ "protection:4", "unbreaking:3" ] + "enchants": [ + "protection:4", + "unbreaking:3" + ] }, "SKBoots": { "type": "DIAMOND_BOOTS", - "enchants": [ "protection:4", "unbreaking:3" ] + "enchants": [ + "protection:4", + "unbreaking:3" + ] }, "SKMainHand": { "type": "DIAMOND_SWORD", - "enchants": [ "sharpness:4", "unbreaking:3" ] + "enchants": [ + "sharpness:4", + "unbreaking:3" + ] }, "SKOffHand": { "type": "SHIELD" diff --git a/plugin-modules/Core/resources-yml/display.yml b/plugin-modules/Core/resources-yml/display.yml index 631c034..2f11c06 100644 --- a/plugin-modules/Core/resources-yml/display.yml +++ b/plugin-modules/Core/resources-yml/display.yml @@ -5,24 +5,24 @@ Display: selectedName: '&bMessage: &f{name} &a&l** Selected **' name: '&bMessage: &f{name}' lore: - - '&fStrings within this section:' - - '{message}' + - '&fStrings within this section:' + - '{message}' Commands: menuName: '&b&l{name} Editor' selectedName: '&bCommand: &f{name} &a&l** Selected **' name: '&bCommand: &f{name}' lore: - - '&fCommands within this section:' - - '{commands}' + - '&fCommands within this section:' + - '{commands}' Taunts: menuName: '&b&l{name} Editor' Drops: name: '&bDropTable: &f{name}' lore: - - '&3Type: &7{type}' - - '&7' - - '&7Click here to select this drop' - - '&7table as the current one.' + - '&3Type: &7{type}' + - '&7' + - '&7Click here to select this drop' + - '&7table as the current one.' Equipment: name: '{name} &a&l** Selected **' EntityType: @@ -32,144 +32,144 @@ Display: List: name: '&3{position} Entity' lore: - - '&3Left Click &8»' - - '&7Edit the {targetType} for this' - - '&7entity in the section.' - - '&7' - - '&3Right Click &8»' - - '&7Remove this section, can be done' - - '&7to anything above the first one.' + - '&3Left Click &8»' + - '&7Edit the {targetType} for this' + - '&7entity in the section.' + - '&7' + - '&3Right Click &8»' + - '&7Remove this section, can be done' + - '&7to anything above the first one.' Skills: menuName: '&b&l{name} Editor' selectedName: '&b&l{name} Skill &a&l** Selected **' name: '&b&l{name} Skill' lore: - - '&3Type: &7{type}' - - '&3Display Name: &7{displayName}' - - '&3Custom Message: &7{customMessage}' - - '&3Radius: &7{radius}' - - '&7' - - '&7Click to add/remove the skill to' - - '&7or from the boss skill list.' + - '&3Type: &7{type}' + - '&3Display Name: &7{displayName}' + - '&3Custom Message: &7{customMessage}' + - '&3Radius: &7{radius}' + - '&7' + - '&7Click to add/remove the skill to' + - '&7or from the boss skill list.' AutoSpawns: Main: menuName: '&b&lEpicBosses &3&lAutoSpawns' name: '&bAuto Spawn: &f{name}' lore: - - '&3Editing: &f{enabled}' - - '&7' - - '&3Spawn Type: &f{type}' - - '&3Entities: &f{entities}' - - '&7' - - '&3Max Alive: &f{maxAlive}' - - '&3Amount per Spawn: &f{amountPerSpawn}' - - '&3When Chunk Isnt Loaded: &f{chunkIsntLoaded}' - - '&3Override Spawn Messages: &f{overrideSpawnMessages}' - - '&3Shuffle Entities: &f{shuffleEntities}' - - '&3Custom Spawn Message: &f{customSpawnMessage}' + - '&3Editing: &f{enabled}' + - '&7' + - '&3Spawn Type: &f{type}' + - '&3Entities: &f{entities}' + - '&7' + - '&3Max Alive: &f{maxAlive}' + - '&3Amount per Spawn: &f{amountPerSpawn}' + - '&3When Chunk Isnt Loaded: &f{chunkIsntLoaded}' + - '&3Override Spawn Messages: &f{overrideSpawnMessages}' + - '&3Shuffle Entities: &f{shuffleEntities}' + - '&3Custom Spawn Message: &f{customSpawnMessage}' Entities: selectedName: '&bBoss: &f{name} &a** Selected **' name: '&bBoss: &f{name}' lore: - - '&3Editing: &f{editing}' - - '&3Targeting: &f{targeting}' - - '&3Drop Table: &f{dropTable}' - - '&7' - - '&7Click to select or deselect this boss.' + - '&3Editing: &f{editing}' + - '&3Targeting: &f{targeting}' + - '&3Drop Table: &f{dropTable}' + - '&7' + - '&7Click to select or deselect this boss.' CustomSettings: name: '&bCustom Setting: &f{name}' lore: - - '&3Currently: &f{currently}' - - '{extraInformation}' + - '&3Currently: &f{currently}' + - '{extraInformation}' SpawnMessage: menuName: '&b&l{name} AutoSpawn' selectedName: '&bMessage: &f{name} &a** Selected **' name: '&bMessage: &f{name}' lore: - - '&fStrings within this section:' - - '{message}' + - '&fStrings within this section:' + - '{message}' Bosses: menuName: '&b&lEpicBosses &3&lBosses' name: '&b&l{name}' lore: - - '&3Editing: &f{enabled}' - - '&7' - - '&3Left Click &8»' - - '&7Get spawn item for custom' - - '&7boss.' - - '&7' - - '&3Right Click &8»' - - '&7Edit the custom boss.' + - '&3Editing: &f{enabled}' + - '&7' + - '&3Left Click &8»' + - '&7Get spawn item for custom' + - '&7boss.' + - '&7' + - '&3Right Click &8»' + - '&7Edit the custom boss.' DropTable: Main: menuName: '&b&lEpicBosses &3&lDropTables' name: '&b&l{name} Drop Table' lore: - - '&3Type: &7{type}' - - '&7' - - '&7Click to edit the drop table.' + - '&3Type: &7{type}' + - '&7' + - '&7Click to edit the drop table.' RewardList: name: '&bReward Section' lore: - - '&3Selected Item: &f{itemName}' - - '&3Chance: &f{chance}%' - - '&7' - - '&7Click to modify this reward.' + - '&3Selected Item: &f{itemName}' + - '&3Chance: &f{chance}%' + - '&7' + - '&7Click to modify this reward.' CommandRewardList: name: '&bReward Section' lore: - - '&3Selected Command: &f{commandName}' - - '&3Chance: &f{chance}%' - - '&7' - - '&7Click to modify this reward.' + - '&3Selected Command: &f{commandName}' + - '&3Chance: &f{chance}%' + - '&7' + - '&7Click to modify this reward.' GivePositionList: name: '&bReward Section' lore: - - '&3Position: &f{position}' - - '&3Drops: &f{dropAmount}' - - '&7' - - '&7Shift Right-Click to remove.' - - '&7Left-Click to edit.' + - '&3Position: &f{position}' + - '&3Drops: &f{dropAmount}' + - '&7' + - '&7Shift Right-Click to remove.' + - '&7Left-Click to edit.' GiveRewardsList: name: '&bReward Section' lore: - - '&3Position: &f{position}' - - '&3Required Percentage: &f{percentage}%' - - '&7' - - '&3Item Drops: &f{items}' - - '&3Max Drops: &f{maxDrops}' - - '&3Random Drops: &f{randomDrops}' - - '&7' - - '&3Command Drops: &f{commands}' - - '&3Max Commands: &f{maxCommands}' - - '&3Random Commands: &f{randomCommands}' - - '&7' - - '&7Shift Right-Click to remove.' - - '&7Left-Click to edit.' + - '&3Position: &f{position}' + - '&3Required Percentage: &f{percentage}%' + - '&7' + - '&3Item Drops: &f{items}' + - '&3Max Drops: &f{maxDrops}' + - '&3Random Drops: &f{randomDrops}' + - '&7' + - '&3Command Drops: &f{commands}' + - '&3Max Commands: &f{maxCommands}' + - '&3Random Commands: &f{randomCommands}' + - '&7' + - '&7Shift Right-Click to remove.' + - '&7Left-Click to edit.' Shop: name: '&b&lBuy {name}''s Egg' lore: - - '&3Cost: &a$&f{price}' + - '&3Cost: &a$&f{price}' Skills: Main: menuName: '&b&lEpicBosses &3&lSkills' name: '&b&l{name} Skill' lore: - - '&3Type: &7{type}' - - '&3Display Name: &7{displayName}' - - '&3Custom Message: &7{customMessage}' - - '&3Radius: &7{radius}' - - '&7' - - '&7Click to edit the custom skill.' + - '&3Type: &7{type}' + - '&3Display Name: &7{displayName}' + - '&3Custom Message: &7{customMessage}' + - '&3Radius: &7{radius}' + - '&7' + - '&7Click to edit the custom skill.' MainEdit: menuName: '&b&l{name} Skill Editor' Potions: name: '&b&l{effect} Potion Effect' lore: - - '&3Duration: &7{duration}' - - '&3Level: &7{level}' - - '&7' - - '&7Click to remove potion effect.' + - '&3Duration: &7{duration}' + - '&3Level: &7{level}' + - '&7' + - '&7Click to remove potion effect.' CreatePotion: menuName: '&b&lSelect Potion Effect Type' name: '&bEffect: &f{effect}' @@ -177,35 +177,35 @@ Display: Commands: name: '&b&lCommand Section' lore: - - '&3Chance &8» &f{chance}%' - - '&7' - - '&3Commands &8»' - - '&f{commands}' - - '&7' - - '&7Click to edit command section.' + - '&3Chance &8» &f{chance}%' + - '&7' + - '&3Commands &8»' + - '&f{commands}' + - '&7' + - '&7Click to edit command section.' CommandList: menuName: '&b&l{name} Skill Editor' selectedName: '&bCommand: &f{name} &a&l** Selected **' name: '&bCommand: &f{name}' lore: - - '&fCommands within this section:' - - '{commands}' + - '&fCommands within this section:' + - '{commands}' Group: menuName: '&b&l{name} Skill Editor' selectedName: '&bSkill: &f{name} &a&l** Selected **' name: '&bSkill: &f{name}' lore: - - '&3Mode: &7{mode}' - - '&3Type: &7{type}' - - '&3Display Name: &7{displayName}' - - '&3Custom Message: &7{customMessage}' - - '&3Radius: &7{radius}' + - '&3Mode: &7{mode}' + - '&3Type: &7{type}' + - '&3Display Name: &7{displayName}' + - '&3Custom Message: &7{customMessage}' + - '&3Radius: &7{radius}' CustomType: selectedName: '&bCustom Skill: &f{name} &a** Selected **' name: '&bCustom Skill: &f{name}' lore: - - '&3Uses Multiplier: &7{multiplier}' - - '&3Has Custom Data: &7{customData}' + - '&3Uses Multiplier: &7{multiplier}' + - '&3Has Custom Data: &7{customData}' Material: menuName: '&b&lSelect Material' selectedName: '&bMaterial: &f{type} &a** Selected **' @@ -215,9 +215,9 @@ Display: selectedName: '&bMinion: &f{name} &a** Selected **' name: '&bMinion: &f{name}' lore: - - '&3Editing: &7{editing}' - - '&3Targeting: &7{targeting}' + - '&3Editing: &7{editing}' + - '&3Targeting: &7{targeting}' CustomSetting: name: '&bSetting: &f{setting}' lore: - - '&3Currently: &7{currently}' \ No newline at end of file + - '&3Currently: &7{currently}' \ No newline at end of file diff --git a/plugin-modules/Core/resources-yml/editor.yml b/plugin-modules/Core/resources-yml/editor.yml index 7d759da..7ad12c0 100644 --- a/plugin-modules/Core/resources-yml/editor.yml +++ b/plugin-modules/Core/resources-yml/editor.yml @@ -25,61 +25,61 @@ MainMenu: type: ZOMBIE_SPAWN_EGG name: '&b&lCustom Bosses' lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7custom bosses.' - - '&7' - - '&3Right Click »' - - '&7Create a new custom boss from' - - '&7scratch.' + - '&3Left Click »' + - '&7Edit any of the already created' + - '&7custom bosses.' + - '&7' + - '&3Right Click »' + - '&7Create a new custom boss from' + - '&7scratch.' Button: CustomBosses '5': type: DIAMOND name: '&b&lCustom Items' lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7custom items.' - - '&7' - - '&3Right Click »' - - '&7Create a new custom item from' - - '&7an item in your inventory.' + - '&3Left Click »' + - '&7Edit any of the already created' + - '&7custom items.' + - '&7' + - '&3Right Click »' + - '&7Create a new custom item from' + - '&7an item in your inventory.' Button: CustomItems '8': type: CLOCK name: '&b&lAuto Spawns' lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7auto spawns.' - - '&7' - - '&3Right Click »' - - '&7Create a new auto spawn from' - - '&7scratch.' + - '&3Left Click »' + - '&7Edit any of the already created' + - '&7auto spawns.' + - '&7' + - '&3Right Click »' + - '&7Create a new auto spawn from' + - '&7scratch.' Button: AutoSpawns '12': type: OAK_PRESSURE_PLATE name: '&b&lDrop Tables' lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7drop tables.' - - '&7' - - '&3Right Click »' - - '&7Create a new drop table from' - - '&7scratch.' + - '&3Left Click »' + - '&7Edit any of the already created' + - '&7drop tables.' + - '&7' + - '&3Right Click »' + - '&7Create a new drop table from' + - '&7scratch.' Button: DropTables '16': type: BLAZE_POWDER name: '&b&lCustom Skills' lore: - - '&3Left Click »' - - '&7Edit any of the already created' - - '&7custom skills.' - - '&7' - - '&3Right Click »' - - '&7Create a new custom skill from' - - '&7scratch.' + - '&3Left Click »' + - '&7Edit any of the already created' + - '&7custom skills.' + - '&7' + - '&3Right Click »' + - '&7Create a new custom skill from' + - '&7scratch.' Button: CustomSkills ShopListPanel: name: '&b&lEpicBosses &3&lShop' @@ -103,8 +103,8 @@ ShopListPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page.' + - '&7Click here to go to the previous' + - '&7page.' PreviousPage: true '50': type: GLASS_PANE @@ -113,8 +113,8 @@ ShopListPanel: type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page.' + - '&7Click here to go to the next' + - '&7page.' NextPage: true '52': type: GLASS_PANE @@ -147,20 +147,20 @@ ListPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page.' + - '&7Click here to go to the previous' + - '&7page.' PreviousPage: true '50': type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back.' + - '&7Click this button to go back.' '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page.' + - '&7Click here to go to the next' + - '&7page.' NextPage: true '52': type: GLASS_PANE @@ -181,18 +181,18 @@ CustomItemsMenu: type: BOOK name: '&c&lCustom Items Guide' lore: - - '&7In this menu you can view all the' - - '&7custom items for the plugin, as well' - - '&7as manipulate them to your liking.' - - '&7' - - '&3Left Click &8»' - - '&7Obtain ItemStack in your inventory.' - - '&7' - - '&3Middle Click &8» ' - - '&7Clone ItemStack section to a new section.' - - '&7' - - '&3Right Click &8» ' - - '&7Remove section from list if not bound.' + - '&7In this menu you can view all the' + - '&7custom items for the plugin, as well' + - '&7as manipulate them to your liking.' + - '&7' + - '&3Left Click &8»' + - '&7Obtain ItemStack in your inventory.' + - '&7' + - '&3Middle Click &8» ' + - '&7Clone ItemStack section to a new section.' + - '&7' + - '&3Right Click &8» ' + - '&7Remove section from list if not bound.' '47': type: GLASS_PANE name: '&7' @@ -203,23 +203,23 @@ CustomItemsMenu: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of custom drops.' + - '&7Click here to go to the previous' + - '&7page of custom drops.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Item' lore: - - '&7Click here to add a new' - - '&7item which you have in your' - - '&7inventory.' + - '&7Click here to add a new' + - '&7item which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of custom drops.' + - '&7Click here to go to the next' + - '&7page of custom drops.' NextPage: true '52': type: GLASS_PANE @@ -243,9 +243,9 @@ AddItemsMenu: type: REDSTONE name: '&c&lCancel' lore: - - '&7Click here to cancel the transaction' - - '&7of adding the item to the EpicBosses' - - '&7database.' + - '&7Click here to cancel the transaction' + - '&7of adding the item to the EpicBosses' + - '&7database.' Button: Cancel '14': type: AIR @@ -254,9 +254,9 @@ AddItemsMenu: type: LIME_DYE name: '&a&lAccept' lore: - - '&7Click here to accept the transaction' - - '&7of adding the item to the EpicBosses' - - '&7database.' + - '&7Click here to accept the transaction' + - '&7of adding the item to the EpicBosses' + - '&7database.' Button: Accept MainEditorPanel: name: '&b&l{name} Editor' @@ -271,92 +271,92 @@ MainEditorPanel: type: DIAMOND name: '&a&lDrops Manager' lore: - - '&7Click here to manage the drop table' - - '&7that is attached to this boss.' + - '&7Click here to manage the drop table' + - '&7that is attached to this boss.' Button: Drops '14': type: DIAMOND_HELMET name: '&c&lEquipment Manager' lore: - - '&7Click here to manage the equipment' - - '&7that the boss has equipped.' + - '&7Click here to manage the equipment' + - '&7that the boss has equipped.' Button: Equipment '16': type: BONE name: '&a&lTargeting Manager' lore: - - '&7Click here to edit how the boss handles' - - '&7targeting of players and mobs.' + - '&7Click here to edit how the boss handles' + - '&7targeting of players and mobs.' Button: Targeting '22': type: BOW name: '&c&lWeapon Manager' lore: - - '&7Click here to manage the weapon(s)' - - '&7that the boss has equipped.' + - '&7Click here to manage the weapon(s)' + - '&7that the boss has equipped.' Button: Weapon '23': type: BARRIER name: '&c&l!&4&l!&c&l! &4&lWARNING &c&l!&4&l!&c&l!' lore: - - '&7While editing is enabled for this boss' - - '&7no one will be able to spawn it, nor' - - '&7will it spawn naturally.' + - '&7While editing is enabled for this boss' + - '&7no one will be able to spawn it, nor' + - '&7will it spawn naturally.' '24': type: BLAZE_POWDER name: '&c&lSkill Manager' lore: - - '&7Click here to manage the assigned' - - '&7skill(s) the boss has and their occurrence' - - '&7chances.' + - '&7Click here to manage the assigned' + - '&7skill(s) the boss has and their occurrence' + - '&7chances.' Button: Skill '30': type: STICK name: '&a&lSpawn Item Manager' lore: - - '&bCurrently: &f{spawnItem}' - - '&7' - - '&7Click here to select a spawn item for this' - - '&7boss section from all the current items saved' - - '&7in the plugin.' + - '&bCurrently: &f{spawnItem}' + - '&7' + - '&7Click here to select a spawn item for this' + - '&7boss section from all the current items saved' + - '&7in the plugin.' Button: SpawnItem '32': type: LAPIS_LAZULI name: '&a&lStatistics Manager' lore: - - '&7Click here to edit the statistics of the' - - '&7boss, including things like: health,' - - '&7potion effects, commands on spawn, etc.' + - '&7Click here to edit the statistics of the' + - '&7boss, including things like: health,' + - '&7potion effects, commands on spawn, etc.' Button: Stats '34': type: GOLD_BLOCK name: '&a&lShop Manager' lore: - - '&7Click here to modify the shop settings for' - - '&7this boss.' + - '&7Click here to modify the shop settings for' + - '&7this boss.' Button: Shop '39': type: BOOK name: '&a&lCommand Manager' lore: - - '&7Click here to manage the commands that are' - - '&7called when the boss spawns, dies, etc.' + - '&7Click here to manage the commands that are' + - '&7called when the boss spawns, dies, etc.' Button: Command '41': type: LEVER name: '&a&lToggle Boss Editing' lore: - - '&7Click here to edit how to toggle the boss' - - '&7editing mode.' - - '&7' - - '&bCurrently: &f{mode}' + - '&7Click here to edit how to toggle the boss' + - '&7editing mode.' + - '&7' + - '&bCurrently: &f{mode}' Button: Editing '43': type: BOOK name: '&a&lText Manager' lore: - - '&7Click here to edit the taunts, sayings,' - - '&7etc. for this boss.' + - '&7Click here to edit the taunts, sayings,' + - '&7etc. for this boss.' Button: Text BossShopEditorPanel: name: '&b&l{name} Editor' @@ -370,29 +370,29 @@ BossShopEditorPanel: type: GUNPOWDER name: '&3&lBuyable' lore: - - '&bCurrently: &f{buyable}' - - '&7' - - '&7If this is set to true then this' - - '&7boss spawn egg will be spawnable from' - - '&7the /boss shop while boss editing is' - - '&7disabled.' + - '&bCurrently: &f{buyable}' + - '&7' + - '&7If this is set to true then this' + - '&7boss spawn egg will be spawnable from' + - '&7the /boss shop while boss editing is' + - '&7disabled.' Button: Buyable '5': type: REDSTONE name: '&c&lGo Back' lore: - - '&7Click here to go back to the' - - '&7main boss editor panel.' + - '&7Click here to go back to the' + - '&7main boss editor panel.' '7': type: GOLD_INGOT name: '&3&lPrice' lore: - - '&bCurrently: &a$&f{price}' - - '&7' - - '&7This is the price that the boss will' - - '&7be sold for in the /boss shop menu' - - '&7' - - '&7Click here to adjust the price.' + - '&bCurrently: &a$&f{price}' + - '&7' + - '&7This is the price that the boss will' + - '&7be sold for in the /boss shop menu' + - '&7' + - '&7Click here to adjust the price.' Button: Price SpawnItemEditorPanel: name: '&b&l{name} Editor' @@ -407,8 +407,8 @@ SpawnItemEditorPanel: type: DIAMOND name: '&c&lRemove' lore: - - '&7click here to remove the currently' - - '&7equipped spawn item.' + - '&7click here to remove the currently' + - '&7equipped spawn item.' Button: Remove '47': type: WHITE_STAINED_GLASS_PANE @@ -420,23 +420,23 @@ SpawnItemEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of spawn item.' + - '&7Click here to go to the previous' + - '&7page of spawn item.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Spawn Item' lore: - - '&7Click here to add a new spawn' - - '&7item which you have in your' - - '&7inventory.' + - '&7Click here to add a new spawn' + - '&7item which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of spawn item.' + - '&7Click here to go to the next' + - '&7page of spawn item.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -448,7 +448,7 @@ SpawnItemEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' DropsMainEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -465,39 +465,39 @@ DropsMainEditorPanel: type: BOOK name: '&c&lDrops Guide' lore: - - '&7Here you can configure the drop systems' - - '&7the boss has when he dies.' + - '&7Here you can configure the drop systems' + - '&7the boss has when he dies.' '4': type: GUNPOWDER name: '&e&lNatural Drops' lore: - - '&bCurrently: &f{naturalDrops}' - - '&7' - - '&7Click to toggle the natural drops' - - '&7for this boss.' + - '&bCurrently: &f{naturalDrops}' + - '&7' + - '&7Click to toggle the natural drops' + - '&7for this boss.' Button: NaturalDrops '5': type: BOOK name: '&e&lDrop Table' lore: - - '&bCurrently: &f{dropTable}' - - '&7Click here to change the drop table' - - '&7assigned to this boss.' + - '&bCurrently: &f{dropTable}' + - '&7Click here to change the drop table' + - '&7assigned to this boss.' Button: DropTable '6': type: REDSTONE name: '&e&lNatural EXP' lore: - - '&bCurrently: &f{naturalExp}' - - '&7' - - '&7Click to toggle the natural drop' - - '&7of exp for this boss.' + - '&bCurrently: &f{naturalExp}' + - '&7' + - '&7Click to toggle the natural drop' + - '&7of exp for this boss.' Button: NaturalEXP '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' DropsEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -508,16 +508,16 @@ DropsEditorPanel: type: DIAMOND name: '&b&lSelected Drop Table' lore: - - '&7The current selected drop' - - '&7table is: &b{dropTable}&7.' - - '&7' - - '&b&lHints' - - '&b&l* &7If this shows N/A it means' - - '&7 there was an issue loading the' - - '&7 previous table, or it doesn''t' - - '&7 have one selected.' - - '&b&l* &7Click here to go straight to the' - - '&7 editing screen of the drop table.' + - '&7The current selected drop' + - '&7table is: &b{dropTable}&7.' + - '&7' + - '&b&lHints' + - '&b&l* &7If this shows N/A it means' + - '&7 there was an issue loading the' + - '&7 previous table, or it doesn''t' + - '&7 have one selected.' + - '&b&l* &7Click here to go straight to the' + - '&7 editing screen of the drop table.' Button: Selected '47': type: WHITE_STAINED_GLASS_PANE @@ -529,23 +529,23 @@ DropsEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of drop tables.' + - '&7Click here to go to the previous' + - '&7page of drop tables.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lCreate a new Drop Table' lore: - - '&7Click here to create a new drop' - - '&7table. It will automatically be' - - '&7assigned to this boss when created.' + - '&7Click here to create a new drop' + - '&7table. It will automatically be' + - '&7assigned to this boss when created.' Button: CreateDropTable '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of drop tables.' + - '&7Click here to go to the next' + - '&7page of drop tables.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -557,16 +557,16 @@ DropsEditorPanel: type: BOOK name: '&c&lDrops Guide' lore: - - '&7When selecting the drop table for this custom boss' - - '&7you can either choose from one of the above listed' - - '&7pre-configured drop tables or you can make a' - - '&7new one for this boss.' - - '&7' - - '&c&lHints' - - '&c&l* &7The currently selected drop table will be shown' - - '&7 with an emerald which states so.' - - '&c&l* &7Every drop table from every boss will be listed' - - '&7 here as an available drop table.' + - '&7When selecting the drop table for this custom boss' + - '&7you can either choose from one of the above listed' + - '&7pre-configured drop tables or you can make a' + - '&7new one for this boss.' + - '&7' + - '&c&lHints' + - '&c&l* &7The currently selected drop table will be shown' + - '&7 with an emerald which states so.' + - '&c&l* &7Every drop table from every boss will be listed' + - '&7 here as an available drop table.' BossListEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -592,8 +592,8 @@ BossListEditorPanel: type: DIAMOND_BLOCK name: '&a&lCreate a new Entity' lore: - - '&7Click here to create a new entity' - - '&7within this boss.' + - '&7Click here to create a new entity' + - '&7within this boss.' Button: CreateEntity '51': type: WHITE_STAINED_GLASS_PANE @@ -608,7 +608,7 @@ BossListEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' EquipmentEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -625,53 +625,53 @@ EquipmentEditorPanel: type: DIAMOND_HELMET name: '&c&lHelmet' lore: - - '&7Click here to change the' - - '&7helmet for the &f{name}' - - '&7or add one from your' - - '&7inventory.' + - '&7Click here to change the' + - '&7helmet for the &f{name}' + - '&7or add one from your' + - '&7inventory.' Button: Helmet '3': type: DIAMOND_CHESTPLATE name: '&c&lChestplate' lore: - - '&7Click here to change the' - - '&7chestplate for the &f{name}' - - '&7or add one from your' - - '&7inventory.' + - '&7Click here to change the' + - '&7chestplate for the &f{name}' + - '&7or add one from your' + - '&7inventory.' Button: Chestplate '4': type: DIAMOND_LEGGINGS name: '&c&lLeggings' lore: - - '&7Click here to change the' - - '&7leggings for the &f{name}' - - '&7or add one from your' - - '&7inventory.' + - '&7Click here to change the' + - '&7leggings for the &f{name}' + - '&7or add one from your' + - '&7inventory.' Button: Leggings '5': type: DIAMOND_BOOTS name: '&c&lBoots' lore: - - '&7Click here to change the' - - '&7boots for the &f{name}' - - '&7or add one from your' - - '&7inventory.' + - '&7Click here to change the' + - '&7boots for the &f{name}' + - '&7or add one from your' + - '&7inventory.' Button: Boots '8': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' '9': type: BOOK name: '&c&lEquipment Guide' lore: - - '&7here you can choose what equipment' - - '&7this boss has. To choose simply click' - - '&7the desired piece, then click one of' - - '&7the preset pieces or click the diamond' - - '&7block to add a new piece from your' - - '&7inventory.' + - '&7here you can choose what equipment' + - '&7this boss has. To choose simply click' + - '&7the desired piece, then click one of' + - '&7the preset pieces or click the diamond' + - '&7block to add a new piece from your' + - '&7inventory.' HelmetEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -685,8 +685,8 @@ HelmetEditorPanel: type: DIAMOND name: '&c&lRemove' lore: - - '&7click here to remove the' - - '&7currently equipped helmet.' + - '&7click here to remove the' + - '&7currently equipped helmet.' Button: Remove '47': type: WHITE_STAINED_GLASS_PANE @@ -698,23 +698,23 @@ HelmetEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of helmets.' + - '&7Click here to go to the previous' + - '&7page of helmets.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Helmet' lore: - - '&7Click here to add a new' - - '&7helmet which you have in your' - - '&7inventory.' + - '&7Click here to add a new' + - '&7helmet which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of helmets.' + - '&7Click here to go to the next' + - '&7page of helmets.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -726,7 +726,7 @@ HelmetEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' ChestplateEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -740,8 +740,8 @@ ChestplateEditorPanel: type: DIAMOND name: '&c&lRemove' lore: - - '&7click here to remove the' - - '&7currently equipped chestplate.' + - '&7click here to remove the' + - '&7currently equipped chestplate.' Button: Remove '47': type: WHITE_STAINED_GLASS_PANE @@ -753,23 +753,23 @@ ChestplateEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of chestplates.' + - '&7Click here to go to the previous' + - '&7page of chestplates.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Chestplate' lore: - - '&7Click here to add a new' - - '&7chestplate which you have in your' - - '&7inventory.' + - '&7Click here to add a new' + - '&7chestplate which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of chestplates.' + - '&7Click here to go to the next' + - '&7page of chestplates.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -781,7 +781,7 @@ ChestplateEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' LeggingsEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -795,8 +795,8 @@ LeggingsEditorPanel: type: DIAMOND name: '&c&lRemove' lore: - - '&7click here to remove the' - - '&7currently equipped {type}.' + - '&7click here to remove the' + - '&7currently equipped {type}.' Button: Remove '47': type: WHITE_STAINED_GLASS_PANE @@ -808,23 +808,23 @@ LeggingsEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of leggings.' + - '&7Click here to go to the previous' + - '&7page of leggings.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Leggings' lore: - - '&7Click here to add a new' - - '&7leggings which you have in your' - - '&7inventory.' + - '&7Click here to add a new' + - '&7leggings which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of leggings.' + - '&7Click here to go to the next' + - '&7page of leggings.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -836,7 +836,7 @@ LeggingsEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' BootsEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -850,8 +850,8 @@ BootsEditorPanel: type: DIAMOND name: '&c&lRemove' lore: - - '&7click here to remove the' - - '&7currently equipped {type}.' + - '&7click here to remove the' + - '&7currently equipped {type}.' Button: Remove '47': type: WHITE_STAINED_GLASS_PANE @@ -863,23 +863,23 @@ BootsEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of boots.' + - '&7Click here to go to the previous' + - '&7page of boots.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Boots' lore: - - '&7Click here to add a new' - - '&7boots which you have in your' - - '&7inventory.' + - '&7Click here to add a new' + - '&7boots which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of boots.' + - '&7Click here to go to the next' + - '&7page of boots.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -891,7 +891,7 @@ BootsEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' TargetingPanel: name: '&b&l{name} Editor' slots: 27 @@ -908,60 +908,60 @@ TargetingPanel: type: REDSTONE_BLOCK name: '&e&lNot Damaged Nearby' lore: - - '&7This target system will target' - - '&7anyone who is nearby and hasn''t' - - '&7attacked the boss. If there is' - - '&7no one nearby who hasn''t attacked' - - '&7the boss then it will choose a random' - - '&7entity/player.' + - '&7This target system will target' + - '&7anyone who is nearby and hasn''t' + - '&7attacked the boss. If there is' + - '&7no one nearby who hasn''t attacked' + - '&7the boss then it will choose a random' + - '&7entity/player.' TargetingSystem: NotDamagedNearby '13': type: REDSTONE_BLOCK name: '&e&lClosest' lore: - - '&7This target system will' - - '&7target the closest player' - - '&7to the boss.' + - '&7This target system will' + - '&7target the closest player' + - '&7to the boss.' TargetingSystem: Closest '14': type: REDSTONE_BLOCK name: '&e&lRandom Nearby' lore: - - '&7This target system will' - - '&7target a random target who is' - - '&7within reach of the boss.' + - '&7This target system will' + - '&7target a random target who is' + - '&7within reach of the boss.' TargetingSystem: RandomNearby '15': type: REDSTONE_BLOCK name: '&e&lTop Damager' lore: - - '&7This target system will' - - '&7target the player who has' - - '&7the most damage that is' - - '&7nearby.' + - '&7This target system will' + - '&7target the player who has' + - '&7the most damage that is' + - '&7nearby.' TargetingSystem: TopDamager '19': type: ARROW name: '&b&lSelected' lore: - - '&7You have currently got &f{selected}' - - '&7as your targeting system.' + - '&7You have currently got &f{selected}' + - '&7as your targeting system.' '23': type: BOOK name: '&c&lTargeting Guide' lore: - - '&7Here you can choose how' - - '&7the boss handles targeting' - - '&7of players.' - - '&7' - - '&7The default boss target range is' - - '&f50 blocks&7. However this can be' - - '&7adjusted in the display.yml.' + - '&7Here you can choose how' + - '&7the boss handles targeting' + - '&7of players.' + - '&7' + - '&7The default boss target range is' + - '&f50 blocks&7. However this can be' + - '&7adjusted in the display.yml.' '27': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' WeaponEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -978,31 +978,31 @@ WeaponEditorPanel: type: BOOK name: '&c&lWeapons Guide' lore: - - '&7here you can choose what weapons' - - '&7this boss has. To choose simply click' - - '&7the desired hand, then click one of' - - '&7the preset weapons or click the diamond' - - '&7block to add a new weapon from your' - - '&7inventory.' + - '&7here you can choose what weapons' + - '&7this boss has. To choose simply click' + - '&7the desired hand, then click one of' + - '&7the preset weapons or click the diamond' + - '&7block to add a new weapon from your' + - '&7inventory.' '4': type: DIAMOND_SWORD name: '&c&lMain Hand' lore: - - '&7Click here to modify the' - - '&7main hand for the &f{name}&7.' + - '&7Click here to modify the' + - '&7main hand for the &f{name}&7.' Button: MainHand '6': type: SHIELD name: '&c&lOff Hand' lore: - - '&7Click here to modify the' - - '&7off hand for the &f{name}&7.' + - '&7Click here to modify the' + - '&7off hand for the &f{name}&7.' Button: OffHand '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' MainHandEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -1016,8 +1016,8 @@ MainHandEditorPanel: type: DIAMOND name: '&c&lRemove' lore: - - '&7click here to remove the' - - '&7currently equipped main hand.' + - '&7click here to remove the' + - '&7currently equipped main hand.' Button: Remove '47': type: WHITE_STAINED_GLASS_PANE @@ -1029,23 +1029,23 @@ MainHandEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of weapons.' + - '&7Click here to go to the previous' + - '&7page of weapons.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Weapon' lore: - - '&7Click here to add a new' - - '&7weapon which you have in your' - - '&7inventory.' + - '&7Click here to add a new' + - '&7weapon which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of weapons.' + - '&7Click here to go to the next' + - '&7page of weapons.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -1057,7 +1057,7 @@ MainHandEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' OffHandEditorPanel: name: '&b&l{name} Editor' slots: 54 @@ -1071,8 +1071,8 @@ OffHandEditorPanel: type: DIAMOND name: '&c&lRemove' lore: - - '&7click here to remove the' - - '&7currently equipped off hand.' + - '&7click here to remove the' + - '&7currently equipped off hand.' Button: Remove '47': type: WHITE_STAINED_GLASS_PANE @@ -1084,23 +1084,23 @@ OffHandEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of weapons.' + - '&7Click here to go to the previous' + - '&7page of weapons.' PreviousPage: true '50': type: DIAMOND_BLOCK name: '&a&lAdd New Weapon' lore: - - '&7Click here to add a new' - - '&7weapon which you have in your' - - '&7inventory.' + - '&7Click here to add a new' + - '&7weapon which you have in your' + - '&7inventory.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of weapons.' + - '&7Click here to go to the next' + - '&7page of weapons.' NextPage: true '52': type: WHITE_STAINED_GLASS_PANE @@ -1112,7 +1112,7 @@ OffHandEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' SkillMainEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -1129,49 +1129,49 @@ SkillMainEditorPanel: type: BOOK name: '&c&lSkill Guide' lore: - - '&7Here you can configure the way the' - - '&7skill system handles for this boss.' - - '&7You can configure the overall chance,' - - '&7skill message and the list of skills' - - '&7that is assigned to this boss.' + - '&7Here you can configure the way the' + - '&7skill system handles for this boss.' + - '&7You can configure the overall chance,' + - '&7skill message and the list of skills' + - '&7that is assigned to this boss.' '4': type: GLOWSTONE_DUST name: '&e&lOverall Chance' lore: - - '&7The current overall chance for' - - '&7skills to be procced each hit is' - - '&f{chance}%&7.' - - '&7' - - '&bLeft Click &8» &f+1.0' - - '&bShift Left-Click &8» &f+0.1' - - '&7' - - '&bRight Click &8» &f-1.0' - - '&bShift Right-Click &8» &f-0.1' + - '&7The current overall chance for' + - '&7skills to be procced each hit is' + - '&f{chance}%&7.' + - '&7' + - '&bLeft Click &8» &f+1.0' + - '&bShift Left-Click &8» &f+0.1' + - '&7' + - '&bRight Click &8» &f-1.0' + - '&bShift Right-Click &8» &f-0.1' Button: OverallChance '5': type: BOOK name: '&e&lSkills List' lore: - - '&7Click here to select which skills' - - '&7are currently selected for this boss.' + - '&7Click here to select which skills' + - '&7are currently selected for this boss.' Button: SkillList '6': type: PAPER name: '&e&lMaster Message' lore: - - '&7Click here to modify the' - - '&7master message for when a' - - '&7skill is proced. If the' - - '&7specific skill has got a' - - '&7customMessage dedicated' - - '&7to it, this message will' - - '&7be ignored.' + - '&7Click here to modify the' + - '&7master message for when a' + - '&7skill is proced. If the' + - '&7specific skill has got a' + - '&7customMessage dedicated' + - '&7to it, this message will' + - '&7be ignored.' Button: Message '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' StatisticsMainEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -1188,48 +1188,48 @@ StatisticsMainEditorPanel: type: BOOK name: '&c&lStatistics Guide' lore: - - '&7Here you can configure the way the' - - '&7skill system handles for this boss.' - - '&7You can configure the overall chance,' - - '&7skill message and the list of skills' - - '&7that is assigned to this boss.' + - '&7Here you can configure the way the' + - '&7skill system handles for this boss.' + - '&7You can configure the overall chance,' + - '&7skill message and the list of skills' + - '&7that is assigned to this boss.' '4': type: NAME_TAG name: '&e&lChange the Display Name' lore: - - '&7Here you can change the display name' - - '&7of the entity. It is currently:' - - '&f{displayName}' - - '&7' - - '&7When u click this it will close the' - - '&7GUI and suggest you to enter the new' - - '&7display name in chat.' + - '&7Here you can change the display name' + - '&7of the entity. It is currently:' + - '&f{displayName}' + - '&7' + - '&7When u click this it will close the' + - '&7GUI and suggest you to enter the new' + - '&7display name in chat.' Button: DisplayName '5': type: SLIME_SPAWN_EGG name: '&e&lChange the Entity Type' lore: - - '&7This will open a GUI and you can select' - - '&7your new entity type.' + - '&7This will open a GUI and you can select' + - '&7your new entity type.' Button: EntityType '6': type: REDSTONE name: '&e&lChange the Health' lore: - - '&7The current health for this entity' - - '&7is &c{health}' - - '&7' - - '&bLeft Click &8» &f+1.0' - - '&bShift Left-Click &8» &f+0.1' - - '&7' - - '&bRight Click &8» &f-1.0' - - '&bShift Right-Click &8» &f-0.1' + - '&7The current health for this entity' + - '&7is &c{health}' + - '&7' + - '&bLeft Click &8» &f+1.0' + - '&bShift Left-Click &8» &f+0.1' + - '&7' + - '&bRight Click &8» &f-1.0' + - '&bShift Right-Click &8» &f-0.1' Button: Health '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' CommandsEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -1246,31 +1246,31 @@ CommandsEditorPanel: type: BOOK name: '&c&lCommands Guide' lore: - - '&7Here you can configure which command set' - - '&7the boss has for specific events.' + - '&7Here you can configure which command set' + - '&7the boss has for specific events.' '4': type: TALL_GRASS name: '&e&lOn Spawn' lore: - - '&7Here you can change the command for' - - '&7the spawn of the boss.' - - '&7' - - '&fCurrently Selected: &7{onSpawn}' + - '&7Here you can change the command for' + - '&7the spawn of the boss.' + - '&7' + - '&fCurrently Selected: &7{onSpawn}' Button: OnSpawn '6': type: REDSTONE name: '&e&lOn Death' lore: - - '&7Here you can change the command' - - '&7the death of the boss.' - - '&7' - - '&fCurrently Selected: &7{onDeath}' + - '&7Here you can change the command' + - '&7the death of the boss.' + - '&7' + - '&fCurrently Selected: &7{onDeath}' Button: OnDeath '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' TextEditorMainPanel: name: '&b&l{name} Editor' slots: 9 @@ -1287,34 +1287,34 @@ TextEditorMainPanel: type: BOOK name: '&c&lText Guide' lore: - - '&7Here you can configure which command set' - - '&7the boss has for specific events.' + - '&7Here you can configure which command set' + - '&7the boss has for specific events.' '4': type: TALL_GRASS name: '&e&lOn Spawn' lore: - - '&7Here you can change the settings for' - - '&7the spawn messages of the boss.' + - '&7Here you can change the settings for' + - '&7the spawn messages of the boss.' Button: OnSpawn '5': type: REDSTONE_TORCH name: '&e&lTaunts' lore: - - '&7Here you can adjust the settings for' - - '&7the taunts of the boss.' + - '&7Here you can adjust the settings for' + - '&7the taunts of the boss.' Button: Taunts '6': type: REDSTONE name: '&e&lOn Death' lore: - - '&7Here you can change the settings for' - - '&7the death messages of the boss.' + - '&7Here you can change the settings for' + - '&7the death messages of the boss.' Button: OnDeath '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' DeathTextEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -1331,58 +1331,58 @@ DeathTextEditorPanel: type: TALL_GRASS name: '&e&lMain Message' lore: - - '&7Here you can change the main message that is' - - '&7currently selected.' - - '&7' - - '&bCurrent: &f{mainMessage}' + - '&7Here you can change the main message that is' + - '&7currently selected.' + - '&7' + - '&bCurrent: &f{mainMessage}' Button: MainMessage '3': type: PLAYER_HEAD name: '&e&lPosition Message' lore: - - '&7Here you can change the position message that is' - - '&7currently selected.' - - '&7' - - '&bCurrent: &f{positionMessage}' - - '&7' - - '&7The position message is a message that is' - - '&7injected in to the main message to display' - - '&7the positions, damage and percentage of damage' - - '&7that the selected amount of people did to' - - '&7the boss.' + - '&7Here you can change the position message that is' + - '&7currently selected.' + - '&7' + - '&bCurrent: &f{positionMessage}' + - '&7' + - '&7The position message is a message that is' + - '&7injected in to the main message to display' + - '&7the positions, damage and percentage of damage' + - '&7that the selected amount of people did to' + - '&7the boss.' Button: PositionMessage '5': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' '7': type: REDSTONE_BLOCK name: '&e&lOnly Show' lore: - - '&7Here you can change the amount of damaging' - - '&7users it will display on the main message' - - '&7with the position message injection.' - - '&7Currently it will show the top &f{onlyShow}' - - '&7players on the death message.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' + - '&7Here you can change the amount of damaging' + - '&7users it will display on the main message' + - '&7with the position message injection.' + - '&7Currently it will show the top &f{onlyShow}' + - '&7players on the death message.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bRight Click &8» &f-1' Button: OnlyShow '8': type: REDSTONE name: '&e&lRadius' lore: - - '&7Here you can change the radius for' - - '&7this message. It is currently: &f{radius}' - - '&7blocks. Set it to &f-1&7 if you want it' - - '&7to be a server-wide broadcast.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&7Here you can change the radius for' + - '&7this message. It is currently: &f{radius}' + - '&7blocks. Set it to &f-1&7 if you want it' + - '&7to be a server-wide broadcast.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: Radius SpawnTextEditorPanel: name: '&b&l{name} Editor' @@ -1400,30 +1400,30 @@ SpawnTextEditorPanel: type: TALL_GRASS name: '&e&lSelect Message' lore: - - '&7Here you can change the message that is' - - '&7currently selected.' - - '&7' - - '&bCurrent: &f{selected}' + - '&7Here you can change the message that is' + - '&7currently selected.' + - '&7' + - '&bCurrent: &f{selected}' Button: Select '5': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' '8': type: REDSTONE name: '&e&lRadius' lore: - - '&7Here you can change the radius for' - - '&7this message. It is currently: &f{radius}' - - '&7blocks. Set it to &f-1&7 if you want it' - - '&7to be a server-wide broadcast.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&7Here you can change the radius for' + - '&7this message. It is currently: &f{radius}' + - '&7blocks. Set it to &f-1&7 if you want it' + - '&7to be a server-wide broadcast.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: Radius TauntEditorPanel: name: '&b&l{name} Editor' @@ -1441,50 +1441,50 @@ TauntEditorPanel: type: REDSTONE name: '&e&lRadius' lore: - - '&7Here you can change the radius that players' - - '&7will see the taunts in. It is currently: &f{radius}' - - '&7blocks. Set it to &f-1&7 if you want it' - - '&7to be a server-wide broadcast.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&7Here you can change the radius that players' + - '&7will see the taunts in. It is currently: &f{radius}' + - '&7blocks. Set it to &f-1&7 if you want it' + - '&7to be a server-wide broadcast.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: Radius '5': type: BOOK name: '&e&lTaunts' lore: - - '&7Here you can select the taunts that the boss' - - '&7will say while he is active. If this list is' - - '&7empty he won''t say anything.' - - '&7' - - '&bCurrently Selected:' - - '&f{taunts}' + - '&7Here you can select the taunts that the boss' + - '&7will say while he is active. If this list is' + - '&7empty he won''t say anything.' + - '&7' + - '&bCurrently Selected:' + - '&f{taunts}' Button: Taunts '7': type: CLOCK name: '&e&lDelay' lore: - - '&7Here you can change the delay between each' - - '&7taunt that the boss says. The delay is' - - '&7currently set to &f{delay}s&7. This time is in' - - '&7seconds. Once the boss has gone through the' - - '&7list of taunts he will start again at the' - - '&7beginning until he''s dead.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&7Here you can change the delay between each' + - '&7taunt that the boss says. The delay is' + - '&7currently set to &f{delay}s&7. This time is in' + - '&7seconds. Once the boss has gone through the' + - '&7list of taunts he will start again at the' + - '&7beginning until he''s dead.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: Delay '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' SkillEditorPanel: name: '&b&l{name} Skill Editor' slots: 18 @@ -1498,72 +1498,72 @@ SkillEditorPanel: type: BOOK name: '&e&lCustom Message' lore: - - '&7Click here to change the custom message' - - '&7assigned to the skill. This will override' - - '&7the master message assigned to the boss when' - - '&7this skill is called.' - - '&7' - - '&bCurrently: &f{customMessage}' - - '&7' - - '&7To remove this message simply right click' - - '&7and it will then remove this and go back' - - '&7to using the master message assigned to the' - - '&7boss.' + - '&7Click here to change the custom message' + - '&7assigned to the skill. This will override' + - '&7the master message assigned to the boss when' + - '&7this skill is called.' + - '&7' + - '&bCurrently: &f{customMessage}' + - '&7' + - '&7To remove this message simply right click' + - '&7and it will then remove this and go back' + - '&7to using the master message assigned to the' + - '&7boss.' Button: CustomMessage '3': type: REDSTONE name: '&e&lRadius' lore: - - '&7Here you can change the radius that the skill' - - '&7will see be called to within. It is currently' - - '&7set to &f{radius} blocks.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&7Here you can change the radius that the skill' + - '&7will see be called to within. It is currently' + - '&7set to &f{radius} blocks.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: Radius '5': type: DIAMOND name: '&e&lCustom Data' lore: - - '&7Click here to edit the custom data related' - - '&7to this skill. If it is a Potion skill you' - - '&7can modify the potions, etc. etc.' + - '&7Click here to edit the custom data related' + - '&7to this skill. If it is a Potion skill you' + - '&7can modify the potions, etc. etc.' Button: CustomData '7': type: TORCH name: '&e&lMode' lore: - - '&bCurrently: &f{mode}' - - '&7' - - '&7Click here to change the mode of the custom' - - '&7skill. It will cycle between all different' - - '&7types so when you find the right mode you can' - - '&7leave it and it will automatically save to' - - '&7that mode.' + - '&bCurrently: &f{mode}' + - '&7' + - '&7Click here to change the mode of the custom' + - '&7skill. It will cycle between all different' + - '&7types so when you find the right mode you can' + - '&7leave it and it will automatically save to' + - '&7that mode.' Button: Mode '8': type: PAPER name: '&e&lDisplay Name' lore: - - '&bCurrently: &f{displayName}' - - '&7' - - '&7This is the skill display name. It is used' - - '&7in many things, from the in-game display of' - - '&7the skill, to the debug messages. So make' - - '&7sure it stands out and is unique, or not.' + - '&bCurrently: &f{displayName}' + - '&7' + - '&7This is the skill display name. It is used' + - '&7in many things, from the in-game display of' + - '&7the skill, to the debug messages. So make' + - '&7sure it stands out and is unique, or not.' Button: DisplayName '14': type: GUNPOWDER name: '&e&lType' lore: - - '&bCurrently: &f{type}' - - '&7Click this to change the skill type. Keep' - - '&7in mind that when you change your skill' - - '&7type the previous custom data will be erased' - - '&7to make room for the new custom data.' + - '&bCurrently: &f{type}' + - '&7Click this to change the skill type. Keep' + - '&7in mind that when you change your skill' + - '&7type the previous custom data will be erased' + - '&7to make room for the new custom data.' Button: Type SkillTypeEditorPanel: name: '&b&l{name} Skill Editor' @@ -1581,62 +1581,62 @@ SkillTypeEditorPanel: type: BOOK name: '&e&lCommand Skill Type' lore: - - '&7If you set this to the skill type' - - '&7then you will be able to set commands' - - '&7to be applied to the targeted players' - - '&7when this skill is called.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' + - '&7If you set this to the skill type' + - '&7then you will be able to set commands' + - '&7to be applied to the targeted players' + - '&7when this skill is called.' + - '&7' + - '&c&lWARNING' + - '&7This will remove any previous' + - '&7custom skill data.' Button: Command '3': type: EMERALD name: '&e&lCustom Skill Type' lore: - - '&7If you want to use a custom skill for' - - '&7this skill, select this skill type then' - - '&7in your custom data configuration you' - - '&7can select which custom skill it is' - - '&7assigned to.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' + - '&7If you want to use a custom skill for' + - '&7this skill, select this skill type then' + - '&7in your custom data configuration you' + - '&7can select which custom skill it is' + - '&7assigned to.' + - '&7' + - '&c&lWARNING' + - '&7This will remove any previous' + - '&7custom skill data.' Button: Custom '5': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' '7': type: SPLASH_POTION name: '&e&lPotion Skill Type' lore: - - '&7If you want to apply potions to' - - '&7the targeted players when this skill is' - - '&7called you can use this skill type.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' + - '&7If you want to apply potions to' + - '&7the targeted players when this skill is' + - '&7called you can use this skill type.' + - '&7' + - '&c&lWARNING' + - '&7This will remove any previous' + - '&7custom skill data.' Button: Potion '8': type: CREEPER_HEAD name: '&e&lGroup Skill Type' lore: - - '&7If you want to have multiple skills under' - - '&7one skill select this skill type and you' - - '&7can connect it to some of the already existing' - - '&7skills so you can have more then one go off' - - '&7from one skill calling. Only this displayName' - - '&7and customMessage will be used, the connected' - - '&7skill displayName and customMessage will be' - - '&7ignored.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom skill data.' + - '&7If you want to have multiple skills under' + - '&7one skill select this skill type and you' + - '&7can connect it to some of the already existing' + - '&7skills so you can have more then one go off' + - '&7from one skill calling. Only this displayName' + - '&7and customMessage will be used, the connected' + - '&7skill displayName and customMessage will be' + - '&7ignored.' + - '&7' + - '&c&lWARNING' + - '&7This will remove any previous' + - '&7custom skill data.' Button: Group PotionSkillEditorPanel: name: '&b&l{name} Skill Editor' @@ -1651,13 +1651,13 @@ PotionSkillEditorPanel: type: BOOK name: '&e&lPotion Guide' lore: - - '&7Here you can adjust the potion effects' - - '&7that are applied when the skill is' - - '&7called. If you want to remove a potion' - - '&7effect simply click on the potion and' - - '&7it will removed from the skill. If you' - - '&7want to add a new potion effect click' - - '&7on the green emerald block.' + - '&7Here you can adjust the potion effects' + - '&7that are applied when the skill is' + - '&7called. If you want to remove a potion' + - '&7effect simply click on the potion and' + - '&7it will removed from the skill. If you' + - '&7want to add a new potion effect click' + - '&7on the green emerald block.' '47': type: GLASS_PANE name: '&7' @@ -1668,22 +1668,22 @@ PotionSkillEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of custom potion effects.' + - '&7Click here to go to the previous' + - '&7page of custom potion effects.' PreviousPage: true '50': type: EMERALD_BLOCK name: '&e&lCreate a new Potion Effect' lore: - - '&7Click here to create a new potion' - - '&7effect.' + - '&7Click here to create a new potion' + - '&7effect.' Button: PotionEffect '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of custom potion effects.' + - '&7Click here to go to the next' + - '&7page of custom potion effects.' NextPage: true '52': type: GLASS_PANE @@ -1695,7 +1695,7 @@ PotionSkillEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' CreatePotionEffectEditorPanel: name: '&b&lCreate Potion Effect' slots: 9 @@ -1709,55 +1709,55 @@ CreatePotionEffectEditorPanel: type: GRAY_DYE name: '&c&lCancel Potion Effect' lore: - - '&7Click here to cancel the creation' - - '&7of this potion effect.' + - '&7Click here to cancel the creation' + - '&7of this potion effect.' Button: Cancel '4': type: EMERALD name: '&e&lLevel' lore: - - '&bCurrently: &f{level}' - - '&7' - - '&7Click here to change the level' - - '&7of the potion effect.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' + - '&bCurrently: &f{level}' + - '&7' + - '&7Click here to change the level' + - '&7of the potion effect.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bRight Click &8» &f-1' Button: Level '5': type: GUNPOWDER name: '&e&lPotion Effect Type' lore: - - '&bCurrently: &f{effect}' - - '&7' - - '&7Click here to change the potion' - - '&7effect type.' + - '&bCurrently: &f{effect}' + - '&7' + - '&7Click here to change the potion' + - '&7effect type.' Button: Effect '6': type: CLOCK name: '&e&lDuration' lore: - - '&bCurrently: &f{duration}s' - - '&7' - - '&7Click here to change the duration' - - '&7of the potion effect.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&bCurrently: &f{duration}s' + - '&7' + - '&7Click here to change the duration' + - '&7of the potion effect.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: Duration '9': type: LIME_DYE name: '&b&lConfirm' lore: - - '&7Click here to confirm the creation' - - '&7of the potion effect with data:' - - '&7' - - '&bDuration: &f{duration}s' - - '&bEffect: &f{effect}' - - '&bLevel: &f{level}' + - '&7Click here to confirm the creation' + - '&7of the potion effect with data:' + - '&7' + - '&bDuration: &f{duration}s' + - '&bEffect: &f{effect}' + - '&bLevel: &f{level}' Button: Confirm CommandSkillEditorPanel: name: '&b&l{name} Skill Editor' @@ -1772,14 +1772,14 @@ CommandSkillEditorPanel: type: BOOK name: '&e&lCommand Guide' lore: - - '&7Here you can adjust the commands that' - - '&7are applied when the skill is called.' - - '&7If you want to remove a command section' - - '&7simply just shift left click the section' - - '&7and it will be deleted.' - - '&7To create a new section click the green' - - '&7emerald block at the bottom middle of the' - - '&7GUI.' + - '&7Here you can adjust the commands that' + - '&7are applied when the skill is called.' + - '&7If you want to remove a command section' + - '&7simply just shift left click the section' + - '&7and it will be deleted.' + - '&7To create a new section click the green' + - '&7emerald block at the bottom middle of the' + - '&7GUI.' '47': type: GLASS_PANE name: '&7' @@ -1790,22 +1790,22 @@ CommandSkillEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of command sections.' + - '&7Click here to go to the previous' + - '&7page of command sections.' PreviousPage: true '50': type: EMERALD_BLOCK name: '&e&lAdd a new Command Section' lore: - - '&7Click here to add a new command section' - - '&7to the list.' + - '&7Click here to add a new command section' + - '&7to the list.' Button: AddNew '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of command sections.' + - '&7Click here to go to the next' + - '&7page of command sections.' NextPage: true '52': type: GLASS_PANE @@ -1817,7 +1817,7 @@ CommandSkillEditorPanel: type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' ModifyCommandEditorPanel: name: '&b&lCommand Editor' slots: 9 @@ -1834,28 +1834,28 @@ ModifyCommandEditorPanel: type: BOOK name: '&e&lCommands' lore: - - '&fCurrently selected commands:' - - '&7{commands}' + - '&fCurrently selected commands:' + - '&7{commands}' Button: Commands '5': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' '7': type: GUNPOWDER name: '&e&lChance' lore: - - '&bCurrently: &f{chance}%' - - '&7' - - '&7Click here to modify the chance' - - '&7value for this boss.' - - '&7' - - '&bLeft Click &8» &f+1.0%' - - '&bShift Left-Click &8» &f+0.1%' - - '&7' - - '&bRight Click &8» &f-1.0%' - - '&bShift Right-Click &8» &f-0.1%' + - '&bCurrently: &f{chance}%' + - '&7' + - '&7Click here to modify the chance' + - '&7value for this boss.' + - '&7' + - '&bLeft Click &8» &f+1.0%' + - '&bShift Left-Click &8» &f+0.1%' + - '&7' + - '&bRight Click &8» &f-1.0%' + - '&bShift Right-Click &8» &f-0.1%' Button: Chance CustomSkillEditorPanel: name: '&b&l{name} Skill Editor' @@ -1873,49 +1873,49 @@ CustomSkillEditorPanel: type: BOOK name: '&e&lCustom Skill Type' lore: - - '&bCurrently: &f{type}' - - '&7' - - '&7Click here to choose from one' - - '&7of the connected and set up' - - '&7custom skill types. This will' - - '&7also display any of the external' - - '&7custom skill types that are properly' - - '&7connected to the plugin.' + - '&bCurrently: &f{type}' + - '&7' + - '&7Click here to choose from one' + - '&7of the connected and set up' + - '&7custom skill types. This will' + - '&7also display any of the external' + - '&7custom skill types that are properly' + - '&7connected to the plugin.' Button: Type '5': type: DIAMOND name: '&e&lSpecial Settings' lore: - - '&7Click here to edit any special settings that' - - '&7are also included in this custom skill. If' - - '&7there is none then this button will not open' - - '&7another GUI.' + - '&7Click here to edit any special settings that' + - '&7are also included in this custom skill. If' + - '&7there is none then this button will not open' + - '&7another GUI.' Button: SpecialSettings '6': type: REDSTONE name: '&e&lMultiplier' lore: - - '&bCurrently: &f{multiplier}' - - '&7' - - '&7Click here to adjust the multiplier' - - '&7for the custom skill. Some skills will' - - '&7use this option, but some won''t. This' - - '&7custom skill &f{usesMultiplier}&7 use' - - '&7multiplier option.' - - '&7' - - '&bLeft Click &8» &f+1.0' - - '&bShift Left-Click &8» &f+0.1' - - '&7' - - '&bMiddle Click &8» &7Removes multiplier' - - '&7' - - '&bRight Click &8» &f-1.0' - - '&bShift Right-Click &8» &f-0.1' + - '&bCurrently: &f{multiplier}' + - '&7' + - '&7Click here to adjust the multiplier' + - '&7for the custom skill. Some skills will' + - '&7use this option, but some won''t. This' + - '&7custom skill &f{usesMultiplier}&7 use' + - '&7multiplier option.' + - '&7' + - '&bLeft Click &8» &f+1.0' + - '&bShift Left-Click &8» &f+0.1' + - '&7' + - '&bMiddle Click &8» &7Removes multiplier' + - '&7' + - '&bRight Click &8» &f-1.0' + - '&bShift Right-Click &8» &f-0.1' Button: Multiplier '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' CustomSkillTypeEditorPanel: name: '&b&l{name} Skill Editor' slots: 54 @@ -1929,17 +1929,17 @@ CustomSkillTypeEditorPanel: type: BOOK name: '&c&lSkill Type Guide' lore: - - '&7When selecting the custom skill type' - - '&7it is easiest to know what it is if' - - '&7you keep it related to the name of the' - - '&7skill. All you need to change the type' - - '&7is click on a new type from within this' - - '&7menu.' - - '&7' - - '&7To import new custom skill types you' - - '&7can get them custom made and injected' - - '&7in to the plugin or you can suggest them' - - '&7to be added in to the plugin.' + - '&7When selecting the custom skill type' + - '&7it is easiest to know what it is if' + - '&7you keep it related to the name of the' + - '&7skill. All you need to change the type' + - '&7is click on a new type from within this' + - '&7menu.' + - '&7' + - '&7To import new custom skill types you' + - '&7can get them custom made and injected' + - '&7in to the plugin or you can suggest them' + - '&7to be added in to the plugin.' '47': type: GLASS_PANE name: '&7' @@ -1950,26 +1950,26 @@ CustomSkillTypeEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of custom skill types.' + - '&7Click here to go to the previous' + - '&7page of custom skill types.' PreviousPage: true '50': type: EMERALD_BLOCK name: '&b&lSelected Custom Skill Type' lore: - - '&bCurrently: &f{selected}' - - '&7' - - '&7This is the currently assigned' - - '&7custom skill type to the skill.' - - '&7If you would like to change this' - - '&7simply click another one in this' - - '&7menu.' + - '&bCurrently: &f{selected}' + - '&7' + - '&7This is the currently assigned' + - '&7custom skill type to the skill.' + - '&7If you would like to change this' + - '&7simply click another one in this' + - '&7menu.' '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of custom skill types.' + - '&7Click here to go to the next' + - '&7page of custom skill types.' NextPage: true '52': type: GLASS_PANE @@ -1981,9 +1981,9 @@ CustomSkillTypeEditorPanel: type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the skill editor panel to configure' - - '&7the general skill options.' + - '&7Click this button to go back to' + - '&7the skill editor panel to configure' + - '&7the general skill options.' SpecialSettingsEditorPanel: name: '&b&l{name} Special Settings' slots: 54 @@ -1997,11 +1997,11 @@ SpecialSettingsEditorPanel: type: BOOK name: '&c&lSpecial Settings Guide' lore: - - '&7Here any special settings that have' - - '&7been assigned to a skill type will' - - '&7show up. If this GUI is empty then there' - - '&7is no special settings related to the' - - '&7skill.' + - '&7Here any special settings that have' + - '&7been assigned to a skill type will' + - '&7show up. If this GUI is empty then there' + - '&7is no special settings related to the' + - '&7skill.' '47': type: GLASS_PANE name: '&7' @@ -2012,26 +2012,26 @@ SpecialSettingsEditorPanel: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of special settings.' + - '&7Click here to go to the previous' + - '&7page of special settings.' PreviousPage: true '50': type: EMERALD_BLOCK name: '&b&lSelected Custom Skill Type' lore: - - '&bCurrently: &f{selected}' - - '&7' - - '&7This is the currently assigned' - - '&7custom skill type to the skill.' - - '&7If you would like to change this' - - '&7simply click another one in the' - - '&7skill type menu.' + - '&bCurrently: &f{selected}' + - '&7' + - '&7This is the currently assigned' + - '&7custom skill type to the skill.' + - '&7If you would like to change this' + - '&7simply click another one in the' + - '&7skill type menu.' '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of special settings.' + - '&7Click here to go to the next' + - '&7page of special settings.' NextPage: true '52': type: GLASS_PANE @@ -2043,9 +2043,9 @@ SpecialSettingsEditorPanel: type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the skill editor panel to configure' - - '&7the general skill options.' + - '&7Click this button to go back to' + - '&7the skill editor panel to configure' + - '&7the general skill options.' DropTableMainEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -2062,35 +2062,35 @@ DropTableMainEditorPanel: type: BOOK name: '&c&lDrop Table Guide' lore: - - '&7Here you are able to configure' - - '&7each aspect of the drop table to' - - '&7your liking. Remember that the moment' - - '&7something changes then it will also' - - '&7change for any live bosses.' + - '&7Here you are able to configure' + - '&7each aspect of the drop table to' + - '&7your liking. Remember that the moment' + - '&7something changes then it will also' + - '&7change for any live bosses.' '4': type: GUNPOWDER name: '&e&lType' lore: - - '&bCurrently: &f{type}' - - '&7Click this to change the drop table type. Keep' - - '&7in mind that when you change your drop table' - - '&7type the previous table data will be erased' - - '&7to make room for the new table format.' + - '&bCurrently: &f{type}' + - '&7Click this to change the drop table type. Keep' + - '&7in mind that when you change your drop table' + - '&7type the previous table data will be erased' + - '&7to make room for the new table format.' Button: Type '6': type: DIAMOND name: '&e&lRewards' lore: - - '&7Click here to edit the rewards related to' - - '&7this drop table. The menu that appears will' - - '&7be relevant to the drop table type.' + - '&7Click here to edit the rewards related to' + - '&7this drop table. The menu that appears will' + - '&7be relevant to the drop table type.' Button: Rewards '9': type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the drop table list page.' + - '&7Click this button to go back to' + - '&7the drop table list page.' DropTableTypeEditorPanel: name: '&b&l{name} Editor' slots: 9 @@ -2107,46 +2107,46 @@ DropTableTypeEditorPanel: type: SPLASH_POTION name: '&e&lSpray Drop Table Type' lore: - - '&7If you set this to the drop table type' - - '&7then you will be able to set rewards that' - - '&7will be sprayed out from the bosses' - - '&7location in to random locations around him.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom reward data.' + - '&7If you set this to the drop table type' + - '&7then you will be able to set rewards that' + - '&7will be sprayed out from the bosses' + - '&7location in to random locations around him.' + - '&7' + - '&c&lWARNING' + - '&7This will remove any previous' + - '&7custom reward data.' Button: Spray '5': type: HOPPER name: '&e&lDrop Drop Table Type' lore: - - '&7If you set this to the drop table type' - - '&7then you will be able to set rewards that' - - '&7will be drop on the bosses death location' - - '&7for players to loot.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom reward data.' + - '&7If you set this to the drop table type' + - '&7then you will be able to set rewards that' + - '&7will be drop on the bosses death location' + - '&7for players to loot.' + - '&7' + - '&c&lWARNING' + - '&7This will remove any previous' + - '&7custom reward data.' Button: Drop '7': type: EMERALD name: '&e&lGive Drop Table Type' lore: - - '&7If you set this to the drop table type' - - '&7then you will be able to set rewards that' - - '&7will be given to the specified damaging' - - '&7positions on the boss damage map.' - - '&7' - - '&c&lWARNING' - - '&7This will remove any previous' - - '&7custom reward data.' + - '&7If you set this to the drop table type' + - '&7then you will be able to set rewards that' + - '&7will be given to the specified damaging' + - '&7positions on the boss damage map.' + - '&7' + - '&c&lWARNING' + - '&7This will remove any previous' + - '&7custom reward data.' Button: Give '9': type: PAPER name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' SprayDropTableMainEditMenu: name: '&b&l{name} Editor' slots: 9 @@ -2163,60 +2163,60 @@ SprayDropTableMainEditMenu: type: DIAMOND name: '&e&lRewards' lore: - - '&7Click here to modify the rewards and their' - - '&7assigned drop chances. You can add more by' - - '&7clicking the emerald block at the middle' - - '&7bottom of the rewards menu.' + - '&7Click here to modify the rewards and their' + - '&7assigned drop chances. You can add more by' + - '&7clicking the emerald block at the middle' + - '&7bottom of the rewards menu.' Button: Rewards '3': type: GUNPOWDER name: '&e&lRandom Drops' lore: - - '&bCurrently: &f{randomDrops}' - - '&7Click here to toggle the random drop mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7drop table is called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7drop table is called it will go from top to' - - '&7bottom through the list.' + - '&bCurrently: &f{randomDrops}' + - '&7Click here to toggle the random drop mode.' + - '&7If this is set to &ftrue&7 then when the' + - '&7drop table is called it will shuffle the' + - '&7list contents so it''s not in the same order.' + - '&7If this is set to &ffalse&7 then when the' + - '&7drop table is called it will go from top to' + - '&7bottom through the list.' Button: RandomDrops '5': type: REDSTONE name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' '7': type: PAPER name: '&e&lMax Distance' lore: - - '&bCurrently: &f{maxDistance}' - - '&7Click here to modify the maximum distance' - - '&7an item can be thrown from the bosses death' - - '&7location when the drop table is called.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&bCurrently: &f{maxDistance}' + - '&7Click here to modify the maximum distance' + - '&7an item can be thrown from the bosses death' + - '&7location when the drop table is called.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: MaxDistance '8': type: EMERALD name: '&e&lMax Drops' lore: - - '&bCurrently: &f{maxDrops}' - - '&7Click here to modify the maximum amount of' - - '&7drops this drop table can have. Keep in mind' - - '&7that when getting drops the drop table will' - - '&7only cycle through the list once. Not until' - - '&7this amount of drops has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&bCurrently: &f{maxDrops}' + - '&7Click here to modify the maximum amount of' + - '&7drops this drop table can have. Keep in mind' + - '&7that when getting drops the drop table will' + - '&7only cycle through the list once. Not until' + - '&7this amount of drops has been met.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: MaxDrops DropDropTableMainEditMenu: name: '&b&l{name} Editor' @@ -2234,46 +2234,46 @@ DropDropTableMainEditMenu: type: DIAMOND name: '&e&lRewards' lore: - - '&7Click here to modify the rewards and their' - - '&7assigned drop chances. You can add more by' - - '&7clicking the emerald block at the middle' - - '&7bottom of the rewards menu.' + - '&7Click here to modify the rewards and their' + - '&7assigned drop chances. You can add more by' + - '&7clicking the emerald block at the middle' + - '&7bottom of the rewards menu.' Button: Rewards '4': type: GUNPOWDER name: '&e&lRandom Drops' lore: - - '&bCurrently: &f{randomDrops}' - - '&7Click here to toggle the random drop mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7drop table is called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7drop table is called it will go from top to' - - '&7bottom through the list.' + - '&bCurrently: &f{randomDrops}' + - '&7Click here to toggle the random drop mode.' + - '&7If this is set to &ftrue&7 then when the' + - '&7drop table is called it will shuffle the' + - '&7list contents so it''s not in the same order.' + - '&7If this is set to &ffalse&7 then when the' + - '&7drop table is called it will go from top to' + - '&7bottom through the list.' Button: RandomDrops '5': type: EMERALD name: '&e&lMax Drops' lore: - - '&bCurrently: &f{maxDrops}' - - '&7Click here to modify the maximum amount of' - - '&7drops this drop table can have. Keep in mind' - - '&7that when getting drops the drop table will' - - '&7only cycle through the list once. Not until' - - '&7this amount of drops has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&bCurrently: &f{maxDrops}' + - '&7Click here to modify the maximum amount of' + - '&7drops this drop table can have. Keep in mind' + - '&7that when getting drops the drop table will' + - '&7only cycle through the list once. Not until' + - '&7this amount of drops has been met.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: MaxDrops '9': type: REDSTONE name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' GiveRewardPositionListMenu: name: '&b&l{name} DropTable' slots: 54 @@ -2287,14 +2287,14 @@ GiveRewardPositionListMenu: type: BOOK name: '&c&lGive Position Reward Guide' lore: - - '&7In this list it displays the position' - - '&7sections for the selected drop table.' - - '&7If you want to add a new position section' - - '&7then simply click the EmeraldBlock and' - - '&7the next available position will be' - - '&7created.' - - '&7To remove a position simply shift-right' - - '&7click the position you want to remove.' + - '&7In this list it displays the position' + - '&7sections for the selected drop table.' + - '&7If you want to add a new position section' + - '&7then simply click the EmeraldBlock and' + - '&7the next available position will be' + - '&7created.' + - '&7To remove a position simply shift-right' + - '&7click the position you want to remove.' '47': type: GLASS_PANE name: '&7' @@ -2305,25 +2305,25 @@ GiveRewardPositionListMenu: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of damage positions.' + - '&7Click here to go to the previous' + - '&7page of damage positions.' PreviousPage: true '50': type: EMERALD_BLOCK name: '&e&lAdd new Position' lore: - - '&7Click here to add a new position' - - '&7to the drop table. This will find' - - '&7the next available position and' - - '&7create a new reward section for' - - '&7that position.' + - '&7Click here to add a new position' + - '&7to the drop table. This will find' + - '&7the next available position and' + - '&7create a new reward section for' + - '&7that position.' Button: NewPosition '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of damage positions.' + - '&7Click here to go to the next' + - '&7page of damage positions.' NextPage: true '52': type: GLASS_PANE @@ -2335,8 +2335,8 @@ GiveRewardPositionListMenu: type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the drop table main edit menu.' + - '&7Click this button to go back to' + - '&7the drop table main edit menu.' GiveRewardRewardsListMenu: name: '&b&l{name} DropTable' slots: 54 @@ -2350,13 +2350,13 @@ GiveRewardRewardsListMenu: type: BOOK name: '&c&lGive Reward Rewards Guide' lore: - - '&7In this list it displays the drop sections' - - '&7assigned to the drop position of &f{position}&7.' - - '&7To edit the drops simply click on the drop' - - '&7section you wish to edit and then you can' - - '&7modify the data there.' - - '&7To remove a drop section simply shift-right' - - '&7click the section you want to remove.' + - '&7In this list it displays the drop sections' + - '&7assigned to the drop position of &f{position}&7.' + - '&7To edit the drops simply click on the drop' + - '&7section you wish to edit and then you can' + - '&7modify the data there.' + - '&7To remove a drop section simply shift-right' + - '&7click the section you want to remove.' '47': type: GLASS_PANE name: '&7' @@ -2367,25 +2367,25 @@ GiveRewardRewardsListMenu: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of drop sections.' + - '&7Click here to go to the previous' + - '&7page of drop sections.' PreviousPage: true '50': type: EMERALD_BLOCK name: '&e&lAdd new Drop Section' lore: - - '&7Click here to add a new drop section' - - '&7to the drop table. This will find' - - '&7the next available drop section and' - - '&7create a new drop section for' - - '&7that position.' + - '&7Click here to add a new drop section' + - '&7to the drop table. This will find' + - '&7the next available drop section and' + - '&7create a new drop section for' + - '&7that position.' Button: NewRewardSection '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of drop sections.' + - '&7Click here to go to the next' + - '&7page of drop sections.' NextPage: true '52': type: GLASS_PANE @@ -2397,8 +2397,8 @@ GiveRewardRewardsListMenu: type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the reward position list menu.' + - '&7Click this button to go back to' + - '&7the reward position list menu.' GiveRewardMainEditMenu: name: '&b&l{name} DropTable' slots: 27 @@ -2418,101 +2418,101 @@ GiveRewardMainEditMenu: type: GUNPOWDER name: '&e&lRandom Drops' lore: - - '&bCurrently: &f{randomDrops}' - - '&7Click here to toggle the random drop mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7drop table is called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7drop table is called it will go from top to' - - '&7bottom through the list.' + - '&bCurrently: &f{randomDrops}' + - '&7Click here to toggle the random drop mode.' + - '&7If this is set to &ftrue&7 then when the' + - '&7drop table is called it will shuffle the' + - '&7list contents so it''s not in the same order.' + - '&7If this is set to &ffalse&7 then when the' + - '&7drop table is called it will go from top to' + - '&7bottom through the list.' Button: RandomDrops '12': type: EMERALD name: '&e&lMax Drops' lore: - - '&bCurrently: &f{maxDrops}' - - '&7Click here to modify the maximum amount of' - - '&7drops this drop section can have. Keep in mind' - - '&7that when getting drops the drop section will' - - '&7only cycle through the list once. Not until' - - '&7this amount of drops has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&bCurrently: &f{maxDrops}' + - '&7Click here to modify the maximum amount of' + - '&7drops this drop section can have. Keep in mind' + - '&7that when getting drops the drop section will' + - '&7only cycle through the list once. Not until' + - '&7this amount of drops has been met.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: MaxDrops '13': type: CHEST name: '&e&lItem Drops' lore: - - '&7Click here to modify the custom item drops' - - '&7and their drop chance for this drop section.' - - '&7There is currently &f{drops}&7 drops set up.' + - '&7Click here to modify the custom item drops' + - '&7and their drop chance for this drop section.' + - '&7There is currently &f{drops}&7 drops set up.' Button: ItemDrops '14': type: GLOWSTONE_DUST name: '&e&lRequired Percentage' lore: - - '&bCurrently: &f{requiredPercentage}%' - - '&7Click here to modify the required percentage to' - - '&7receive this drop section. If the percentage is' - - '&75% then you need to do 5% damage to the boss to' - - '&7get the rewards in this drop section.' - - '&7' - - '&bLeft Click &8» &f+1%' - - '&bShift Left-Click &8» &f+10%' - - '&7' - - '&bRight Click &8» &f-1%' - - '&bShift Right-Click &8» &f-10%' + - '&bCurrently: &f{requiredPercentage}%' + - '&7Click here to modify the required percentage to' + - '&7receive this drop section. If the percentage is' + - '&75% then you need to do 5% damage to the boss to' + - '&7get the rewards in this drop section.' + - '&7' + - '&bLeft Click &8» &f+1%' + - '&bShift Left-Click &8» &f+10%' + - '&7' + - '&bRight Click &8» &f-1%' + - '&bShift Right-Click &8» &f-10%' Button: RequiredPercentage '15': type: CHEST name: '&e&lCommand Drops' lore: - - '&7Click here to modify the custom command drops' - - '&7and their drop chance for this drop section.' - - '&7There is currently &f{commands}&7 commands' - - '&7set up.' + - '&7Click here to modify the custom command drops' + - '&7and their drop chance for this drop section.' + - '&7There is currently &f{commands}&7 commands' + - '&7set up.' Button: CommandDrops '16': type: EMERALD name: '&e&lMax Commands' lore: - - '&bCurrently: &f{maxCommands}' - - '&7Click here to modify the maximum amount of' - - '&7commands this drop section can have. Keep in mind' - - '&7that when getting drops the drop section will' - - '&7only cycle through the list once. Not until' - - '&7this amount of commands has been met.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bShift Left-Click &8» &f+10' - - '&7' - - '&bRight Click &8» &f-1' - - '&bShift Right-Click &8» &f-10' + - '&bCurrently: &f{maxCommands}' + - '&7Click here to modify the maximum amount of' + - '&7commands this drop section can have. Keep in mind' + - '&7that when getting drops the drop section will' + - '&7only cycle through the list once. Not until' + - '&7this amount of commands has been met.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bShift Left-Click &8» &f+10' + - '&7' + - '&bRight Click &8» &f-1' + - '&bShift Right-Click &8» &f-10' Button: MaxCommands '17': type: GUNPOWDER name: '&e&lRandom Commands' lore: - - '&bCurrently: &f{randomCommands}' - - '&7Click here to toggle the random command mode.' - - '&7If this is set to &ftrue&7 then when the' - - '&7commands are called it will shuffle the' - - '&7list contents so it''s not in the same order.' - - '&7If this is set to &ffalse&7 then when the' - - '&7commands are called it will go from top to' - - '&7bottom through the list.' + - '&bCurrently: &f{randomCommands}' + - '&7Click here to toggle the random command mode.' + - '&7If this is set to &ftrue&7 then when the' + - '&7commands are called it will shuffle the' + - '&7list contents so it''s not in the same order.' + - '&7If this is set to &ffalse&7 then when the' + - '&7commands are called it will go from top to' + - '&7bottom through the list.' Button: RandomDrops '23': type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the reward drop section list menu.' + - '&7Click this button to go back to' + - '&7the reward drop section list menu.' DropTableRewardsListEditMenu: name: '&b&l{name} DropTable' slots: 54 @@ -2526,16 +2526,16 @@ DropTableRewardsListEditMenu: type: BOOK name: '&c&lDrop Rewards Guide' lore: - - '&7Here you can adjust the rewards for' - - '&7the skill with the drop layout. To' - - '&7adjust the chance of a section or to' - - '&7remove a section, then all you have' - - '&7to do is click on the section you''d' - - '&7like to modify and then click the' - - '&7corresponding button.' - - '&7To add a new section click on the' - - '&7emerald block in the bottom middle of' - - '&7the menu in between the page buttons.' + - '&7Here you can adjust the rewards for' + - '&7the skill with the drop layout. To' + - '&7adjust the chance of a section or to' + - '&7remove a section, then all you have' + - '&7to do is click on the section you''d' + - '&7like to modify and then click the' + - '&7corresponding button.' + - '&7To add a new section click on the' + - '&7emerald block in the bottom middle of' + - '&7the menu in between the page buttons.' '47': type: GLASS_PANE name: '&7' @@ -2546,23 +2546,23 @@ DropTableRewardsListEditMenu: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of rewards.' + - '&7Click here to go to the previous' + - '&7page of rewards.' PreviousPage: true '50': type: EMERALD_BLOCK name: '&b&lAdd a New Reward Section' lore: - - '&7Click here if you would like to add' - - '&7a new reward section to this drop' - - '&7table.' + - '&7Click here if you would like to add' + - '&7a new reward section to this drop' + - '&7table.' Button: NewReward '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of rewards.' + - '&7Click here to go to the next' + - '&7page of rewards.' NextPage: true '52': type: GLASS_PANE @@ -2574,8 +2574,8 @@ DropTableRewardsListEditMenu: type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the drop table main edit menu.' + - '&7Click this button to go back to' + - '&7the drop table main edit menu.' DropTableNewRewardEditMenu: name: '&b&lNew Reward for DropTable' slots: 54 @@ -2589,22 +2589,22 @@ DropTableNewRewardEditMenu: type: BOOK name: '&c&lNew Drop Reward Guide' lore: - - '&7Once you click an item within this' - - '&7menu it will create a new reward' - - '&7section with that selected item' - - '&7to the drop table you were working' - - '&7on. From there you can adjust the' - - '&7chance for it to be sprayed.' - - '&7' - - '&c&lWARNING' - - '&7At this moment you cannot have' - - '&7two sections for the same item,' - - '&7an easy way to bypass this is to' - - '&7add a new Item with the same' - - '&7itemstack, therefore giving it' - - '&7a new name, and allowing for' - - '&7another new section of the same' - - '&7item.' + - '&7Once you click an item within this' + - '&7menu it will create a new reward' + - '&7section with that selected item' + - '&7to the drop table you were working' + - '&7on. From there you can adjust the' + - '&7chance for it to be sprayed.' + - '&7' + - '&c&lWARNING' + - '&7At this moment you cannot have' + - '&7two sections for the same item,' + - '&7an easy way to bypass this is to' + - '&7add a new Item with the same' + - '&7itemstack, therefore giving it' + - '&7a new name, and allowing for' + - '&7another new section of the same' + - '&7item.' '47': type: GLASS_PANE name: '&7' @@ -2615,8 +2615,8 @@ DropTableNewRewardEditMenu: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page of itemstacks.' + - '&7Click here to go to the previous' + - '&7page of itemstacks.' PreviousPage: true '50': type: GLASS_PANE @@ -2625,8 +2625,8 @@ DropTableNewRewardEditMenu: type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page of itemstacks.' + - '&7Click here to go to the next' + - '&7page of itemstacks.' NextPage: true '52': type: GLASS_PANE @@ -2638,8 +2638,8 @@ DropTableNewRewardEditMenu: type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back to' - - '&7the drop table reward list menu.' + - '&7Click this button to go back to' + - '&7the drop table reward list menu.' DropTableRewardMainEditMenu: name: '&b&l{name} DropTable' slots: 9 @@ -2656,36 +2656,36 @@ DropTableRewardMainEditMenu: type: GUNPOWDER name: '&e&lSelected ItemStack' lore: - - '&bCurrently: &f{itemStack}' - - '&7This is the selected itemStack for this' - - '&7reward section.' + - '&bCurrently: &f{itemStack}' + - '&7This is the selected itemStack for this' + - '&7reward section.' '4': type: EMERALD name: '&e&lChance' lore: - - '&bCurrently: &f{chance}' - - '&7Click here to modify the chance of this' - - '&7reward ' - - '&7' - - '&bLeft Click &8» &f+1%' - - '&bShift Left-Click &8» &f+0.1%' - - '&7' - - '&bRight Click &8» &f-1%' - - '&bShift Right-Click &8» &f-0.1%' + - '&bCurrently: &f{chance}' + - '&7Click here to modify the chance of this' + - '&7reward ' + - '&7' + - '&bLeft Click &8» &f+1%' + - '&bShift Left-Click &8» &f+0.1%' + - '&7' + - '&bRight Click &8» &f-1%' + - '&bShift Right-Click &8» &f-0.1%' Button: Chance '5': type: BARRIER name: '&e&lClick here to remove' lore: - - '&7Click here to remove this rewards section.' - - '&7You can always re-create this section if' - - '&7was a mistake.' + - '&7Click here to remove this rewards section.' + - '&7You can always re-create this section if' + - '&7was a mistake.' Button: Remove '9': type: REDSTONE name: '&e&lGo Back' lore: - - '&7Click here to go back.' + - '&7Click here to go back.' MainAutoSpawnEditMenu: name: '&b&l{name} AutoSpawn' slots: 9 @@ -2702,46 +2702,46 @@ MainAutoSpawnEditMenu: type: DIAMOND name: '&e&lSpecial Settings' lore: - - '&7Click here to edit the finer settings' - - '&7related to this auto spawn section.' + - '&7Click here to edit the finer settings' + - '&7related to this auto spawn section.' Button: SpecialSettings '3': type: GUNPOWDER name: '&e&lType' lore: - - '&bCurrently: &f{type}' - - '&7This is the current auto spawn' - - '&7section type. Click here to open' - - '&7a menu to select the type.' + - '&bCurrently: &f{type}' + - '&7This is the current auto spawn' + - '&7section type. Click here to open' + - '&7a menu to select the type.' Button: Type '5': type: LEVER name: '&e&lToggle Editing' lore: - - '&7Click here to toggle the auto spawn' - - '&7editing mode.' - - '&7This will disable the auto spawn until' - - '&7it is enabled again.' - - '&7' - - '&bCurrently Disabled for Editing: &f{editing}' + - '&7Click here to toggle the auto spawn' + - '&7editing mode.' + - '&7This will disable the auto spawn until' + - '&7it is enabled again.' + - '&7' + - '&bCurrently Disabled for Editing: &f{editing}' Button: Editing '7': type: PAPER name: '&e&lEntities' lore: - - '&7Click here to edit the assigned boss' - - '&7entities to this auto spawn section.' - - '&7' - - '&bCurrently:' - - '&f{entities}' + - '&7Click here to edit the assigned boss' + - '&7entities to this auto spawn section.' + - '&7' + - '&bCurrently:' + - '&f{entities}' Button: Entities '8': type: EMERALD name: '&e&lCustom Settings' lore: - - '&7Click here to edit any custom settings that' - - '&7are also included in this auto spawn type. If' - - '&7there is none then the GUI up next will be empty.' + - '&7Click here to edit any custom settings that' + - '&7are also included in this auto spawn type. If' + - '&7there is none then the GUI up next will be empty.' Button: CustomSettings AutoSpawnEntitiesEditMenu: name: '&b&l{name} AutoSpawn' @@ -2765,20 +2765,20 @@ AutoSpawnEntitiesEditMenu: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page.' + - '&7Click here to go to the previous' + - '&7page.' PreviousPage: true '50': type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back.' + - '&7Click this button to go back.' '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page.' + - '&7Click here to go to the next' + - '&7page.' NextPage: true '52': type: GLASS_PANE @@ -2811,20 +2811,20 @@ AutoSpawnCustomSettingsEditMenu: type: ARROW name: '&e&l&m<-&e&l Previous Page' lore: - - '&7Click here to go to the previous' - - '&7page.' + - '&7Click here to go to the previous' + - '&7page.' PreviousPage: true '50': type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back.' + - '&7Click this button to go back.' '51': type: ARROW name: '&e&lNext Page &e&l&m->' lore: - - '&7Click here to go to the next' - - '&7page.' + - '&7Click here to go to the next' + - '&7page.' NextPage: true '52': type: GLASS_PANE @@ -2851,80 +2851,80 @@ AutoSpawnSpecialSettingsEditMenu: type: DIAMOND name: '&e&lShuffle Entities' lore: - - '&bCurrently: &f{shuffleEntities}' - - '&7' - - '&7Click here to toggle the entities being' - - '&7shuffled before being called.' + - '&bCurrently: &f{shuffleEntities}' + - '&7' + - '&7Click here to toggle the entities being' + - '&7shuffled before being called.' Button: ShuffleEntities '2': type: GUNPOWDER name: '&e&lMax Alive Entities At Once' lore: - - '&bCurrently: &f{maxAliveEntities}' - - '&7' - - '&7This is the max alive entities from this' - - '&7auto spawn section at once. If more then' - - '&7this amount of entities is spawned at once' - - '&7then you will have to kill all entities' - - '&7before another can spawn.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' + - '&bCurrently: &f{maxAliveEntities}' + - '&7' + - '&7This is the max alive entities from this' + - '&7auto spawn section at once. If more then' + - '&7this amount of entities is spawned at once' + - '&7then you will have to kill all entities' + - '&7before another can spawn.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bRight Click &8» &f-1' Button: MaxAliveEntities '3': type: FIREWORK_STAR name: '&e&lAmount of Bosses Per Spawn' lore: - - '&bCurrently: &f{amountPerSpawn}' - - '&7' - - '&7This is the amount of bosses to be spawned' - - '&7at one interval. This can be higher then the' - - '&7max alive entities at once but you will need' - - '&7to kill the amount of bosses till it the currently' - - '&7active amount is less then the max amount so' - - '&7it can spawn again.' - - '&7' - - '&bLeft Click &8» &f+1' - - '&bRight Click &8» &f-1' + - '&bCurrently: &f{amountPerSpawn}' + - '&7' + - '&7This is the amount of bosses to be spawned' + - '&7at one interval. This can be higher then the' + - '&7max alive entities at once but you will need' + - '&7to kill the amount of bosses till it the currently' + - '&7active amount is less then the max amount so' + - '&7it can spawn again.' + - '&7' + - '&bLeft Click &8» &f+1' + - '&bRight Click &8» &f-1' Button: AmountPerSpawn '5': type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back.' + - '&7Click this button to go back.' '7': type: PAPER name: '&e&lSpawn When Chunk Isn''t Loaded' lore: - - '&bCurrently: &f{chunkIsntLoaded}' - - '&7' - - '&7This will determine if the boss can spawn' - - '&7even when the chunk is unloaded. This will' - - '&7load the chunk and keep it loaded while the' - - '&7boss is alive if this is set to true.' + - '&bCurrently: &f{chunkIsntLoaded}' + - '&7' + - '&7This will determine if the boss can spawn' + - '&7even when the chunk is unloaded. This will' + - '&7load the chunk and keep it loaded while the' + - '&7boss is alive if this is set to true.' Button: ChunkIsntLoaded '8': type: EMERALD name: '&e&lOverride Default Spawn Message' lore: - - '&bCurrently: &f{overrideDefaultMessage}' - - '&7' - - '&7Click here to toggle the overriding of the' - - '&7default spawn messages. If this is set to' - - '&7true it won''t use the default boss spawn' - - '&7messages and it will use the one assigned' - - '&7to this auto spawn section.' + - '&bCurrently: &f{overrideDefaultMessage}' + - '&7' + - '&7Click here to toggle the overriding of the' + - '&7default spawn messages. If this is set to' + - '&7true it won''t use the default boss spawn' + - '&7messages and it will use the one assigned' + - '&7to this auto spawn section.' Button: OverrideSpawnMessage '9': type: CHEST name: '&e&lSpawn Message' lore: - - '&bCurrently: &f{spawnMessage}' - - '&7' - - '&7Click here to change which spawn message' - - '&7is used for the auto spawn section. If the' - - '&7overriding of the default message is true' - - '&7only then will this message be used.' + - '&bCurrently: &f{spawnMessage}' + - '&7' + - '&7Click here to change which spawn message' + - '&7is used for the auto spawn section. If the' + - '&7overriding of the default message is true' + - '&7only then will this message be used.' Button: SpawnMessage AutoSpawnTypeEditMenu: name: '&b&l{name} AutoSpawn' @@ -2942,43 +2942,43 @@ AutoSpawnTypeEditMenu: type: CLOCK name: '&e&lInterval Spawn System' lore: - - '&7Select this spawn system if you want to make' - - '&7the bosses spawn at a certain interval at a' - - '&7specific location.' + - '&7Select this spawn system if you want to make' + - '&7the bosses spawn at a certain interval at a' + - '&7specific location.' Button: IntervalSystem '3': type: GRASS_BLOCK name: '&e&lWilderness Spawn System' lore: - - '&7Select this spawn system if you want to make' - - '&7the boss(es) spawn randomly in the wilderness' - - '&7as players load the chunks.' - - '&7' - - '&c&lComing soon...' + - '&7Select this spawn system if you want to make' + - '&7the boss(es) spawn randomly in the wilderness' + - '&7as players load the chunks.' + - '&7' + - '&c&lComing soon...' Button: WildernessSystem '4': type: MAGMA_CREAM name: '&e&lBiome Spawn System' lore: - - '&7Select this spawn system if you want to make' - - '&7the boss(es) spawn randomly in specific biomes' - - '&7as players load and unload the chunks which are' - - '&7the selected biome.' - - '&7' - - '&c&lComing soon...' + - '&7Select this spawn system if you want to make' + - '&7the boss(es) spawn randomly in specific biomes' + - '&7as players load and unload the chunks which are' + - '&7the selected biome.' + - '&7' + - '&c&lComing soon...' Button: BiomeSystem '5': type: SPAWNER name: '&e&lMob Spawner Spawn System' lore: - - '&7Select this spawn system if you want to make' - - '&7the boss(es) spawn randomly within the selected' - - '&7spawner types.' - - '&7' - - '&c&lComing soon...' + - '&7Select this spawn system if you want to make' + - '&7the boss(es) spawn randomly within the selected' + - '&7spawner types.' + - '&7' + - '&c&lComing soon...' Button: SpawnerSystem '9': type: REDSTONE name: '&cClick here to go back' lore: - - '&7Click this button to go back.' \ No newline at end of file + - '&7Click this button to go back.' \ No newline at end of file diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java index d00cc17..6c28dd9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java @@ -21,7 +21,6 @@ import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.file.YmlFileHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; @@ -66,7 +65,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { private MinionMechanicManager minionMechanicManager; private MinionEntityContainer minionEntityContainer; - private VersionHandler versionHandler = new VersionHandler(); private DebugManager debugManager = new DebugManager(); private YmlFileHandler langFileHandler, editorFileHandler, displayFileHandler; @@ -74,6 +72,10 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { private boolean debug = true; + public static EpicBosses getInstance() { + return INSTANCE; + } + @Override public void onPluginLoad() { INSTANCE = this; @@ -241,10 +243,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { Message.setFile(lang); } - public static EpicBosses getInstance() { - return INSTANCE; - } - public MessagesFileManager getBossMessagesFileManager() { return this.bossMessagesFileManager; } @@ -341,10 +339,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { return this.minionEntityContainer; } - public VersionHandler getVersionHandler() { - return this.versionHandler; - } - public DebugManager getDebugManager() { return this.debugManager; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java index 28e8c4e..b78e7db 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java @@ -33,7 +33,7 @@ public class AutoSpawn { } public IntervalSpawnElement getIntervalSpawnData() { - if(getType().equalsIgnoreCase("INTERVAL")) { + if (getType().equalsIgnoreCase("INTERVAL")) { return BossesGson.get().fromJson(this.customData, IntervalSpawnElement.class); } @@ -41,11 +41,11 @@ public class AutoSpawn { } public boolean isCompleteEnoughToSpawn() { - if(this.type == null) return false; + if (this.type == null) return false; List entities = getEntities(); - if(entities == null || entities.isEmpty()) return false; + if (entities == null || entities.isEmpty()) return false; return true; } @@ -54,38 +54,38 @@ public class AutoSpawn { return this.editing; } - public String getType() { - return this.type; - } - - public List getEntities() { - return this.entities; - } - - public AutoSpawnSettings getAutoSpawnSettings() { - return this.autoSpawnSettings; - } - - public JsonObject getCustomData() { - return this.customData; - } - public void setEditing(boolean editing) { this.editing = editing; } + public String getType() { + return this.type; + } + public void setType(String type) { this.type = type; } + public List getEntities() { + return this.entities; + } + public void setEntities(List entities) { this.entities = entities; } + public AutoSpawnSettings getAutoSpawnSettings() { + return this.autoSpawnSettings; + } + public void setAutoSpawnSettings(AutoSpawnSettings autoSpawnSettings) { this.autoSpawnSettings = autoSpawnSettings; } + public JsonObject getCustomData() { + return this.customData; + } + public void setCustomData(JsonObject customData) { this.customData = customData; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/SpawnType.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/SpawnType.java index 4f3a73d..56ac896 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/SpawnType.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/SpawnType.java @@ -19,15 +19,11 @@ public enum SpawnType { this.rank = rank; } - public SpawnType getNext() { - return get(this.rank+1); - } - public static SpawnType getCurrent(String input) { - if(input == null || input.isEmpty()) return BLANK; + if (input == null || input.isEmpty()) return BLANK; - for(SpawnType spawnTypes : values()) { - if(spawnTypes.name().equalsIgnoreCase(input)) return spawnTypes; + for (SpawnType spawnTypes : values()) { + if (spawnTypes.name().equalsIgnoreCase(input)) return spawnTypes; } return BLANK; @@ -36,20 +32,24 @@ public enum SpawnType { public static List getSpawnTypes() { List list = new ArrayList<>(); - for(SpawnType spawnTypes : values()) { - if(spawnTypes.rank > 0) list.add(spawnTypes); + for (SpawnType spawnTypes : values()) { + if (spawnTypes.rank > 0) list.add(spawnTypes); } return list; } private static SpawnType get(int rank) { - for(SpawnType spawnTypes : values()) { - if(spawnTypes.rank == rank) { + for (SpawnType spawnTypes : values()) { + if (spawnTypes.rank == rank) { return spawnTypes; } } return INTERVAL; } + + public SpawnType getNext() { + return get(this.rank + 1); + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java index dd78d44..9a08369 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/handlers/IntervalSpawnHandler.java @@ -78,11 +78,11 @@ public class IntervalSpawnHandler { ClickType clickType = event.getClick(); int amountToModifyBy; - if(clickType == ClickType.SHIFT_LEFT) { + if (clickType == ClickType.SHIFT_LEFT) { amountToModifyBy = 10; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { amountToModifyBy = -1; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { amountToModifyBy = -10; } else { amountToModifyBy = 1; @@ -92,7 +92,7 @@ public class IntervalSpawnHandler { String modifyValue; int newAmount; - if(amountToModifyBy > 0) { + if (amountToModifyBy > 0) { modifyValue = "increased"; newAmount = currentAmount + amountToModifyBy; } else { @@ -100,7 +100,7 @@ public class IntervalSpawnHandler { newAmount = currentAmount + amountToModifyBy; } - if(newAmount <= 0) { + if (newAmount <= 0) { newAmount = 0; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java index 0e6aa05..d0c5a3d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/settings/AutoSpawnSettings.java @@ -27,46 +27,46 @@ public class AutoSpawnSettings { return this.maxAliveAtOnce; } - public Integer getAmountPerSpawn() { - return this.amountPerSpawn; - } - - public Boolean getSpawnWhenChunkIsntLoaded() { - return this.spawnWhenChunkIsntLoaded; - } - - public Boolean getOverrideDefaultSpawnMessage() { - return this.overrideDefaultSpawnMessage; - } - - public Boolean getShuffleEntitiesList() { - return this.shuffleEntitiesList; - } - - public String getSpawnMessage() { - return this.spawnMessage; - } - public void setMaxAliveAtOnce(Integer maxAliveAtOnce) { this.maxAliveAtOnce = maxAliveAtOnce; } + public Integer getAmountPerSpawn() { + return this.amountPerSpawn; + } + public void setAmountPerSpawn(Integer amountPerSpawn) { this.amountPerSpawn = amountPerSpawn; } + public Boolean getSpawnWhenChunkIsntLoaded() { + return this.spawnWhenChunkIsntLoaded; + } + public void setSpawnWhenChunkIsntLoaded(Boolean spawnWhenChunkIsntLoaded) { this.spawnWhenChunkIsntLoaded = spawnWhenChunkIsntLoaded; } + public Boolean getOverrideDefaultSpawnMessage() { + return this.overrideDefaultSpawnMessage; + } + public void setOverrideDefaultSpawnMessage(Boolean overrideDefaultSpawnMessage) { this.overrideDefaultSpawnMessage = overrideDefaultSpawnMessage; } + public Boolean getShuffleEntitiesList() { + return this.shuffleEntitiesList; + } + public void setShuffleEntitiesList(Boolean shuffleEntitiesList) { this.shuffleEntitiesList = shuffleEntitiesList; } + public String getSpawnMessage() { + return this.spawnMessage; + } + public void setSpawnMessage(String spawnMessage) { this.spawnMessage = spawnMessage; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java index aaffec9..8865154 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/types/IntervalSpawnElement.java @@ -54,10 +54,10 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { ClickAction placeholderAction = intervalSpawnHandler.getPlaceholderAction(this, autoSpawn, variablePanelHandler); ClickAction spawnRateAction = intervalSpawnHandler.getSpawnRateAction(this, autoSpawn, variablePanelHandler); - clickActions.add(AutoSpawnManager.createAutoSpawnAction("Spawn After Last Boss Is Killed", getSpawnAfterLastBossIsKilled()+"", intervalSpawnHandler.getSpawnAfterLastBossIsKilledExtraInformation(), clickStack.clone(), lastBossKilledAction)); + clickActions.add(AutoSpawnManager.createAutoSpawnAction("Spawn After Last Boss Is Killed", getSpawnAfterLastBossIsKilled() + "", intervalSpawnHandler.getSpawnAfterLastBossIsKilledExtraInformation(), clickStack.clone(), lastBossKilledAction)); clickActions.add(AutoSpawnManager.createAutoSpawnAction("Location", getLocation(), intervalSpawnHandler.getLocationExtraInformation(), clickStack.clone(), locationAction)); clickActions.add(AutoSpawnManager.createAutoSpawnAction("Placeholder", getPlaceholder(), intervalSpawnHandler.getPlaceholderExtraInformation(), clickStack.clone(), placeholderAction)); - clickActions.add(AutoSpawnManager.createAutoSpawnAction("Spawn Rate", getSpawnRate()+"", intervalSpawnHandler.getSpawnRateExtraInformation(), clickStack.clone(), spawnRateAction)); + clickActions.add(AutoSpawnManager.createAutoSpawnAction("Spawn Rate", getSpawnRate() + "", intervalSpawnHandler.getSpawnRateExtraInformation(), clickStack.clone(), spawnRateAction)); return clickActions; } @@ -73,22 +73,22 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { List bosses = autoSpawn.getEntities(); Location location = getSpawnLocation(); - if(bosses == null || bosses.isEmpty()) { + if (bosses == null || bosses.isEmpty()) { ServerUtils.get().logDebug("BOSSES IS EMPTY!"); return false; } - if(shuffleList) Collections.shuffle(bosses); + if (shuffleList) Collections.shuffle(bosses); Queue queue = new LinkedList<>(bosses); - for(int i = 1; i <= amountToSpawn; i++) { - if(queue.isEmpty()) queue = new LinkedList<>(bosses); + for (int i = 1; i <= amountToSpawn; i++) { + if (queue.isEmpty()) queue = new LinkedList<>(bosses); BossEntity bossEntity = BossAPI.getBossEntity(queue.poll()); ActiveBossHolder activeBossHolder = BossAPI.spawnNewBoss(bossEntity, location, null, null, customSpawnMessage); - if(activeBossHolder == null) continue; + if (activeBossHolder == null) continue; activeBossHolder.getPostBossDeathHandlers().add(bossDeathHandler); activeAutoSpawnHolder.getActiveBossHolders().add(activeBossHolder); @@ -97,7 +97,7 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { ServerUtils.get().callEvent(bossSpawnEvent); } - if(customSpawnMessage && spawnMessage != null) { + if (customSpawnMessage && spawnMessage != null) { String x = NumberUtils.get().formatDouble(location.getBlockX()); String y = NumberUtils.get().formatDouble(location.getBlockY()); String z = NumberUtils.get().formatDouble(location.getBlockZ()); @@ -105,7 +105,7 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { List spawnMessages = BossAPI.getStoredMessages(spawnMessage); - if(spawnMessages != null) { + if (spawnMessages != null) { spawnMessages.replaceAll(s -> s.replace("{x}", x).replace("{y}", y).replace("{z}", z).replace("{world}", world)); MessageUtils.get().sendMessage(location, -1, spawnMessages); @@ -123,30 +123,30 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { return this.spawnAfterLastBossIsKilled; } - public String getLocation() { - return this.location; - } - - public String getPlaceholder() { - return this.placeholder; - } - - public Integer getSpawnRate() { - return this.spawnRate; - } - public void setSpawnAfterLastBossIsKilled(Boolean spawnAfterLastBossIsKilled) { this.spawnAfterLastBossIsKilled = spawnAfterLastBossIsKilled; } + public String getLocation() { + return this.location; + } + public void setLocation(String location) { this.location = location; } + public String getPlaceholder() { + return this.placeholder; + } + public void setPlaceholder(String placeholder) { this.placeholder = placeholder; } + public Integer getSpawnRate() { + return this.spawnRate; + } + public void setSpawnRate(Integer spawnRate) { this.spawnRate = spawnRate; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java b/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java index d3f2d0b..7a9a31e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java @@ -23,8 +23,8 @@ public class BossEntityContainer implements IContainer, } public String getName(BossEntity bossEntity) { - for(Map.Entry entry : getData().entrySet()) { - if(entry.getValue().equals(bossEntity)) return entry.getKey(); + for (Map.Entry entry : getData().entrySet()) { + if (entry.getValue().equals(bossEntity)) return entry.getKey(); } return null; @@ -36,8 +36,8 @@ public class BossEntityContainer implements IContainer, int completed = 0; int failed = 0; - for(Map.Entry entry : stringBossEntityMap.entrySet()) { - if(getData().containsKey(entry.getKey())) { + for (Map.Entry entry : stringBossEntityMap.entrySet()) { + if (getData().containsKey(entry.getKey())) { failed += 1; stringBuilder.append(entry.getKey()).append("; "); continue; @@ -48,7 +48,7 @@ public class BossEntityContainer implements IContainer, } - if(failed > 0) { + if (failed > 0) { Debug.BOSS_CONTAINER_SAVE.debug(completed, failed, stringBuilder.toString()); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/container/MinionEntityContainer.java b/plugin-modules/Core/src/com/songoda/epicbosses/container/MinionEntityContainer.java index c860170..abc5d23 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/container/MinionEntityContainer.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/container/MinionEntityContainer.java @@ -23,8 +23,8 @@ public class MinionEntityContainer implements IContainer entry : getData().entrySet()) { - if(entry.getValue().equals(minionEntity)) return entry.getKey(); + for (Map.Entry entry : getData().entrySet()) { + if (entry.getValue().equals(minionEntity)) return entry.getKey(); } return null; @@ -36,8 +36,8 @@ public class MinionEntityContainer implements IContainer entry : stringMinionEntityMap.entrySet()) { - if(getData().containsKey(entry.getKey())) { + for (Map.Entry entry : stringMinionEntityMap.entrySet()) { + if (getData().containsKey(entry.getKey())) { failed += 1; stringBuilder.append(entry.getKey()).append("; "); continue; @@ -47,7 +47,7 @@ public class MinionEntityContainer implements IContainer 0) { + if (failed > 0) { Debug.MINION_CONTAINER_SAVE.debug(completed, failed, stringBuilder.toString()); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java index 8b41776..b571833 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/DropTable.java @@ -25,7 +25,7 @@ public class DropTable { } public GiveTableElement getGiveTableData() { - if(getDropType().equalsIgnoreCase("GIVE")) { + if (getDropType().equalsIgnoreCase("GIVE")) { return BossesGson.get().fromJson(this.rewards, GiveTableElement.class); } @@ -33,7 +33,7 @@ public class DropTable { } public SprayTableElement getSprayTableData() { - if(getDropType().equalsIgnoreCase("SPRAY")) { + if (getDropType().equalsIgnoreCase("SPRAY")) { return BossesGson.get().fromJson(this.rewards, SprayTableElement.class); } @@ -41,7 +41,7 @@ public class DropTable { } public DropTableElement getDropTableData() { - if(getDropType().equalsIgnoreCase("DROP")) { + if (getDropType().equalsIgnoreCase("DROP")) { return BossesGson.get().fromJson(this.rewards, DropTableElement.class); } @@ -52,14 +52,14 @@ public class DropTable { return this.dropType; } - public JsonObject getRewards() { - return this.rewards; - } - public void setDropType(String dropType) { this.dropType = dropType; } + public JsonObject getRewards() { + return this.rewards; + } + public void setRewards(JsonObject rewards) { this.rewards = rewards; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java index e6f7e6e..f0be93b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/DropTableElement.java @@ -28,22 +28,22 @@ public class DropTableElement { return this.dropRewards; } - public Boolean getRandomDrops() { - return this.randomDrops; - } - - public Integer getDropMaxDrops() { - return this.dropMaxDrops; - } - public void setDropRewards(Map dropRewards) { this.dropRewards = dropRewards; } + public Boolean getRandomDrops() { + return this.randomDrops; + } + public void setRandomDrops(Boolean randomDrops) { this.randomDrops = randomDrops; } + public Integer getDropMaxDrops() { + return this.dropMaxDrops; + } + public void setDropMaxDrops(Integer dropMaxDrops) { this.dropMaxDrops = dropMaxDrops; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java index 4787444..2b99a72 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/GiveTableSubElement.java @@ -34,54 +34,54 @@ public class GiveTableSubElement { return this.items; } - public Map getCommands() { - return this.commands; - } - - public Integer getMaxDrops() { - return this.maxDrops; - } - - public Integer getMaxCommands() { - return this.maxCommands; - } - - public Boolean getRandomDrops() { - return this.randomDrops; - } - - public Boolean getRandomCommands() { - return this.randomCommands; - } - - public Double getRequiredPercentage() { - return this.requiredPercentage; - } - public void setItems(Map items) { this.items = items; } + public Map getCommands() { + return this.commands; + } + public void setCommands(Map commands) { this.commands = commands; } + public Integer getMaxDrops() { + return this.maxDrops; + } + public void setMaxDrops(Integer maxDrops) { this.maxDrops = maxDrops; } + public Integer getMaxCommands() { + return this.maxCommands; + } + public void setMaxCommands(Integer maxCommands) { this.maxCommands = maxCommands; } + public Boolean getRandomDrops() { + return this.randomDrops; + } + public void setRandomDrops(Boolean randomDrops) { this.randomDrops = randomDrops; } + public Boolean getRandomCommands() { + return this.randomCommands; + } + public void setRandomCommands(Boolean randomCommands) { this.randomCommands = randomCommands; } + public Double getRequiredPercentage() { + return this.requiredPercentage; + } + public void setRequiredPercentage(Double requiredPercentage) { this.requiredPercentage = requiredPercentage; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java index 706a537..a9b0eee 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/droptable/elements/SprayTableElement.java @@ -29,30 +29,30 @@ public class SprayTableElement { return this.sprayRewards; } - public Boolean getRandomSprayDrops() { - return this.randomSprayDrops; - } - - public Integer getSprayMaxDistance() { - return this.sprayMaxDistance; - } - - public Integer getSprayMaxDrops() { - return this.sprayMaxDrops; - } - public void setSprayRewards(Map sprayRewards) { this.sprayRewards = sprayRewards; } + public Boolean getRandomSprayDrops() { + return this.randomSprayDrops; + } + public void setRandomSprayDrops(Boolean randomSprayDrops) { this.randomSprayDrops = randomSprayDrops; } + public Integer getSprayMaxDistance() { + return this.sprayMaxDistance; + } + public void setSprayMaxDistance(Integer sprayMaxDistance) { this.sprayMaxDistance = sprayMaxDistance; } + public Integer getSprayMaxDrops() { + return this.sprayMaxDrops; + } + public void setSprayMaxDrops(Integer sprayMaxDrops) { this.sprayMaxDrops = sprayMaxDrops; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java index c5270b4..61101f8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/AutoSpawnVariableHandler.java @@ -57,21 +57,21 @@ public abstract class AutoSpawnVariableHandler implements IHandler { Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); - if(!uuid.equals(getPlayer().getUniqueId())) return; - if(isHandled()) return; + if (!uuid.equals(getPlayer().getUniqueId())) return; + if (isHandled()) return; String input = event.getMessage(); - if(input.equalsIgnoreCase("-")) { + if (input.equalsIgnoreCase("-")) { input = null; } - if(input == null) { + if (input == null) { Bukkit.getScheduler().scheduleSyncDelayedTask(EpicBosses.getInstance(), AutoSpawnVariableHandler.this::finish); return; } - if(!confirmValue(input, getIntervalSpawnElement())) return; + if (!confirmValue(input, getIntervalSpawnElement())) return; getAutoSpawn().setCustomData(BossAPI.convertObjectToJsonObject(getIntervalSpawnElement())); getAutoSpawnFileManager().save(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java index 78f7023..e9802bd 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/BossDisplayNameHandler.java @@ -54,12 +54,12 @@ public class BossDisplayNameHandler implements IHandler { Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); - if(!uuid.equals(getPlayer().getUniqueId())) return; - if(isHandled()) return; + if (!uuid.equals(getPlayer().getUniqueId())) return; + if (isHandled()) return; String input = event.getMessage(); - if(input.equalsIgnoreCase("-")) { + if (input.equalsIgnoreCase("-")) { input = null; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java index 581edec..0f6c62e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/handlers/SkillDisplayNameHandler.java @@ -50,12 +50,12 @@ public class SkillDisplayNameHandler implements IHandler { Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); - if(!uuid.equals(getPlayer().getUniqueId())) return; - if(isHandled()) return; + if (!uuid.equals(getPlayer().getUniqueId())) return; + if (isHandled()) return; String input = event.getMessage(); - if(input.equalsIgnoreCase("-")) { + if (input.equalsIgnoreCase("-")) { input = null; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java index c0101f2..71f608b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/after/BossDeathListener.java @@ -45,26 +45,26 @@ public class BossDeathListener implements Listener { ActiveBossHolder activeBossHolder = this.bossEntityManager.getActiveBossHolder(livingEntity); Location location = livingEntity.getLocation(); - if(activeBossHolder == null) return; + if (activeBossHolder == null) return; EntityDamageEvent.DamageCause damageCause = entityDamageEvent.getCause(); Boolean naturalDrops = activeBossHolder.getBossEntity().getDrops().getNaturalDrops(); Boolean dropExp = activeBossHolder.getBossEntity().getDrops().getDropExp(); - if(naturalDrops == null) naturalDrops = false; - if(dropExp == null) dropExp = true; + if (naturalDrops == null) naturalDrops = false; + if (dropExp == null) dropExp = true; - if(!naturalDrops) event.getDrops().clear(); - if(!dropExp) event.setDroppedExp(0); + if (!naturalDrops) event.getDrops().clear(); + if (!dropExp) event.setDroppedExp(0); - if(damageCause == EntityDamageEvent.DamageCause.VOID || damageCause == EntityDamageEvent.DamageCause.LAVA + if (damageCause == EntityDamageEvent.DamageCause.VOID || damageCause == EntityDamageEvent.DamageCause.LAVA || activeBossHolder.getMapOfDamagingUsers().isEmpty()) { this.bossEntityManager.removeActiveBossHolder(activeBossHolder); return; } - if(this.bossEntityManager.isAllEntitiesDead(activeBossHolder)) { + if (this.bossEntityManager.isAllEntitiesDead(activeBossHolder)) { PreBossDeathEvent preBossDeathEvent = new PreBossDeathEvent(activeBossHolder, location, event.getEntity().getKiller()); activeBossHolder.setDead(true); @@ -87,8 +87,9 @@ public class BossDeathListener implements Listener { int onlyShow = this.bossEntityManager.getOnDeathShowAmount(bossEntity); ServerUtils serverUtils = ServerUtils.get(); - if(commands != null) { - if (activeBossHolder.getSpawningPlayerName() != null) commands.replaceAll(s -> s.replace("{spawner}", activeBossHolder.getSpawningPlayerName())); + if (commands != null) { + if (activeBossHolder.getSpawningPlayerName() != null) + commands.replaceAll(s -> s.replace("{spawner}", activeBossHolder.getSpawningPlayerName())); if (event.getKiller() != null) commands.replaceAll(s -> s.replace("{killer}", event.getKiller().getName())); commands.forEach(serverUtils::sendConsoleCommand); } @@ -96,19 +97,19 @@ public class BossDeathListener implements Listener { ServerUtils.get().runTaskAsync(() -> { List positionsMessage = this.bossEntityManager.getOnDeathPositionMessage(bossEntity); - if(messages != null) { - if(positionsMessage != null) { + if (messages != null) { + if (positionsMessage != null) { List finalPositionsMessage = new ArrayList<>(); int current = 1; - for(Map.Entry entry : mapOfDamage.entrySet()) { - if(current > onlyShow) break; + for (Map.Entry entry : mapOfDamage.entrySet()) { + if (current > onlyShow) break; List clonedPositionsMessage = new ArrayList<>(positionsMessage); Double percentage = mapOfPercent.getOrDefault(entry.getKey(), null); int position = current; - if(percentage == null) percentage = -1.0D; + if (percentage == null) percentage = -1.0D; double finalPercentage = percentage; @@ -126,16 +127,19 @@ public class BossDeathListener implements Listener { positionsMessage = finalPositionsMessage; } - if(activeBossHolder.getName() != null) messages.replaceAll(s -> s.replace("{boss}", activeBossHolder.getName())); - if (activeBossHolder.getSpawningPlayerName() != null) messages.replaceAll(s -> s.replace("{spawner}", activeBossHolder.getSpawningPlayerName())); - if (event.getKiller() != null) messages.replaceAll(s -> s.replace("{killer}", event.getKiller().getName())); + if (activeBossHolder.getName() != null) + messages.replaceAll(s -> s.replace("{boss}", activeBossHolder.getName())); + if (activeBossHolder.getSpawningPlayerName() != null) + messages.replaceAll(s -> s.replace("{spawner}", activeBossHolder.getSpawningPlayerName())); + if (event.getKiller() != null) + messages.replaceAll(s -> s.replace("{killer}", event.getKiller().getName())); messages.replaceAll(s -> s.replace('&', '§')); List finalMessage = new ArrayList<>(); - for(String s : messages) { - if(s.contains("{positions}") && positionsMessage != null) { + for (String s : messages) { + if (s.contains("{positions}") && positionsMessage != null) { finalMessage.addAll(positionsMessage); } else { finalMessage.add(s); @@ -154,7 +158,7 @@ public class BossDeathListener implements Listener { BossDeathEvent bossDeathEvent = new BossDeathEvent(activeBossHolder, autoSpawn); DropTable dropTable = this.bossEntityManager.getDropTable(bossEntity); - if(dropTable == null) { + if (dropTable == null) { Debug.FAILED_TO_FIND_DROP_TABLE.debug(activeBossHolder.getName(), bossEntity.getDrops().getDropTable()); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java index 358e8b9..21e2789 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java @@ -29,37 +29,37 @@ public class BossDamageListener implements Listener { Entity entityBeingDamaged = event.getEntity(); Entity entityDamaging = event.getDamager(); - if(!(entityBeingDamaged instanceof LivingEntity)) return; + if (!(entityBeingDamaged instanceof LivingEntity)) return; LivingEntity livingEntity = (LivingEntity) entityBeingDamaged; ActiveBossHolder activeBossHolder = this.bossEntityManager.getActiveBossHolder(livingEntity); double damage = event.getDamage(); Player player = null; - if(activeBossHolder == null) return; + if (activeBossHolder == null) return; - if(entityDamaging instanceof Player) { + if (entityDamaging instanceof Player) { player = (Player) entityDamaging; - } else if(entityDamaging instanceof Projectile) { + } else if (entityDamaging instanceof Projectile) { Projectile projectile = (Projectile) entityDamaging; LivingEntity shooter = (LivingEntity) projectile.getShooter(); - if(projectile instanceof ThrownPotion) { + if (projectile instanceof ThrownPotion) { event.setCancelled(true); return; } - if(!(shooter instanceof Player)) return; + if (!(shooter instanceof Player)) return; player = (Player) shooter; } - if(player == null) return; + if (player == null) return; double currentDamage = activeBossHolder.getMapOfDamagingUsers().getOrDefault(player.getUniqueId(), 0.0); BossDamageEvent bossDamageEvent = new BossDamageEvent(activeBossHolder, livingEntity, livingEntity.getEyeLocation(), damage); ServerUtils.get().callEvent(bossDamageEvent); - activeBossHolder.getMapOfDamagingUsers().put(player.getUniqueId(), currentDamage+damage); + activeBossHolder.getMapOfDamagingUsers().put(player.getUniqueId(), currentDamage + damage); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java index b25c527..6f91a6f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossSkillListener.java @@ -47,7 +47,7 @@ public class BossSkillListener implements Listener { Entity entityBeingDamaged = event.getEntity(); Entity entityDamaging = event.getDamager(); - if(!(entityBeingDamaged instanceof LivingEntity)) return; + if (!(entityBeingDamaged instanceof LivingEntity)) return; if (entityDamaging instanceof Projectile) { Projectile projectile = (Projectile) entityDamaging; @@ -58,18 +58,18 @@ public class BossSkillListener implements Listener { } } - if(!(entityDamaging instanceof LivingEntity)) return; + if (!(entityDamaging instanceof LivingEntity)) return; LivingEntity livingEntity = (LivingEntity) entityBeingDamaged; ActiveBossHolder activeBossHolder = this.bossEntityManager.getActiveBossHolder(livingEntity); - if(activeBossHolder == null) return; + if (activeBossHolder == null) return; BossEntity bossEntity = activeBossHolder.getBossEntity(); - if(bossEntity.getSkills() == null || bossEntity.getSkills().getOverallChance() == null) return; + if (bossEntity.getSkills() == null || bossEntity.getSkills().getOverallChance() == null) return; - if(RandomUtils.get().canPreformAction(bossEntity.getSkills().getOverallChance())) { + if (RandomUtils.get().canPreformAction(bossEntity.getSkills().getOverallChance())) { PreBossSkillEvent preBossSkillEvent = new PreBossSkillEvent(activeBossHolder, livingEntity, (LivingEntity) entityDamaging); ServerUtils.get().callEvent(preBossSkillEvent); @@ -84,7 +84,7 @@ public class BossSkillListener implements Listener { List skills = bossEntity.getSkills().getSkills(); List masterMessage = BossAPI.getStoredMessages(bossEntity.getSkills().getMasterMessage()); - if(skills.isEmpty()) { + if (skills.isEmpty()) { Debug.SKILL_EMPTY_SKILLS.debug(BossAPI.getBossEntityName(bossEntity)); return; } @@ -94,7 +94,7 @@ public class BossSkillListener implements Listener { String skillInput = skills.get(0); Skill skill = this.skillsFileManager.getSkill(skillInput); - if(skill == null) { + if (skill == null) { Debug.SKILL_NOT_FOUND.debug(); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java index 44a0dfc..57e7063 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/pre/BossSpawnListener.java @@ -12,7 +12,6 @@ import com.songoda.epicbosses.managers.BossLocationManager; import com.songoda.epicbosses.managers.BossTauntManager; import com.songoda.epicbosses.utils.*; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -39,10 +38,8 @@ public class BossSpawnListener implements Listener { private BossLocationManager bossLocationManager; private BossEntityManager bossEntityManager; private BossTauntManager bossTauntManager; - private VersionHandler versionHandler; public BossSpawnListener(EpicBosses epicBosses) { - this.versionHandler = epicBosses.getVersionHandler(); this.bossTauntManager = epicBosses.getBossTauntManager(); this.bossEntityManager = epicBosses.getBossEntityManager(); this.bossLocationManager = epicBosses.getBossLocationManager(); @@ -55,24 +52,24 @@ public class BossSpawnListener implements Listener { BlockFace blockFace = event.getBlockFace(); Action action = event.getAction(); - if(!event.hasItem()) return; - if(action != Action.RIGHT_CLICK_BLOCK) return; - if(block.getType() == Material.AIR) return; + if (!event.hasItem()) return; + if (action != Action.RIGHT_CLICK_BLOCK) return; + if (block.getType() == Material.AIR) return; Map entitiesAndSpawnItems = this.bossEntityManager.getMapOfEntitiesAndSpawnItems(); - ItemStack itemStack = this.versionHandler.getItemInHand(player); + ItemStack itemStack = player.getItemInHand(); BossEntity bossEntity = null; - for(Map.Entry entry : entitiesAndSpawnItems.entrySet()) { - if(ItemStackUtils.isItemStackSame(itemStack, entry.getValue())) { + for (Map.Entry entry : entitiesAndSpawnItems.entrySet()) { + if (ItemStackUtils.isItemStackSame(itemStack, entry.getValue())) { bossEntity = entry.getKey(); break; } } - if(bossEntity == null) return; + if (bossEntity == null) return; - if(bossEntity.isEditing()) { + if (bossEntity.isEditing()) { Message.Boss_Edit_CannotSpawn.msg(player); event.setCancelled(true); return; @@ -80,11 +77,11 @@ public class BossSpawnListener implements Listener { Location location = block.getLocation().clone(); - if(blockFace == BlockFace.UP) { - location.add(0,1,0); + if (blockFace == BlockFace.UP) { + location.add(0, 1, 0); } - if(!this.bossLocationManager.canSpawnBoss(player, location.clone())) { + if (!this.bossLocationManager.canSpawnBoss(player, location.clone())) { Message.General_CannotSpawn.msg(player); event.setCancelled(true); return; @@ -94,7 +91,7 @@ public class BossSpawnListener implements Listener { ActiveBossHolder activeBossHolder = BossAPI.spawnNewBoss(bossEntity, location, player, itemStack, false); - if(activeBossHolder == null) { + if (activeBossHolder == null) { event.setCancelled(true); } } @@ -119,7 +116,7 @@ public class BossSpawnListener implements Listener { int messageRadius = this.bossEntityManager.getOnSpawnMessageRadius(bossEntity); ServerUtils serverUtils = ServerUtils.get(); - if(event instanceof PreBossSpawnItemEvent) { + if (event instanceof PreBossSpawnItemEvent) { PreBossSpawnItemEvent preBossSpawnItemEvent = (PreBossSpawnItemEvent) event; ItemStack itemStack = preBossSpawnItemEvent.getItemStackUsed().clone(); Player player = preBossSpawnItemEvent.getPlayer(); @@ -143,8 +140,9 @@ public class BossSpawnListener implements Listener { if (!commands.isEmpty()) commands.forEach(serverUtils::sendConsoleCommand); - if(!messages.isEmpty() && !activeBossHolder.isCustomSpawnMessage()) { - if(activeBossHolder.getName() != null) messages.replaceAll(s -> s.replace("{boss}", activeBossHolder.getName())); + if (!messages.isEmpty() && !activeBossHolder.isCustomSpawnMessage()) { + if (activeBossHolder.getName() != null) + messages.replaceAll(s -> s.replace("{boss}", activeBossHolder.getName())); final String locationString = StringUtils.get().translateLocation(location); messages.replaceAll(s -> s.replace("{location}", locationString)); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java index ff6869b..d0317a8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java @@ -31,10 +31,14 @@ public class AutoSpawnManager { this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); } + public static ICustomSettingAction createAutoSpawnAction(String name, String current, List extraInformation, ItemStack displayStack, ClickAction clickAction) { + return new CustomAutoSpawnActionCreator(name, current, extraInformation, displayStack, clickAction); + } + public void startIntervalSystems() { Map autoSpawnMap = this.autoSpawnFileManager.getAutoSpawnMap(); - if(!this.activeAutoSpawnHolders.isEmpty()) { + if (!this.activeAutoSpawnHolders.isEmpty()) { stopIntervalSystems(); } @@ -56,7 +60,7 @@ public class AutoSpawnManager { List intervalAutoSpawns = new ArrayList<>(); autoSpawnHolderMap.forEach((name, autoSpawnHolder) -> { - if(autoSpawnHolder.getSpawnType() == SpawnType.INTERVAL) { + if (autoSpawnHolder.getSpawnType() == SpawnType.INTERVAL) { intervalAutoSpawns.add(name); } }); @@ -68,7 +72,7 @@ public class AutoSpawnManager { List keyList = new ArrayList<>(this.activeAutoSpawnHolders.keySet()); for (String s : keyList) { - if(s.equalsIgnoreCase(name)) return true; + if (s.equalsIgnoreCase(name)) return true; } return false; @@ -93,7 +97,7 @@ public class AutoSpawnManager { private void removeActiveAutoSpawnHolder(String name) { ActiveAutoSpawnHolder autoSpawnHolder = this.activeAutoSpawnHolders.getOrDefault(name, null); - if(autoSpawnHolder != null) { + if (autoSpawnHolder != null) { stopInterval(autoSpawnHolder); this.activeAutoSpawnHolders.remove(name); } @@ -113,20 +117,16 @@ public class AutoSpawnManager { String autoSpawnType = autoSpawn.getType(); SpawnType spawnType = SpawnType.getCurrent(autoSpawnType); - if(spawnType == SpawnType.INTERVAL) { + if (spawnType == SpawnType.INTERVAL) { ActiveIntervalAutoSpawnHolder autoSpawnHolder = new ActiveIntervalAutoSpawnHolder(spawnType, autoSpawn); - if(autoSpawn.isEditing()) return; + if (autoSpawn.isEditing()) return; autoSpawnHolder.restartInterval(); this.activeAutoSpawnHolders.put(name, autoSpawnHolder); } } - public static ICustomSettingAction createAutoSpawnAction(String name, String current, List extraInformation, ItemStack displayStack, ClickAction clickAction) { - return new CustomAutoSpawnActionCreator(name, current, extraInformation, displayStack, clickAction); - } - private static class CustomAutoSpawnActionCreator implements ICustomSettingAction { private final List extraInformation; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java index 6777a6f..17cc8c4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java @@ -4,7 +4,6 @@ import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.commands.boss.*; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.ILoadable; -import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.command.SubCommandService; /** @@ -25,7 +24,7 @@ public class BossCommandManager implements ILoadable { @Override public void load() { - if(this.hasBeenLoaded) { + if (this.hasBeenLoaded) { Debug.FAILED_TO_LOAD_BOSSCOMMANDMANAGER.debug(); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java index 8ae347d..20e56f8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossDropTableManager.java @@ -41,8 +41,8 @@ public class BossDropTableManager { Integer maxDrops = sprayTableElement.getSprayMaxDrops(); Boolean randomDrops = sprayTableElement.getRandomSprayDrops(); - if(maxDrops == null) maxDrops = -1; - if(randomDrops == null) randomDrops = false; + if (maxDrops == null) maxDrops = -1; + if (randomDrops == null) randomDrops = false; return getCustomRewards(randomDrops, maxDrops, rewards); } @@ -52,8 +52,8 @@ public class BossDropTableManager { Integer maxDrops = dropTableElement.getDropMaxDrops(); Boolean randomDrops = dropTableElement.getRandomDrops(); - if(maxDrops == null) maxDrops = -1; - if(randomDrops == null) randomDrops = false; + if (maxDrops == null) maxDrops = -1; + if (randomDrops == null) randomDrops = false; return getCustomRewards(randomDrops, maxDrops, rewards); } @@ -66,14 +66,14 @@ public class BossDropTableManager { ServerUtils serverUtils = ServerUtils.get(); rewards.forEach((positionString, lootMap) -> { - if(!NumberUtils.get().isInt(positionString)) { + if (!NumberUtils.get().isInt(positionString)) { Debug.DROP_TABLE_FAILED_INVALID_NUMBER.debug(positionString); return; } int position = NumberUtils.get().getInteger(positionString) - 1; - if(position >= positions.size()) return; + if (position >= positions.size()) return; UUID uuid = positions.get(position); Player player = Bukkit.getPlayer(uuid); @@ -81,20 +81,20 @@ public class BossDropTableManager { List totalRewards = new ArrayList<>(); List totalCommands = new ArrayList<>(); - if(player == null) return; + if (player == null) return; lootMap.forEach((key, subElement) -> { Double requiredPercentage = subElement.getRequiredPercentage(); Integer maxDrops = subElement.getMaxDrops(), maxCommands = subElement.getMaxCommands(); Boolean randomDrops = subElement.getRandomDrops(), randomCommands = subElement.getRandomCommands(); - if(requiredPercentage == null) requiredPercentage = 0.0D; - if(maxDrops == null) maxDrops = -1; - if(maxCommands == null) maxCommands = -1; - if(randomDrops == null) randomDrops = false; - if(randomCommands == null) randomCommands = false; + if (requiredPercentage == null) requiredPercentage = 0.0D; + if (maxDrops == null) maxDrops = -1; + if (maxCommands == null) maxCommands = -1; + if (randomDrops == null) randomDrops = false; + if (randomCommands == null) randomCommands = false; - if(requiredPercentage > percentage) return; + if (requiredPercentage > percentage) return; totalRewards.addAll(getCustomRewards(randomDrops, maxDrops, subElement.getItems())); totalCommands.addAll(getCommands(randomCommands, maxCommands, subElement.getCommands())); @@ -104,7 +104,7 @@ public class BossDropTableManager { totalCommands.forEach(serverUtils::sendConsoleCommand); totalRewards.forEach(itemStack -> { - if(player.getInventory().firstEmpty() == -1) { + if (player.getInventory().firstEmpty() == -1) { player.getWorld().dropItemNaturally(player.getLocation(), itemStack); } else { player.getInventory().addItem(itemStack); @@ -117,21 +117,21 @@ public class BossDropTableManager { private List getCustomRewards(boolean random, int max, Map chanceMap) { List newListToMerge = new ArrayList<>(); - if(chanceMap == null) return newListToMerge; + if (chanceMap == null) return newListToMerge; List keyList = new ArrayList<>(chanceMap.keySet()); - if(random) Collections.shuffle(keyList); + if (random) Collections.shuffle(keyList); - for(String itemName : keyList) { + for (String itemName : keyList) { Double chance = chanceMap.get(itemName); - if(!RandomUtils.get().canPreformAction(chance)) continue; - if((max > 0) && (newListToMerge.size() >= max)) break; + if (!RandomUtils.get().canPreformAction(chance)) continue; + if ((max > 0) && (newListToMerge.size() >= max)) break; ItemStack itemStack = this.getDropTableItemStack.getListItem(itemName); - if(itemStack == null) { + if (itemStack == null) { Debug.DROP_TABLE_FAILED_TO_GET_ITEM.debug(); continue; } @@ -145,21 +145,21 @@ public class BossDropTableManager { private List getCommands(boolean random, int max, Map chanceMap) { List newListToMerge = new ArrayList<>(); - if(chanceMap == null) return newListToMerge; + if (chanceMap == null) return newListToMerge; List keyList = new ArrayList<>(chanceMap.keySet()); - if(random) Collections.shuffle(keyList); + if (random) Collections.shuffle(keyList); - for(String itemName : keyList) { + for (String itemName : keyList) { Double chance = chanceMap.get(itemName); - if(!RandomUtils.get().canPreformAction(chance)) continue; - if((max > 0) && (newListToMerge.size() >= max)) break; + if (!RandomUtils.get().canPreformAction(chance)) continue; + if ((max > 0) && (newListToMerge.size() >= max)) break; List commands = this.getDropTableCommand.getListItem(itemName); - if(commands == null) { + if (commands == null) { Debug.DROP_TABLE_FAILED_TO_GET_ITEM.debug(); continue; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java index f975560..d7423e8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossEntityManager.java @@ -65,11 +65,11 @@ public class BossEntityManager { } public double getRadius(ActiveBossHolder activeBossHolder, Location centerLocation) { - if(activeBossHolder.isDead()) return Double.MAX_VALUE; + if (activeBossHolder.isDead()) return Double.MAX_VALUE; LivingEntity livingEntity = activeBossHolder.getLivingEntity(); - if(livingEntity == null) return Double.MAX_VALUE; + if (livingEntity == null) return Double.MAX_VALUE; Location location = livingEntity.getLocation(); @@ -82,7 +82,7 @@ public class BossEntityManager { getActiveBossHolders().forEach(activeBossHolder -> { double distance = getRadius(activeBossHolder, centerLocation); - if(distance > radius) return; + if (distance > radius) return; distanceMap.put(activeBossHolder, distance); }); @@ -93,8 +93,8 @@ public class BossEntityManager { public int getCurrentlyActive(BossEntity bossEntity) { int amountOfBosses = 0; - for(ActiveBossHolder activeBossHolder : getActiveBossHolders()) { - if(activeBossHolder.getBossEntity().equals(bossEntity)) { + for (ActiveBossHolder activeBossHolder : getActiveBossHolders()) { + if (activeBossHolder.getBossEntity().equals(bossEntity)) { amountOfBosses++; } } @@ -105,8 +105,8 @@ public class BossEntityManager { public int killAllHolders(World world) { int amountOfBosses = 0; - for(ActiveBossHolder activeBossHolder : getActiveBossHolders()) { - if(activeBossHolder.killAllSubBosses(world)) { + for (ActiveBossHolder activeBossHolder : getActiveBossHolders()) { + if (activeBossHolder.killAllSubBosses(world)) { activeBossHolder.killAllMinions(world); activeBossHolder.setDead(true); amountOfBosses++; @@ -121,8 +121,8 @@ public class BossEntityManager { } public void killAllHolders(BossEntity bossEntity) { - for(ActiveBossHolder activeBossHolder : getActiveBossHolders()) { - if(activeBossHolder.getBossEntity().equals(bossEntity)) { + for (ActiveBossHolder activeBossHolder : getActiveBossHolders()) { + if (activeBossHolder.getBossEntity().equals(bossEntity)) { activeBossHolder.killAll(); activeBossHolder.killAllMinions(); activeBossHolder.setDead(true); @@ -133,19 +133,19 @@ public class BossEntityManager { } public ItemStack getDisplaySpawnItem(BossEntity bossEntity) { - if(bossEntity == null) return null; + if (bossEntity == null) return null; - String spawnItemName = bossEntity.getSpawnItem() == null? DEFAULT_BOSS_MENU_ITEM : bossEntity.getSpawnItem(); + String spawnItemName = bossEntity.getSpawnItem() == null ? DEFAULT_BOSS_MENU_ITEM : bossEntity.getSpawnItem(); ItemStackHolder itemStackHolder = BossAPI.getStoredItemStack(spawnItemName); - if(itemStackHolder == null) { + if (itemStackHolder == null) { Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(spawnItemName); return null; } ItemStack itemStack = this.bossItemFileManager.getItemStackConverter().from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(spawnItemName); return null; } @@ -154,20 +154,20 @@ public class BossEntityManager { } public ItemStack getSpawnItem(BossEntity bossEntity) { - if(bossEntity == null) return null; - if(bossEntity.getSpawnItem() == null) return null; + if (bossEntity == null) return null; + if (bossEntity.getSpawnItem() == null) return null; String spawnItemName = bossEntity.getSpawnItem(); ItemStackHolder itemStackHolder = BossAPI.getStoredItemStack(spawnItemName); - if(itemStackHolder == null) { + if (itemStackHolder == null) { Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(spawnItemName); return null; } ItemStack itemStack = this.bossItemFileManager.getItemStackConverter().from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(spawnItemName); return null; } @@ -179,7 +179,7 @@ public class BossEntityManager { String id = bossEntity.getMessages().getOnSpawn().getMessage(); List messages = BossAPI.getStoredMessages(id); - if(messages == null) { + if (messages == null) { Debug.FAILED_TO_LOAD_MESSAGES.debug(id); return Collections.EMPTY_LIST; } @@ -190,7 +190,7 @@ public class BossEntityManager { public int getOnSpawnMessageRadius(BossEntity bossEntity) { Integer radius = bossEntity.getMessages().getOnSpawn().getRadius(); - if(radius == null) radius = -1; + if (radius == null) radius = -1; return radius; } @@ -199,7 +199,7 @@ public class BossEntityManager { String id = bossEntity.getCommands().getOnSpawn(); List commands = BossAPI.getStoredCommands(id); - if(commands == null) { + if (commands == null) { Debug.FAILED_TO_LOAD_COMMANDS.debug(id); return Collections.EMPTY_LIST; } @@ -211,7 +211,7 @@ public class BossEntityManager { String id = bossEntity.getMessages().getOnDeath().getMessage(); List messages = BossAPI.getStoredMessages(id); - if(messages == null) { + if (messages == null) { Debug.FAILED_TO_LOAD_MESSAGES.debug(id); return Collections.EMPTY_LIST; } @@ -222,7 +222,7 @@ public class BossEntityManager { public int getOnDeathMessageRadius(BossEntity bossEntity) { Integer radius = bossEntity.getMessages().getOnDeath().getRadius(); - if(radius == null) radius = -1; + if (radius == null) radius = -1; return radius; } @@ -230,7 +230,7 @@ public class BossEntityManager { public int getOnDeathShowAmount(BossEntity bossEntity) { Integer onlyShow = bossEntity.getMessages().getOnDeath().getOnlyShow(); - if(onlyShow == null) onlyShow = 3; + if (onlyShow == null) onlyShow = 3; return onlyShow; } @@ -239,7 +239,7 @@ public class BossEntityManager { String id = bossEntity.getMessages().getOnDeath().getPositionMessage(); List messages = BossAPI.getStoredMessages(id); - if(messages == null) { + if (messages == null) { Debug.FAILED_TO_LOAD_MESSAGES.debug(id); return null; } @@ -251,7 +251,7 @@ public class BossEntityManager { String id = bossEntity.getCommands().getOnDeath(); List commands = BossAPI.getStoredCommands(id); - if(commands == null) { + if (commands == null) { Debug.FAILED_TO_LOAD_COMMANDS.debug(id); return null; } @@ -281,24 +281,24 @@ public class BossEntityManager { String minionToSpawn = minionSkillElement.getMinionToSpawn(); Integer amount = minionSkillElement.getAmount(); - if(minionToSpawn == null || minionToSpawn.isEmpty()) { + if (minionToSpawn == null || minionToSpawn.isEmpty()) { Debug.FAILED_TO_SPAWN_MINIONS_FROM_SKILL.debug(skill.getDisplayName()); return; } - if(amount == null) amount = 1; + if (amount == null) amount = 1; MinionEntity minionEntity = this.minionsFileManager.getMinionEntity(minionToSpawn); Location location = activeBossHolder.getLivingEntity().getLocation(); - if(minionEntity == null) { + if (minionEntity == null) { Debug.FAILED_TO_FIND_MINION.debug(skill.getDisplayName(), minionToSpawn); return; } activeBossHolder.killAllMinions(); - for(int i = 1; i <= amount; i++) { + for (int i = 1; i <= amount; i++) { ActiveMinionHolder activeMinionHolder = new ActiveMinionHolder(activeBossHolder, minionEntity, location, minionToSpawn); this.minionMechanicManager.handleMechanicApplication(minionEntity, activeMinionHolder); @@ -313,9 +313,9 @@ public class BossEntityManager { public ActiveBossHolder getActiveBossHolder(LivingEntity livingEntity) { List currentList = getActiveBossHolders(); - for(ActiveBossHolder activeBossHolder : currentList) { - for(Map.Entry entry : activeBossHolder.getLivingEntityMap().entrySet()) { - if(entry.getValue().equals(livingEntity.getUniqueId())) return activeBossHolder; + for (ActiveBossHolder activeBossHolder : currentList) { + for (Map.Entry entry : activeBossHolder.getLivingEntityMap().entrySet()) { + if (entry.getValue().equals(livingEntity.getUniqueId())) return activeBossHolder; } } @@ -323,7 +323,7 @@ public class BossEntityManager { } public void removeActiveBossHolder(ActiveBossHolder activeBossHolder) { - for(Map.Entry entry : activeBossHolder.getLivingEntityMap().entrySet()) { + for (Map.Entry entry : activeBossHolder.getLivingEntityMap().entrySet()) { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(entry.getValue()); if (livingEntity != null && !livingEntity.isDead()) livingEntity.remove(); @@ -333,7 +333,7 @@ public class BossEntityManager { } public boolean isAllEntitiesDead(ActiveBossHolder activeBossHolder) { - for(Map.Entry entry : activeBossHolder.getLivingEntityMap().entrySet()) { + for (Map.Entry entry : activeBossHolder.getLivingEntityMap().entrySet()) { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(entry.getValue()); if (livingEntity != null && !livingEntity.isDead()) return false; @@ -356,14 +356,14 @@ public class BossEntityManager { Map percentageMap = new HashMap<>(); double totalDamage = 0.0; - for(Double damage : damagingUsers.values()) { - if(damage != null) totalDamage += damage; + for (Double damage : damagingUsers.values()) { + if (damage != null) totalDamage += damage; } double onePercent = totalDamage / 100; damagingUsers.forEach((uuid, damage) -> { - if(uuid == null || damage == null) return; + if (uuid == null || damage == null) return; double playerPercent = damage / onePercent; @@ -382,23 +382,23 @@ public class BossEntityManager { BossEntity bossEntity = deadBossHolder.getBossEntity(); String tableName = bossEntity.getDrops().getDropTable(); - if(dropType == null) { + if (dropType == null) { Debug.FAILED_TO_FIND_DROP_TABLE_TYPE.debug(tableName); return; } Gson gson = BossesGson.get(); - if(dropType.equalsIgnoreCase("SPRAY")) { + if (dropType.equalsIgnoreCase("SPRAY")) { SprayTableElement sprayTableElement = dropTable.getSprayTableData(); List itemStacks = this.bossDropTableManager.getSprayItems(sprayTableElement); sprayDrops(sprayTableElement, itemStacks, deadBossHolder); - } else if(dropType.equalsIgnoreCase("GIVE")) { + } else if (dropType.equalsIgnoreCase("GIVE")) { GiveTableElement giveTableElement = dropTable.getGiveTableData(); this.bossDropTableManager.handleGiveTable(giveTableElement, deadBossHolder); - } else if(dropType.equalsIgnoreCase("DROP")) { + } else if (dropType.equalsIgnoreCase("DROP")) { DropTableElement dropTableElement = dropTable.getDropTableData(); List itemStacks = this.bossDropTableManager.getDropItems(dropTableElement); @@ -411,7 +411,7 @@ public class BossEntityManager { private void sprayDrops(SprayTableElement sprayTableElement, List rewards, DeadBossHolder deadBossHolder) { Integer maximumDistance = sprayTableElement.getSprayMaxDistance(); - if(maximumDistance == null) maximumDistance = 10; + if (maximumDistance == null) maximumDistance = 10; Location deathLocation = deadBossHolder.getLocation(); Integer finalMaximumDistance = maximumDistance; @@ -423,8 +423,8 @@ public class BossEntityManager { int z = RandomUtils.get().getRandomNumber(finalMaximumDistance + 1); int currentZ = destinationLocation.getBlockZ(); - if(RandomUtils.get().preformRandomAction()) x = -x; - if(RandomUtils.get().preformRandomAction()) z = -z; + if (RandomUtils.get().preformRandomAction()) x = -x; + if (RandomUtils.get().preformRandomAction()) z = -z; destinationLocation.setX(currentX + x); destinationLocation.setZ(currentZ + z); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java index c7d71b8..23511cf 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java @@ -13,8 +13,6 @@ import utils.factions.FactionsOne; import utils.factions.FactionsUUID; import utils.factions.LegacyFactions; -import java.util.List; - /** * @author Charles Cullen * @version 1.0.0 @@ -22,14 +20,12 @@ import java.util.List; */ public class BossHookManager { + private final EpicBosses plugin; private boolean askyblockEnabled, factionsEnabled; private boolean askyblockOwnIsland, factionWarzone; - private IASkyblockHelper aSkyblockHelper; private IFactionHelper factionHelper; - private final EpicBosses plugin; - public BossHookManager(EpicBosses epicBosses) { this.plugin = epicBosses; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java index 1e3019e..9f495f4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossListenerManager.java @@ -26,7 +26,7 @@ public class BossListenerManager implements ILoadable { @Override public void load() { - if(this.hasBeenLoaded) { + if (this.hasBeenLoaded) { Debug.FAILED_TO_LOAD_BOSSLISTENERMANAGER.debug(); return; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java index 7f41f6e..4dde9cd 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java @@ -18,11 +18,10 @@ import java.util.List; */ public class BossLocationManager implements IReloadable { - private boolean useBlockedWorlds; - private List blockedWorlds; - private final BossHookManager bossHookManager; private final EpicBosses plugin; + private boolean useBlockedWorlds; + private List blockedWorlds; public BossLocationManager(EpicBosses epicBosses) { this.bossHookManager = epicBosses.getBossHookManager(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java index 45d4f51..5c42497 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossMechanicManager.java @@ -19,8 +19,8 @@ import java.util.Queue; */ public class BossMechanicManager implements IMechanicManager { - private Queue mechanics; private final EpicBosses epicBosses; + private Queue mechanics; public BossMechanicManager(EpicBosses epicBosses) { this.epicBosses = epicBosses; @@ -46,22 +46,22 @@ public class BossMechanicManager implements IMechanicManager queue = new LinkedList<>(this.mechanics); - while(!queue.isEmpty()) { + while (!queue.isEmpty()) { IBossMechanic mechanic = queue.poll(); - if(mechanic == null) continue; + if (mechanic == null) continue; ServerUtils.get().logDebug("Applying " + mechanic.getClass().getSimpleName()); - if(didMechanicApplicationFail(mechanic, bossEntity, activeBossHolder)) { + if (didMechanicApplicationFail(mechanic, bossEntity, activeBossHolder)) { Debug.FAILED_TO_APPLY_MECHANIC.debug(mechanic.getClass().getSimpleName()); } } @@ -69,9 +69,9 @@ public class BossMechanicManager implements IMechanicManager equipmentEditMenu, helmetEditorMenu, chestplateEditorMenu, leggingsEditorMenu, bootsEditorMenu; private ISubVariablePanelHandler weaponEditMenu, offHandEditorMenu, mainHandEditorMenu; private ISubVariablePanelHandler statisticMainEditMenu, entityTypeEditMenu; @@ -106,19 +105,15 @@ public class BossPanelManager implements ILoadable { onDeathCommandEditMenu, mainDropsEditMenu, mainTextEditMenu, mainTauntEditMenu, onSpawnTextEditMenu, onSpawnSubTextEditMenu, onDeathTextEditMenu, onDeathSubTextEditMenu, onDeathPositionTextEditMenu, onTauntTextEditMenu, spawnItemEditMenu, bossShopEditMenu, bossSkillMasterMessageTextEditMenu; private BossListEditorPanel equipmentListEditMenu, weaponListEditMenu, statisticListEditMenu; - private IVariablePanelHandler mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel; private ISubVariablePanelHandler createPotionEffectMenu, potionEffectTypeEditMenu; private ISubVariablePanelHandler modifyCommandEditMenu, commandListSkillEditMenu; private ISubVariablePanelHandler customSkillTypeEditorMenu, specialSettingsEditorMenu, minionSelectEditorMenu; - private IVariablePanelHandler mainDropTableEditMenu, dropTableTypeEditMenu; - private ISubVariablePanelHandler sprayDropTableMainEditMenu; private DropTableRewardMainEditorPanel sprayDropRewardMainEditPanel; private DropTableNewRewardEditorPanel sprayDropNewRewardEditPanel; private DropTableRewardsListEditorPanel sprayDropRewardListPanel; - private ISubVariablePanelHandler giveRewardMainEditMenu, giveCommandRewardListPanel, giveCommandNewRewardPanel; private ISubSubVariablePanelHandler giveCommandRewardMainEditMenu; private ISubSubVariablePanelHandler giveRewardRewardsListMenu; @@ -126,17 +121,13 @@ public class BossPanelManager implements ILoadable { private DropTableRewardMainEditorPanel giveDropRewardMainEditPanel; private DropTableNewRewardEditorPanel giveDropNewRewardEditPanel; private DropTableRewardsListEditorPanel giveDropRewardListPanel; - private ISubVariablePanelHandler dropDropTableMainEditMenu; private DropTableRewardMainEditorPanel dropDropRewardMainEditPanel; private DropTableNewRewardEditorPanel dropDropNewRewardEditPanel; private DropTableRewardsListEditorPanel dropDropRewardListPanel; - private IVariablePanelHandler mainAutoSpawnEditPanel, autoSpawnEntitiesEditPanel, autoSpawnSpecialSettingsEditorPanel, autoSpawnTypeEditorPanel, autoSpawnCustomSettingsEditorPanel, autoSpawnMessageEditorPanel; - private PanelBuilder addItemsBuilder; - private final EpicBosses epicBosses; public BossPanelManager(EpicBosses epicBosses) { this.epicBosses = epicBosses; @@ -203,8 +194,8 @@ public class BossPanelManager implements ILoadable { Collection values = this.epicBosses.getBossEntityContainer().getData().values(); int timesUsed = 0; - for(BossEntity bossEntity : values) { - if(bossEntity != null) { + for (BossEntity bossEntity : values) { + if (bossEntity != null) { if (bossEntity.getSpawnItem() != null) { if (bossEntity.getSpawnItem().equalsIgnoreCase(name)) timesUsed += 1; } @@ -546,7 +537,7 @@ public class BossPanelManager implements ILoadable { public void updateMessage(BossEntity bossEntity, String modifiedValue) { List current = getCurrent(bossEntity); - if(current.contains(modifiedValue)) { + if (current.contains(modifiedValue)) { current.remove(modifiedValue); } else { current.add(modifiedValue); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java index f3e3101..95b95e6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossSkillManager.java @@ -38,6 +38,10 @@ public class BossSkillManager implements ILoadable { this.plugin = plugin; } + public static ICustomSettingAction createCustomSkillAction(String name, String current, ItemStack displayStack, ClickAction clickAction) { + return new CustomSkillActionCreator(name, current, displayStack, clickAction); + } + @Override public void load() { registerCustomSkill(new Cage(this.plugin)); @@ -53,7 +57,7 @@ public class BossSkillManager implements ILoadable { } public void handleSkill(List masterMessage, Skill skill, List targetedEntities, ActiveBossHolder activeBossHolder, boolean message, boolean subSkill) { - if(skill == null) { + if (skill == null) { Debug.SKILL_NOT_FOUND.debug(); return; } @@ -62,24 +66,24 @@ public class BossSkillManager implements ILoadable { String bossDisplayName = activeBossHolder.getName(); String skillDisplayName = skill.getDisplayName(); - if(skill.getType().equalsIgnoreCase("POTION")) { + if (skill.getType().equalsIgnoreCase("POTION")) { PotionSkillElement potionSkillElement = getPotionSkillElement(skill); potionSkillElement.castSkill(skill, potionSkillElement, activeBossHolder, targetedEntities); skillHandler = potionSkillElement; - } else if(skill.getType().equalsIgnoreCase("COMMAND")) { + } else if (skill.getType().equalsIgnoreCase("COMMAND")) { CommandSkillElement commandSkillElement = getCommandSkillElement(skill); commandSkillElement.castSkill(skill, commandSkillElement, activeBossHolder, targetedEntities); skillHandler = commandSkillElement; - } else if(skill.getType().equalsIgnoreCase("GROUP")) { - if(subSkill) return; + } else if (skill.getType().equalsIgnoreCase("GROUP")) { + if (subSkill) return; GroupSkillElement groupSkillElement = getGroupSkillElement(skill); groupSkillElement.castSkill(skill, groupSkillElement, activeBossHolder, targetedEntities); skillHandler = groupSkillElement; - } else if(skill.getType().equalsIgnoreCase("CUSTOM")) { + } else if (skill.getType().equalsIgnoreCase("CUSTOM")) { CustomSkillElement customSkillElement = getCustomSkillElement(skill); skillHandler = handleCustomSkillCasting(skill, customSkillElement, activeBossHolder, targetedEntities); @@ -87,7 +91,7 @@ public class BossSkillManager implements ILoadable { return; } - if(message && masterMessage != null) { + if (message && masterMessage != null) { masterMessage.replaceAll(s -> s.replace("{boss}", bossDisplayName).replace("{skill}", skillDisplayName)); targetedEntities.forEach(livingEntity -> MessageUtils.get().sendMessage(livingEntity, masterMessage)); } @@ -97,7 +101,7 @@ public class BossSkillManager implements ILoadable { } public PotionSkillElement getPotionSkillElement(Skill skill) { - if(skill.getType().equalsIgnoreCase("POTION")) { + if (skill.getType().equalsIgnoreCase("POTION")) { return BossesGson.get().fromJson(skill.getCustomData(), PotionSkillElement.class); } @@ -105,7 +109,7 @@ public class BossSkillManager implements ILoadable { } public CommandSkillElement getCommandSkillElement(Skill skill) { - if(skill.getType().equalsIgnoreCase("COMMAND")) { + if (skill.getType().equalsIgnoreCase("COMMAND")) { return BossesGson.get().fromJson(skill.getCustomData(), CommandSkillElement.class); } @@ -113,7 +117,7 @@ public class BossSkillManager implements ILoadable { } public GroupSkillElement getGroupSkillElement(Skill skill) { - if(skill.getType().equalsIgnoreCase("GROUP")) { + if (skill.getType().equalsIgnoreCase("GROUP")) { return BossesGson.get().fromJson(skill.getCustomData(), GroupSkillElement.class); } @@ -121,7 +125,7 @@ public class BossSkillManager implements ILoadable { } public CustomSkillElement getCustomSkillElement(Skill skill) { - if(skill.getType().equalsIgnoreCase("CUSTOM")) { + if (skill.getType().equalsIgnoreCase("CUSTOM")) { return BossesGson.get().fromJson(skill.getCustomData(), CustomSkillElement.class); } @@ -133,16 +137,16 @@ public class BossSkillManager implements ILoadable { } public boolean registerCustomSkill(CustomSkillHandler customSkillHandler) { - if(SKILLS.contains(customSkillHandler)) return false; - if(customSkillHandler == null) return false; + if (SKILLS.contains(customSkillHandler)) return false; + if (customSkillHandler == null) return false; SKILLS.add(customSkillHandler); return true; } public void removeCustomSkill(CustomSkillHandler customSkillHandler) { - if(!SKILLS.contains(customSkillHandler)) return; - if(customSkillHandler == null) return; + if (!SKILLS.contains(customSkillHandler)) return; + if (customSkillHandler == null) return; SKILLS.remove(customSkillHandler); } @@ -152,23 +156,23 @@ public class BossSkillManager implements ILoadable { List targetedList = new ArrayList<>(); String mode = skill.getMode(); - if(mode.equalsIgnoreCase("ONE")) { + if (mode.equalsIgnoreCase("ONE")) { return Arrays.asList(damager); - } else if(mode.equalsIgnoreCase("BOSS")) { + } else if (mode.equalsIgnoreCase("BOSS")) { for (UUID uuid : activeBossHolder.getLivingEntityMap().values()) { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(uuid); if (livingEntity != null) targetedList.add(livingEntity); } } else { - for(Player player : Bukkit.getOnlinePlayers()) { - if(!player.getWorld().equals(center.getWorld())) continue; - if(center.distanceSquared(player.getLocation()) > radiusSqr) continue; + for (Player player : Bukkit.getOnlinePlayers()) { + if (!player.getWorld().equals(center.getWorld())) continue; + if (center.distanceSquared(player.getLocation()) > radiusSqr) continue; - if(mode.equalsIgnoreCase("ALL")) { + if (mode.equalsIgnoreCase("ALL")) { targetedList.add(player); - } else if(mode.equalsIgnoreCase("RANDOM")) { - if(RandomUtils.get().preformRandomAction()) { + } else if (mode.equalsIgnoreCase("RANDOM")) { + if (RandomUtils.get().preformRandomAction()) { targetedList.add(player); } } @@ -182,7 +186,7 @@ public class BossSkillManager implements ILoadable { String type = customSkillElement.getCustom().getType(); CustomSkillHandler customSkillHandler = getCustomSkillHandler(type); - if(customSkillHandler == null) { + if (customSkillHandler == null) { Debug.FAILED_TO_OBTAIN_THE_SKILL_HANDLER.debug(type); return null; } @@ -192,19 +196,15 @@ public class BossSkillManager implements ILoadable { } private CustomSkillHandler getCustomSkillHandler(String name) { - for(CustomSkillHandler customSkillHandler : new HashSet<>(SKILLS)) { + for (CustomSkillHandler customSkillHandler : new HashSet<>(SKILLS)) { String skillName = customSkillHandler.getSkillName(); - if(skillName.equalsIgnoreCase(name)) return customSkillHandler; + if (skillName.equalsIgnoreCase(name)) return customSkillHandler; } return null; } - public static ICustomSettingAction createCustomSkillAction(String name, String current, ItemStack displayStack, ClickAction clickAction) { - return new CustomSkillActionCreator(name, current, displayStack, clickAction); - } - public List getValidSkillTypes() { return this.validSkillTypes; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java index bdb7e1e..d4605af 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTargetManager.java @@ -34,11 +34,11 @@ public class BossTargetManager { String targeting = bossEntity.getTargeting(); TargetHandler targetHandler; - if(targeting.equalsIgnoreCase("RandomNearby")) { - targetHandler = getRandomNearbyTargetHandler(activeBossHolder); - } else if(targeting.equalsIgnoreCase("TopDamager")) { + if (targeting.equalsIgnoreCase("RandomNearby")) { + targetHandler = getRandomNearbyTargetHandler(activeBossHolder); + } else if (targeting.equalsIgnoreCase("TopDamager")) { targetHandler = getTopDamagerTargetHandler(activeBossHolder); - } else if(targeting.equalsIgnoreCase("NotDamagedNearby")) { + } else if (targeting.equalsIgnoreCase("NotDamagedNearby")) { targetHandler = getNotDamagedNearbyTargetHandler(activeBossHolder); } else { targetHandler = getClosestTargetHandler(activeBossHolder); @@ -52,11 +52,11 @@ public class BossTargetManager { String targeting = minionEntity.getTargeting(); TargetHandler targetHandler; - if(targeting.equalsIgnoreCase("RandomNearby")) { + if (targeting.equalsIgnoreCase("RandomNearby")) { targetHandler = getRandomNearbyTargetHandler(activeMinionHolder); - } else if(targeting.equalsIgnoreCase("TopDamager")) { + } else if (targeting.equalsIgnoreCase("TopDamager")) { targetHandler = getTopDamagerTargetHandler(activeMinionHolder); - } else if(targeting.equalsIgnoreCase("NotDamagedNearby")) { + } else if (targeting.equalsIgnoreCase("NotDamagedNearby")) { targetHandler = getNotDamagedNearbyTargetHandler(activeMinionHolder); } else { targetHandler = getClosestTargetHandler(activeMinionHolder); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java index fe5bc95..275150b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossTauntManager.java @@ -29,19 +29,19 @@ public class BossTauntManager { public void handleTauntSystem(ActiveBossHolder activeBossHolder) { BossEntity bossEntity = activeBossHolder.getBossEntity(); - if(bossEntity.getMessages() == null) return; - if(bossEntity.getMessages().getTaunts() == null) return; + if (bossEntity.getMessages() == null) return; + if (bossEntity.getMessages().getTaunts() == null) return; TauntElement tauntElement = bossEntity.getMessages().getTaunts(); Integer delay = tauntElement.getDelay(); Integer radius = tauntElement.getRadius(); List taunts = tauntElement.getTaunts(); - if(delay == null) delay = 60; - if(radius == null) radius = 100; + if (delay == null) delay = 60; + if (radius == null) radius = 100; - if(taunts != null) { - if(taunts.isEmpty()) return; + if (taunts != null) { + if (taunts.isEmpty()) return; createRunnable(taunts, activeBossHolder, NumberUtils.get().getSquared(radius), delay); } @@ -53,12 +53,12 @@ public class BossTauntManager { @Override public void run() { - if(activeBossHolder.isDead() || BossTauntManager.this.plugin.getBossEntityManager().isAllEntitiesDead(activeBossHolder)) { + if (activeBossHolder.isDead() || BossTauntManager.this.plugin.getBossEntityManager().isAllEntitiesDead(activeBossHolder)) { cancel(); return; } - if(this.queue.isEmpty()) this.queue = new LinkedList<>(taunts); + if (this.queue.isEmpty()) this.queue = new LinkedList<>(taunts); List messages = BossAPI.getStoredMessages(this.queue.poll()); @@ -66,6 +66,6 @@ public class BossTauntManager { MessageUtils.get().sendMessage(activeBossHolder.getLocation(), radius, messages); } } - }.runTaskTimer(this.plugin, delay*20, delay*20); + }.runTaskTimer(this.plugin, delay * 20, delay * 20); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java index fd0efbb..bfc7dd9 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/MinionMechanicManager.java @@ -19,8 +19,8 @@ import java.util.Queue; */ public class MinionMechanicManager implements IMechanicManager { - private Queue mechanics; private final EpicBosses epicBosses; + private Queue mechanics; public MinionMechanicManager(EpicBosses epicBosses) { this.epicBosses = epicBosses; @@ -46,22 +46,22 @@ public class MinionMechanicManager implements IMechanicManager queue = new LinkedList<>(this.mechanics); - while(!queue.isEmpty()) { + while (!queue.isEmpty()) { IMinionMechanic mechanic = queue.poll(); - if(mechanic == null) continue; + if (mechanic == null) continue; ServerUtils.get().logDebug("Applying " + mechanic.getClass().getSimpleName()); - if(didMechanicApplicationFail(mechanic, minionEntity, activeMinionHolder)) { + if (didMechanicApplicationFail(mechanic, minionEntity, activeMinionHolder)) { Debug.FAILED_TO_APPLY_MECHANIC.debug(mechanic.getClass().getSimpleName()); } } @@ -69,9 +69,9 @@ public class MinionMechanicManager implements IMechanicManager commands) { - if(this.commandsMap.containsKey(id)) return false; + if (this.commandsMap.containsKey(id)) return false; commandsMap.put(id, commands); return true; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/DropTableFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/DropTableFileManager.java index c9d1728..81a5e00 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/DropTableFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/DropTableFileManager.java @@ -43,7 +43,7 @@ public class DropTableFileManager implements ILoadable, ISavable, IReloadable { } public void saveDropTable(String name, DropTable dropTable) { - if(this.dropTableMap.containsKey(name)) return; + if (this.dropTableMap.containsKey(name)) return; this.dropTableMap.put(name, dropTable); save(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java index 473662d..cdde0ca 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/MessagesFileManager.java @@ -49,7 +49,7 @@ public class MessagesFileManager implements ILoadable, ISavable { } public boolean addNewMessage(String id, List message) { - if(this.messagesMap.containsKey(id)) return false; + if (this.messagesMap.containsKey(id)) return false; messagesMap.put(id, message); return true; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java index e064f9d..edf2e64 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java @@ -19,7 +19,7 @@ public class EntityTypeMechanic implements IBossMechanic { @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - for(EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); String bossEntityType = mainStatsElement.getEntityType(); @@ -27,20 +27,20 @@ public class EntityTypeMechanic implements IBossMechanic { EntityFinder entityFinder = EntityFinder.get(input); Integer position = mainStatsElement.getPosition(); - if(position == null) position = 1; - if(entityFinder == null) return false; + if (position == null) position = 1; + if (entityFinder == null) return false; LivingEntity livingEntity = entityFinder.spawnNewLivingEntity(bossEntityType, activeBossHolder.getLocation()); - if(livingEntity == null) return false; + if (livingEntity == null) return false; activeBossHolder.setLivingEntity(position, livingEntity); - if(position > 1) { + if (position > 1) { int lowerPosition = position - 1; LivingEntity lowerLivingEntity = activeBossHolder.getLivingEntity(lowerPosition); - if(lowerLivingEntity == null) { + if (lowerLivingEntity == null) { Debug.FAILED_ATTEMPT_TO_STACK_BOSSES.debug(BossAPI.getBossEntityName(bossEntity)); return false; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EquipmentMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EquipmentMechanic.java index ce20186..27e8af3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EquipmentMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EquipmentMechanic.java @@ -27,13 +27,13 @@ public class EquipmentMechanic implements IBossMechanic { @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; + if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; - for(EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeBossHolder.getLivingEntity(mainStatsElement.getPosition()); - if(livingEntity == null) return false; + if (livingEntity == null) return false; EquipmentElement equipmentElement = entityStatsElement.getEquipment(); EntityEquipment entityEquipment = livingEntity.getEquipment(); @@ -42,40 +42,40 @@ public class EquipmentMechanic implements IBossMechanic { String leggings = equipmentElement.getLeggings(); String boots = equipmentElement.getBoots(); - if(helmet != null) { + if (helmet != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(helmet); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setHelmet(itemStack); } } - if(chestplate != null) { + if (chestplate != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(chestplate); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setChestplate(itemStack); } } - if(leggings != null) { + if (leggings != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(leggings); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setLeggings(itemStack); } } - if(boots != null) { + if (boots != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(boots); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setBoots(itemStack); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java index 0544891..b0d5d9d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java @@ -18,18 +18,18 @@ public class HealthMechanic implements IBossMechanic { @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; + if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; double maxHealthSetting = (double) SpigotYmlReader.get().getObject("settings.attribute.maxHealth.max"); - for(EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeBossHolder.getLivingEntity(mainStatsElement.getPosition()); double maxHealth = mainStatsElement.getHealth(); - if(livingEntity == null) return false; + if (livingEntity == null) return false; - if(maxHealth > maxHealthSetting) { + if (maxHealth > maxHealthSetting) { Debug.MAX_HEALTH.debug(maxHealthSetting); return false; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/PotionMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/PotionMechanic.java index a1f795f..db54016 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/PotionMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/PotionMechanic.java @@ -28,16 +28,16 @@ public class PotionMechanic implements IBossMechanic { @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; + if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; - for(EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeBossHolder.getLivingEntity(mainStatsElement.getPosition()); List potionElements = entityStatsElement.getPotions(); - if(livingEntity == null) return false; + if (livingEntity == null) return false; - if(potionElements != null && !potionElements.isEmpty()) { + if (potionElements != null && !potionElements.isEmpty()) { potionElements.forEach(potionElement -> { PotionEffect potionEffect = this.potionEffectConverter.from(potionElement); if (potionEffect == null) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/SettingsMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/SettingsMechanic.java index 342df70..bdcd3f6 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/SettingsMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/SettingsMechanic.java @@ -1,11 +1,11 @@ package com.songoda.epicbosses.mechanics.boss; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.MainStatsElement; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.mechanics.IBossMechanic; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.EntityEquipment; @@ -16,21 +16,15 @@ import org.bukkit.inventory.EntityEquipment; */ public class SettingsMechanic implements IBossMechanic { - private VersionHandler versionHandler; - - public SettingsMechanic() { - this.versionHandler = new VersionHandler(); - } - @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; + if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; - for(EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeBossHolder.getLivingEntity(mainStatsElement.getPosition()); - if(livingEntity == null) return false; + if (livingEntity == null) return false; EntityEquipment entityEquipment = livingEntity.getEquipment(); @@ -41,7 +35,7 @@ public class SettingsMechanic implements IBossMechanic { entityEquipment.setLeggingsDropChance(0.0F); entityEquipment.setBootsDropChance(0.0F); - if(this.versionHandler.canUseOffHand()) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9)) { entityEquipment.setItemInMainHandDropChance(0.0F); entityEquipment.setItemInOffHandDropChance(0.0F); } else { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java index 4eb38e9..421224a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/WeaponMechanic.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.mechanics.boss; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.HandsElement; @@ -8,7 +9,6 @@ import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.mechanics.IBossMechanic; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; @@ -21,46 +21,40 @@ import org.bukkit.inventory.ItemStack; public class WeaponMechanic implements IBossMechanic { private ItemsFileManager itemStackManager; - private VersionHandler versionHandler; public WeaponMechanic(ItemsFileManager itemStackManager) { this.itemStackManager = itemStackManager; - this.versionHandler = new VersionHandler(); } @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; + if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; - for(EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeBossHolder.getLivingEntity(mainStatsElement.getPosition()); - if(livingEntity == null) return false; + if (livingEntity == null) return false; EntityEquipment entityEquipment = livingEntity.getEquipment(); HandsElement handsElement = entityStatsElement.getHands(); String mainHand = handsElement.getMainHand(); String offHand = handsElement.getOffHand(); - if(mainHand != null) { + if (mainHand != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(mainHand); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); - if(this.versionHandler.canUseOffHand()) { - entityEquipment.setItemInMainHand(itemStack); - } else { - entityEquipment.setItemInHand(itemStack); - } + entityEquipment.setItemInHand(itemStack); } } - if(offHand != null && this.versionHandler.canUseOffHand()) { + if (offHand != null && ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9)) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(offHand); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setItemInOffHand(itemStack); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java index 43c496a..6d9b571 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java @@ -19,7 +19,7 @@ public class EntityTypeMechanic implements IMinionMechanic { @Override public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) { - for(EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); String bossEntityType = mainStatsElement.getEntityType(); @@ -27,21 +27,21 @@ public class EntityTypeMechanic implements IMinionMechanic { EntityFinder entityFinder = EntityFinder.get(input); Integer position = mainStatsElement.getPosition(); - if(position == null) position = 1; - if(entityFinder == null) return false; + if (position == null) position = 1; + if (entityFinder == null) return false; LivingEntity livingEntity = entityFinder.spawnNewLivingEntity(bossEntityType, activeMinionHolder.getLocation()); - if(livingEntity == null) return false; - if(!activeMinionHolder.getLivingEntityMap().isEmpty()) activeMinionHolder.killAll(); + if (livingEntity == null) return false; + if (!activeMinionHolder.getLivingEntityMap().isEmpty()) activeMinionHolder.killAll(); activeMinionHolder.getLivingEntityMap().put(position, livingEntity.getUniqueId()); - if(position > 1) { + if (position > 1) { int lowerPosition = position - 1; LivingEntity lowerLivingEntity = activeMinionHolder.getLivingEntity(lowerPosition); - if(lowerLivingEntity == null) { + if (lowerLivingEntity == null) { Debug.FAILED_ATTEMPT_TO_STACK_BOSSES.debug(BossAPI.getMinionEntityName(minionEntity)); return false; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EquipmentMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EquipmentMechanic.java index 5a864e6..d0d54d8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EquipmentMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EquipmentMechanic.java @@ -27,13 +27,14 @@ public class EquipmentMechanic implements IMinionMechanic { @Override public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeBossHolder) { - if(activeBossHolder.getLivingEntityMap() == null || activeBossHolder.getLivingEntityMap().isEmpty()) return false; + if (activeBossHolder.getLivingEntityMap() == null || activeBossHolder.getLivingEntityMap().isEmpty()) + return false; - for(EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeBossHolder.getLivingEntity(mainStatsElement.getPosition()); - if(livingEntity == null) return false; + if (livingEntity == null) return false; EquipmentElement equipmentElement = entityStatsElement.getEquipment(); EntityEquipment entityEquipment = livingEntity.getEquipment(); @@ -42,40 +43,40 @@ public class EquipmentMechanic implements IMinionMechanic { String leggings = equipmentElement.getLeggings(); String boots = equipmentElement.getBoots(); - if(helmet != null) { + if (helmet != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(helmet); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setHelmet(itemStack); } } - if(chestplate != null) { + if (chestplate != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(chestplate); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setChestplate(itemStack); } } - if(leggings != null) { + if (leggings != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(leggings); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setLeggings(itemStack); } } - if(boots != null) { + if (boots != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(boots); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setBoots(itemStack); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/HealthMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/HealthMechanic.java index aa50927..b7fe4e1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/HealthMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/HealthMechanic.java @@ -18,18 +18,19 @@ public class HealthMechanic implements IMinionMechanic { @Override public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) { - if(activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) return false; + if (activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) + return false; double maxHealthSetting = (double) SpigotYmlReader.get().getObject("settings.attribute.maxHealth.max"); - for(EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeMinionHolder.getLivingEntity(mainStatsElement.getPosition()); double maxHealth = mainStatsElement.getHealth(); - if(livingEntity == null) return false; + if (livingEntity == null) return false; - if(maxHealth > maxHealthSetting) { + if (maxHealth > maxHealthSetting) { Debug.MAX_HEALTH.debug(maxHealthSetting); return false; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/PotionMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/PotionMechanic.java index 9b7d0ef..3c35d06 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/PotionMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/PotionMechanic.java @@ -26,16 +26,16 @@ public class PotionMechanic implements IMinionMechanic { @Override public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) { - if(activeMinionHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; + if (activeMinionHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; - for(EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeMinionHolder.getLivingEntity(mainStatsElement.getPosition()); List potionElements = entityStatsElement.getPotions(); - if(livingEntity == null) return false; + if (livingEntity == null) return false; - if(potionElements != null && !potionElements.isEmpty()) { + if (potionElements != null && !potionElements.isEmpty()) { potionElements.forEach(potionElement -> livingEntity.addPotionEffect(this.potionEffectConverter.from(potionElement))); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/SettingsMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/SettingsMechanic.java index fb24325..96a6dec 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/SettingsMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/SettingsMechanic.java @@ -1,11 +1,11 @@ package com.songoda.epicbosses.mechanics.minions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.MainStatsElement; import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.mechanics.IMinionMechanic; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.EntityEquipment; @@ -16,21 +16,16 @@ import org.bukkit.inventory.EntityEquipment; */ public class SettingsMechanic implements IMinionMechanic { - private VersionHandler versionHandler; - - public SettingsMechanic() { - this.versionHandler = new VersionHandler(); - } - @Override public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) { - if(activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) return false; + if (activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) + return false; - for(EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeMinionHolder.getLivingEntity(mainStatsElement.getPosition()); - if(livingEntity == null) return false; + if (livingEntity == null) return false; EntityEquipment entityEquipment = livingEntity.getEquipment(); @@ -41,7 +36,7 @@ public class SettingsMechanic implements IMinionMechanic { entityEquipment.setLeggingsDropChance(0.0F); entityEquipment.setBootsDropChance(0.0F); - if(this.versionHandler.canUseOffHand()) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9)) { entityEquipment.setItemInMainHandDropChance(0.0F); entityEquipment.setItemInOffHandDropChance(0.0F); } else { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/WeaponMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/WeaponMechanic.java index c02e5eb..70e8e69 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/WeaponMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/WeaponMechanic.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.mechanics.minions; +import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.entity.MinionEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.HandsElement; @@ -8,7 +9,6 @@ import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.mechanics.IMinionMechanic; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; @@ -21,35 +21,34 @@ import org.bukkit.inventory.ItemStack; public class WeaponMechanic implements IMinionMechanic { private ItemsFileManager itemStackManager; - private VersionHandler versionHandler; public WeaponMechanic(ItemsFileManager itemStackManager) { this.itemStackManager = itemStackManager; - this.versionHandler = new VersionHandler(); } @Override public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) { - if(activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) return false; + if (activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) + return false; - for(EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { + for (EntityStatsElement entityStatsElement : minionEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); LivingEntity livingEntity = activeMinionHolder.getLivingEntity(mainStatsElement.getPosition()); - if(livingEntity == null) return false; + if (livingEntity == null) return false; EntityEquipment entityEquipment = livingEntity.getEquipment(); HandsElement handsElement = entityStatsElement.getHands(); String mainHand = handsElement.getMainHand(); String offHand = handsElement.getOffHand(); - if(mainHand != null) { + if (mainHand != null) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(mainHand); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); - if(this.versionHandler.canUseOffHand()) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9)) { entityEquipment.setItemInMainHand(itemStack); } else { entityEquipment.setItemInHand(itemStack); @@ -57,10 +56,10 @@ public class WeaponMechanic implements IMinionMechanic { } } - if(offHand != null && this.versionHandler.canUseOffHand()) { + if (offHand != null && ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9)) { ItemStackHolder itemStackHolder = this.itemStackManager.getItemStackHolder(offHand); - if(itemStackHolder != null) { + if (itemStackHolder != null) { ItemStack itemStack = this.itemStackManager.getItemStackConverter().from(itemStackHolder); entityEquipment.setItemInOffHand(itemStack); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java index 89da042..d1e3823 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Cage.java @@ -25,7 +25,6 @@ import com.songoda.epicbosses.utils.itemstack.converters.MaterialConverter; import com.songoda.epicbosses.utils.panel.base.ClickAction; import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler; import com.songoda.epicbosses.utils.time.TimeUnit; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -47,7 +46,6 @@ import java.util.*; public class Cage extends CustomSkillHandler { private static final MaterialConverter MATERIAL_CONVERTER = new MaterialConverter(); - private static final VersionHandler versionHandler = new VersionHandler(); private static final Map cageLocationDataMap = new HashMap<>(); private static final List playersInCage = new ArrayList<>(); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java index 88e723d..0c2b9d0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Disarm.java @@ -52,8 +52,8 @@ public class Disarm extends CustomSkillHandler { if (livingEntity instanceof HumanEntity) { HumanEntity humanEntity = (HumanEntity) livingEntity; - itemStack = EpicBosses.getInstance().getVersionHandler().getItemInHand(humanEntity); - EpicBosses.getInstance().getVersionHandler().setItemInHand(humanEntity, replacementItemStack); + itemStack = humanEntity.getItemInHand(); + humanEntity.setItemInHand(replacementItemStack); break; } case 1: diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java index 76a8f3f..5208440 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java @@ -32,14 +32,14 @@ public abstract class TargetHandler implements ITa ServerUtils.get().runLaterAsync(10L, () -> { updateTarget(); - if(!getHolder().isDead()) runTargetCycle(); + if (!getHolder().isDead()) runTargetCycle(); }); } protected LivingEntity getBossEntity() { - for(UUID uuid : getHolder().getLivingEntityMap().values()) { + for (UUID uuid : getHolder().getLivingEntityMap().values()) { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(uuid); - if(livingEntity != null && !livingEntity.isDead()) return livingEntity; + if (livingEntity != null && !livingEntity.isDead()) return livingEntity; } return null; @@ -49,22 +49,22 @@ public abstract class TargetHandler implements ITa LivingEntity boss = getBossEntity(); double radius = this.bossTargetManager.getTargetRadius(); - if(boss == null) return; + if (boss == null) return; List nearbyEntities = new ArrayList<>(); List nearbyBossEntities = boss.getNearbyEntities(radius, radius, radius); - if(nearbyBossEntities == null) return; + if (nearbyBossEntities == null) return; - for(Entity entity : nearbyBossEntities) { - if(!(entity instanceof Player)) continue; + for (Entity entity : nearbyBossEntities) { + if (!(entity instanceof Player)) continue; LivingEntity livingEntity = (LivingEntity) entity; - if(livingEntity instanceof Player) { + if (livingEntity instanceof Player) { Player player = (Player) livingEntity; - if(player.getGameMode() == GameMode.SPECTATOR || player.getGameMode() == GameMode.CREATIVE) continue; + if (player.getGameMode() == GameMode.SPECTATOR || player.getGameMode() == GameMode.CREATIVE) continue; } nearbyEntities.add(livingEntity); @@ -76,7 +76,7 @@ public abstract class TargetHandler implements ITa private void updateBoss(LivingEntity newTarget) { getHolder().getLivingEntityMap().values().forEach(uuid -> { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(uuid); - if(livingEntity != null && !livingEntity.isDead()) { + if (livingEntity != null && !livingEntity.isDead()) { ((Creature) livingEntity).setTarget(newTarget); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/ClosestTargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/ClosestTargetHandler.java index e42ecf5..349be76 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/ClosestTargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/ClosestTargetHandler.java @@ -25,8 +25,8 @@ public class ClosestTargetHandler extends TargetHandler double closestDistance = (radius * radius); LivingEntity nearestTarget = null; - for(LivingEntity livingEntity : nearbyEntities) { - if(livingEntity.getLocation().distanceSquared(boss.getLocation()) > closestDistance) continue; + for (LivingEntity livingEntity : nearbyEntities) { + if (livingEntity.getLocation().distanceSquared(boss.getLocation()) > closestDistance) continue; closestDistance = livingEntity.getLocation().distanceSquared(boss.getLocation()); nearestTarget = livingEntity; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/NotDamagedNearbyTargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/NotDamagedNearbyTargetHandler.java index 53ebcb6..19cc2e1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/NotDamagedNearbyTargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/NotDamagedNearbyTargetHandler.java @@ -21,13 +21,13 @@ public class NotDamagedNearbyTargetHandler extends Targ @Override public LivingEntity selectTarget(List nearbyEntities) { - for(LivingEntity livingEntity : nearbyEntities) { - if(getHolder().hasAttacked(livingEntity.getUniqueId())) continue; + for (LivingEntity livingEntity : nearbyEntities) { + if (getHolder().hasAttacked(livingEntity.getUniqueId())) continue; return livingEntity; } - if(!nearbyEntities.isEmpty()) { + if (!nearbyEntities.isEmpty()) { Collections.shuffle(nearbyEntities); return nearbyEntities.stream().findFirst().orElse(null); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java index ed57c2f..7103a2a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/types/TopDamagerTargetHandler.java @@ -30,7 +30,7 @@ public class TopDamagerTargetHandler extends TargetHand nearbyEntities.forEach(livingEntity -> { UUID uuid = livingEntity.getUniqueId(); - if(mapOfDamages.containsKey(uuid)) { + if (mapOfDamages.containsKey(uuid)) { nearbyDamages.put(livingEntity, mapOfDamages.get(uuid)); } }); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java index 94d71e3..82ead55 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java @@ -2,15 +2,12 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class DolphinHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java index 78b0220..985812b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java @@ -2,15 +2,12 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class DrownedHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java index f1b6044..4a701c8 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ElderGuardianHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,8 +13,6 @@ import org.bukkit.entity.LivingEntity; */ public class ElderGuardianHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java index 28ce5d1..db40e71 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/EndermiteHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,8 +13,6 @@ import org.bukkit.entity.LivingEntity; */ public class EndermiteHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java index 52d47fa..b642fbe 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java @@ -2,15 +2,12 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class FishHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java index c6af784..7524472 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java @@ -2,15 +2,12 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class FoxHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java index f2ba492..815e8db 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PandaHandler.java @@ -2,15 +2,12 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class PandaHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java index 69515db..20531b1 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java @@ -2,15 +2,12 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; public class PillagerHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_14)) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java index a19e170..989e5eb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/ShulkerHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -14,8 +13,6 @@ import org.bukkit.entity.LivingEntity; */ public class ShulkerHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionBelow(ServerVersion.V1_9)) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java index 52b94af..52b59d5 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/WitherSkeletonHandler.java @@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.entity.handlers; import com.songoda.core.compatibility.ServerVersion; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -15,8 +14,6 @@ import org.bukkit.entity.Skeleton; */ public class WitherSkeletonHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @Override public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) { diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java index ec73a16..848780e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java @@ -7,7 +7,6 @@ import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.enchants.GlowEnchant; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; -import com.songoda.epicbosses.utils.version.VersionHandler; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -26,7 +25,6 @@ import java.util.*; */ public class ItemStackUtils { - private static final VersionHandler versionHandler = new VersionHandler(); private static final Map spawnableEntityMaterials; private static final Map spawnableEntityIds; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java deleted file mode 100644 index 0a93e83..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.songoda.epicbosses.utils.version; - -import com.songoda.core.compatibility.ServerVersion; -import org.bukkit.entity.HumanEntity; -import org.bukkit.inventory.ItemStack; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 27-Jun-18 - */ -public class VersionHandler { - - public boolean canUseOffHand() { - return ServerVersion.isServerVersionAtLeast(ServerVersion.V1_9); - } - - public ItemStack getItemInHand(HumanEntity humanEntity) { - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { - return humanEntity.getItemInHand(); - } else { - return humanEntity.getInventory().getItemInMainHand(); - } - } - - public void setItemInHand(HumanEntity humanEntity, ItemStack itemStack) { - if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_8)) { - humanEntity.setItemInHand(itemStack); - } else { - humanEntity.getInventory().setItemInMainHand(itemStack); - } - } -} From af93fa83efb66b39e880233bb209b2f3c86bc0a1 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 21:50:10 -0400 Subject: [PATCH 06/16] Converted to core command system & added auto complete. --- plugin-modules/Core/resources-yml/plugin.yml | 7 +- .../com/songoda/epicbosses/EpicBosses.java | 43 +++- .../songoda/epicbosses/commands/BossCmd.java | 36 --- .../epicbosses/commands/CommandBoss.java | 54 ++++ .../BossCreateCmd.java => CommandCreate.java} | 65 +++-- .../BossDebugCmd.java => CommandDebug.java} | 46 ++-- .../epicbosses/commands/CommandDropTable.java | 50 ++++ .../BossEditCmd.java => CommandEdit.java} | 59 +++-- ...ossGiveEggCmd.java => CommandGiveEgg.java} | 71 +++-- .../BossInfoCmd.java => CommandInfo.java} | 54 ++-- .../epicbosses/commands/CommandItems.java | 49 ++++ .../epicbosses/commands/CommandKillAll.java | 71 +++++ .../epicbosses/commands/CommandList.java | 49 ++++ .../epicbosses/commands/CommandMenu.java | 49 ++++ .../BossNearbyCmd.java => CommandNearby.java} | 66 +++-- .../commands/CommandNewAutoSpawn.java | 70 +++++ .../commands/CommandNewCommand.java | 95 +++++++ .../commands/CommandNewDropTable.java | 90 +++++++ .../commands/CommandNewMessage.java | 99 +++++++ .../epicbosses/commands/CommandNewSkill.java | 104 ++++++++ .../BossReloadCmd.java => CommandReload.java} | 42 ++- .../epicbosses/commands/CommandShop.java | 56 ++++ .../epicbosses/commands/CommandSkills.java | 49 ++++ .../BossSpawnCmd.java => CommandSpawn.java} | 66 +++-- .../BossTimeCmd.java => CommandTime.java} | 56 ++-- .../commands/boss/BossDropTableCmd.java | 41 --- .../epicbosses/commands/boss/BossHelpCmd.java | 55 ---- .../commands/boss/BossItemsCmd.java | 41 --- .../commands/boss/BossKillAllCmd.java | 51 ---- .../epicbosses/commands/boss/BossListCmd.java | 41 --- .../epicbosses/commands/boss/BossMenuCmd.java | 41 --- .../epicbosses/commands/boss/BossNewCmd.java | 243 ------------------ .../epicbosses/commands/boss/BossShopCmd.java | 46 ---- .../commands/boss/BossSkillsCmd.java | 41 --- .../epicbosses/managers/AutoSpawnManager.java | 8 +- .../managers/BossCommandManager.java | 53 ---- .../com/songoda/epicbosses/utils/Message.java | 71 ----- .../utils/command/CommandService.java | 117 --------- .../utils/command/ISubCommandHandler.java | 16 -- .../epicbosses/utils/command/SubCommand.java | 45 ---- .../utils/command/SubCommandService.java | 37 --- .../utils/command/attributes/Alias.java | 15 -- .../utils/command/attributes/Description.java | 15 -- .../utils/command/attributes/Name.java | 15 -- .../command/attributes/NoPermission.java | 17 -- .../utils/command/attributes/Permission.java | 15 -- .../utils/command/attributes/Suggest.java | 15 -- 47 files changed, 1277 insertions(+), 1258 deletions(-) delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandBoss.java rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossCreateCmd.java => CommandCreate.java} (55%) rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossDebugCmd.java => CommandDebug.java} (51%) create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDropTable.java rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossEditCmd.java => CommandEdit.java} (54%) rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossGiveEggCmd.java => CommandGiveEgg.java} (52%) rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossInfoCmd.java => CommandInfo.java} (51%) create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandItems.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandKillAll.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandList.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandMenu.java rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossNearbyCmd.java => CommandNearby.java} (52%) create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewAutoSpawn.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewCommand.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewDropTable.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewMessage.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewSkill.java rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossReloadCmd.java => CommandReload.java} (50%) create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandShop.java create mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSkills.java rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossSpawnCmd.java => CommandSpawn.java} (50%) rename plugin-modules/Core/src/com/songoda/epicbosses/commands/{boss/BossTimeCmd.java => CommandTime.java} (67%) delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/ISubCommandHandler.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommand.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java delete mode 100644 plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java diff --git a/plugin-modules/Core/resources-yml/plugin.yml b/plugin-modules/Core/resources-yml/plugin.yml index 0873557..e6c1233 100644 --- a/plugin-modules/Core/resources-yml/plugin.yml +++ b/plugin-modules/Core/resources-yml/plugin.yml @@ -3,4 +3,9 @@ main: ${plugin.main} version: ${plugin.version} author: ${plugin.author} api-version: 1.13 -softdepend: [PlaceholderAPI] # TODO: Add other softdepends \ No newline at end of file +softdepend: [PlaceholderAPI] # TODO: Add other softdepends +commands: + Boss: + description: Used to handle all CustomBosses related commands. + default: true + aliases: [bosses, eb, epicbosses] \ No newline at end of file diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java index 6c28dd9..edb72a7 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java @@ -2,12 +2,13 @@ package com.songoda.epicbosses; import com.songoda.core.SongodaCore; import com.songoda.core.SongodaPlugin; +import com.songoda.core.commands.CommandManager; import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.configuration.Config; import com.songoda.core.hooks.EconomyManager; import com.songoda.core.hooks.WorldGuardHook; import com.songoda.epicbosses.api.BossAPI; -import com.songoda.epicbosses.commands.BossCmd; +import com.songoda.epicbosses.commands.*; import com.songoda.epicbosses.container.BossEntityContainer; import com.songoda.epicbosses.container.MinionEntityContainer; import com.songoda.epicbosses.file.DisplayFileHandler; @@ -51,7 +52,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { private BossMechanicManager bossMechanicManager; private BossLocationManager bossLocationManager; private BossListenerManager bossListenerManager; - private BossCommandManager bossCommandManager; private BossEntityManager bossEntityManager; private BossTargetManager bossTargetManager; private BossPanelManager bossPanelManager; @@ -65,6 +65,8 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { private MinionMechanicManager minionMechanicManager; private MinionEntityContainer minionEntityContainer; + private CommandManager commandManager; + private DebugManager debugManager = new DebugManager(); private YmlFileHandler langFileHandler, editorFileHandler, displayFileHandler; @@ -153,7 +155,33 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { this.dropTableFileManager.reload(); this.autoSpawnFileManager.reload(); - this.bossCommandManager = new BossCommandManager(new BossCmd(), this); + // Register commands + this.commandManager = new CommandManager(this); + this.commandManager.addCommand(new CommandBoss()) + .addSubCommands( + new CommandCreate(bossEntityContainer), + new CommandDebug(debugManager), + new CommandDropTable(bossPanelManager), + new CommandEdit(bossPanelManager, bossEntityContainer), + new CommandGiveEgg(bossesFileManager, bossEntityManager), + new CommandInfo(bossesFileManager, bossEntityManager), + new CommandItems(bossPanelManager), + new CommandKillAll(bossEntityManager), + new CommandList(bossPanelManager), + new CommandMenu(bossPanelManager), + new CommandNearby(this), + new CommandNewSkill(skillsFileManager, bossSkillManager), + new CommandNewAutoSpawn(autoSpawnFileManager), + new CommandNewCommand(bossCommandFileManager), + new CommandNewMessage(bossCommandFileManager, bossMessagesFileManager), + new CommandNewDropTable(dropTableFileManager, bossDropTableManager), + new CommandReload(this, bossEntityManager), + new CommandShop(this), + new CommandSkills(bossPanelManager), + new CommandSpawn(bossesFileManager), + new CommandTime(this) + ); + this.bossListenerManager = new BossListenerManager(this); this.bossPanelManager.load(); @@ -167,7 +195,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { saveMessagesToFile(); - this.bossCommandManager.load(); this.bossListenerManager.load(); this.autoSpawnManager.startIntervalSystems(); @@ -295,10 +322,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { return this.bossListenerManager; } - public BossCommandManager getBossCommandManager() { - return this.bossCommandManager; - } - public BossEntityManager getBossEntityManager() { return this.bossEntityManager; } @@ -339,6 +362,10 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { return this.minionEntityContainer; } + public CommandManager getCommandManager() { + return commandManager; + } + public DebugManager getDebugManager() { return this.debugManager; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java deleted file mode 100644 index c7563d3..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.songoda.epicbosses.commands; - -import com.songoda.epicbosses.utils.command.SubCommandService; -import com.songoda.epicbosses.utils.command.attributes.Alias; -import com.songoda.epicbosses.utils.command.attributes.Description; -import com.songoda.epicbosses.utils.command.attributes.Name; -import org.bukkit.Bukkit; -import org.bukkit.command.CommandSender; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 18-Jul-18 - */ -@Name("boss") -@Alias({"bosses", "b", "bs", "eb", "epicbosses"}) -@Description("Used to handle all CustomBosses related commands.") - -public class BossCmd extends SubCommandService { - - public BossCmd() { - super(BossCmd.class); - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (args.length == 0) { - Bukkit.dispatchCommand(sender, "boss help"); - return; - } - - if (handleSubCommand(sender, args)) return; - - Bukkit.dispatchCommand(sender, "boss help"); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandBoss.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandBoss.java new file mode 100644 index 0000000..c96c520 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandBoss.java @@ -0,0 +1,54 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.core.utils.TextUtils; +import com.songoda.epicbosses.EpicBosses; +import org.bukkit.command.CommandSender; + +import java.util.List; + +public class CommandBoss extends AbstractCommand { + + EpicBosses instance; + + public CommandBoss() { + super(false, "Boss"); + instance = EpicBosses.getInstance(); + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + sender.sendMessage(""); + sender.sendMessage(TextUtils.formatText("&b&lEpicBosses &8» &7Version " + instance.getDescription().getVersion() + + " Created with <3 by &5&l&oSongoda")); + + for (AbstractCommand command : instance.getCommandManager().getAllCommands()) { + if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) { + sender.sendMessage(TextUtils.formatText("&8 - &a" + command.getSyntax() + "&7 - " + command.getDescription())); + } + } + sender.sendMessage(""); + + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender cs, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return null; + } + + @Override + public String getSyntax() { + return "/boss"; + } + + @Override + public String getDescription() { + return "Displays this page."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandCreate.java similarity index 55% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandCreate.java index 023537e..3a4fc8f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossCreateCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandCreate.java @@ -1,5 +1,6 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.container.BossEntityContainer; import com.songoda.epicbosses.entity.BossEntity; @@ -7,69 +8,91 @@ import com.songoda.epicbosses.utils.EntityFinder; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.Permission; import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.command.CommandSender; +import org.bukkit.entity.EntityType; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; /** * @author Charles Cullen * @version 1.0.0 * @since 02-Oct-18 */ -public class BossCreateCmd extends SubCommand { +public class CommandCreate extends AbstractCommand { private BossEntityContainer bossEntityContainer; - public BossCreateCmd(BossEntityContainer bossEntityContainer) { - super("create"); - + public CommandCreate(BossEntityContainer bossEntityContainer) { + super(true, "create"); this.bossEntityContainer = bossEntityContainer; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.create.hasPermission(sender)) { - Message.Boss_Create_NoPermission.msg(sender); - return; - } - + protected ReturnType runCommand(CommandSender sender, String... args) { switch (args.length) { - case 2: + case 1: List availableEntities = new ArrayList<>(Arrays.asList(EntityFinder.values())); String list = StringUtils.get().appendList(availableEntities); Message.Boss_Create_NoEntitySpecified.msg(sender, list); - return; - case 3: - String name = args[1]; - String entityTypeInput = args[2]; + return ReturnType.FAILURE; + case 2: + String name = args[0]; + String entityTypeInput = args[1]; if (this.bossEntityContainer.exists(name)) { Message.Boss_Create_NameAlreadyExists.msg(sender, name); - return; + return ReturnType.FAILURE; } EntityFinder entityFinder = EntityFinder.get(entityTypeInput); if (entityFinder == null) { Message.Boss_Create_EntityTypeNotFound.msg(sender, entityTypeInput); - return; + return ReturnType.FAILURE; } BossEntity bossEntity = BossAPI.createBaseBossEntity(name, entityTypeInput); if (bossEntity == null) { Message.Boss_Create_SomethingWentWrong.msg(sender); - return; + return ReturnType.FAILURE; } Message.Boss_Create_SuccessfullyCreated.msg(sender, name, entityFinder.getFancyName()); - return; + return ReturnType.SUCCESS; default: Message.Boss_Create_InvalidArgs.msg(sender); + return ReturnType.FAILURE; } } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Collections.singletonList("name"); + } else if (args.length == 2) { + return Arrays.stream(EntityType.values()).map(Enum::name).collect(Collectors.toList()); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.create"; + } + + @Override + public String getSyntax() { + return "/boss create <[>name> "; + } + + @Override + public String getDescription() { + return "Start the creation of a boss."; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDebug.java similarity index 51% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDebug.java index ff04bb7..c2241cd 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDebug.java @@ -1,39 +1,30 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.managers.DebugManager; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.List; + /** * @author Charles Cullen * @version 1.0.0 * @since 09-Oct-18 */ -public class BossDebugCmd extends SubCommand { +public class CommandDebug extends AbstractCommand { private DebugManager debugManager; - public BossDebugCmd(DebugManager debugManager) { - super("debug"); - + public CommandDebug(DebugManager debugManager) { + super(true, "debug"); this.debugManager = debugManager; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.debug.hasPermission(sender)) { - Message.Boss_Debug_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - + protected ReturnType runCommand(CommandSender sender, String... args) { Player player = (Player) sender; String toggled; @@ -46,5 +37,26 @@ public class BossDebugCmd extends SubCommand { } Message.Boss_Debug_Toggled.msg(player, toggled); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "boss.reload"; + } + + @Override + public String getSyntax() { + return "/boss reload"; + } + + @Override + public String getDescription() { + return "Reloads EpicBosses and its configurations."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDropTable.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDropTable.java new file mode 100644 index 0000000..e21e16d --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDropTable.java @@ -0,0 +1,50 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.BossPanelManager; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 04-Oct-18 + */ +public class CommandDropTable extends AbstractCommand { + + private BossPanelManager bossPanelManager; + + public CommandDropTable(BossPanelManager bossPanelManager) { + super(true, "droptable"); + this.bossPanelManager = bossPanelManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + this.bossPanelManager.getDropTables().openFor((Player) sender); + return ReturnType.SUCCESS; + } + + + @Override + protected List onTab(CommandSender commandSender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss droptable"; + } + + @Override + public String getDescription() { + return "Shows the current drop table"; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java similarity index 54% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java index a164b64..2275452 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java @@ -1,56 +1,47 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.container.BossEntityContainer; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.Collections; +import java.util.List; + /** * @author Charles Cullen * @version 1.0.0 * @since 02-Oct-18 */ -public class BossEditCmd extends SubCommand { +public class CommandEdit extends AbstractCommand { private BossEntityContainer bossEntityContainer; private BossPanelManager bossPanelManager; - public BossEditCmd(BossPanelManager bossPanelManager, BossEntityContainer bossEntityContainer) { - super("edit"); - + public CommandEdit(BossPanelManager bossPanelManager, BossEntityContainer bossEntityContainer) { + super(true, "edit"); this.bossPanelManager = bossPanelManager; this.bossEntityContainer = bossEntityContainer; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_Edit_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - + protected ReturnType runCommand(CommandSender sender, String... args) { Player player = (Player) sender; switch (args.length) { default: - case 1: + case 0: this.bossPanelManager.getBosses().openFor(player); break; - case 2: - String input = args[1]; + case 1: + String input = args[0]; if (!this.bossEntityContainer.exists(input)) { Message.Boss_Edit_DoesntExist.msg(sender); - return; + return ReturnType.FAILURE; } BossEntity bossEntity = this.bossEntityContainer.getData().get(input); @@ -58,5 +49,29 @@ public class BossEditCmd extends SubCommand { this.bossPanelManager.getMainBossEditMenu().openFor(player, bossEntity); break; } + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Collections.singletonList("name"); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.edit"; + } + + @Override + public String getSyntax() { + return "/boss edit "; + } + + @Override + public String getDescription() { + return "Edit a specified boss."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandGiveEgg.java similarity index 52% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandGiveEgg.java index 42aa340..f50a6d0 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandGiveEgg.java @@ -1,80 +1,81 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; +import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + /** * @author Charles Cullen * @version 1.0.0 * @since 14-Nov-18 */ -public class BossGiveEggCmd extends SubCommand { +public class CommandGiveEgg extends AbstractCommand { private BossEntityManager bossEntityManager; private BossesFileManager bossesFileManager; - public BossGiveEggCmd(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { - super("give", "giveegg"); + public CommandGiveEgg(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { + super(false, "give", "giveegg"); this.bossesFileManager = bossesFileManager; this.bossEntityManager = bossEntityManager; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.give.hasPermission(sender)) { - Message.Boss_GiveEgg_NoPermission.msg(sender); - return; - } + protected ReturnType runCommand(CommandSender sender, String... args) { - if (args.length < 3) { + if (args.length < 2) { Message.Boss_GiveEgg_InvalidArgs.msg(sender); - return; + return ReturnType.FAILURE; } int amount = 1; - if (args.length == 4) { - String amountInput = args[3]; + if (args.length == 3) { + String amountInput = args[2]; if (NumberUtils.get().isInt(amountInput)) { amount = Integer.valueOf(amountInput); } else { Message.General_NotNumber.msg(sender); - return; + return ReturnType.FAILURE; } } - String playerInput = args[2]; + String playerInput = args[1]; Player player = Bukkit.getPlayer(playerInput); if (player == null) { Message.General_NotOnline.msg(sender, playerInput); - return; + return ReturnType.FAILURE; } - String bossInput = args[1]; + String bossInput = args[0]; BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); if (bossEntity == null) { Message.Boss_GiveEgg_InvalidBoss.msg(sender); - return; + return ReturnType.FAILURE; } ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity); if (spawnItem == null) { Message.Boss_GiveEgg_NotSet.msg(sender); - return; + return ReturnType.FAILURE; } spawnItem.setAmount(amount); @@ -82,5 +83,33 @@ public class BossGiveEggCmd extends SubCommand { Message.Boss_GiveEgg_Given.msg(sender, player.getName(), amount, bossInput); Message.Boss_GiveEgg_Received.msg(player, amount, bossInput); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return new ArrayList<>(bossesFileManager.getBossEntitiesMap().keySet()); + } else if (args.length == 2) { + return Bukkit.getOnlinePlayers().stream().map(HumanEntity::getName).collect(Collectors.toList()); + } else if (args.length == 3) { + return Arrays.asList("1", "2", "3", "4", "5"); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.give"; + } + + @Override + public String getSyntax() { + return "/boss giveegg [amount]"; + } + + @Override + public String getDescription() { + return "Gives you the spawn egg of a boss."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandInfo.java similarity index 51% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandInfo.java index 98e2760..e42e396 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandInfo.java @@ -1,48 +1,44 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.command.CommandSender; +import java.util.ArrayList; +import java.util.List; + /** * @author Charles Cullen * @version 1.0.0 * @since 02-Oct-18 */ -public class BossInfoCmd extends SubCommand { +public class CommandInfo extends AbstractCommand { private BossEntityManager bossEntityManager; private BossesFileManager bossesFileManager; - public BossInfoCmd(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { - super("info"); - + public CommandInfo(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { + super(false, "info"); this.bossesFileManager = bossesFileManager; this.bossEntityManager = bossEntityManager; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_Info_NoPermission.msg(sender); - return; - } - - if (args.length != 2) { + protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) { + if (args.length != 1) { Message.Boss_Info_InvalidArgs.msg(sender); - return; + return ReturnType.FAILURE; } - String input = args[1]; + String input = args[0]; BossEntity bossEntity = this.bossesFileManager.getBossEntity(input); if (bossEntity == null) { Message.Boss_Info_CouldntFindBoss.msg(sender); - return; + return ReturnType.FAILURE; } boolean editing = bossEntity.isEditing(); @@ -50,5 +46,29 @@ public class BossInfoCmd extends SubCommand { boolean complete = bossEntity.isCompleteEnoughToSpawn(); Message.Boss_Info_Display.msg(sender, input, editing, active, complete); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return new ArrayList<>(bossesFileManager.getBossEntitiesMap().keySet()); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss info "; + } + + @Override + public String getDescription() { + return "Displays info on the specified boss."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandItems.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandItems.java new file mode 100644 index 0000000..f82a1d5 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandItems.java @@ -0,0 +1,49 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.BossPanelManager; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 04-Oct-18 + */ +public class CommandItems extends AbstractCommand { + + private BossPanelManager bossPanelManager; + + public CommandItems(BossPanelManager bossPanelManager) { + super(true, "item", "items"); + this.bossPanelManager = bossPanelManager; + } + + @Override + protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) { + this.bossPanelManager.getCustomItems().openFor((Player) sender); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss items"; + } + + @Override + public String getDescription() { + return "Shows all current items."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandKillAll.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandKillAll.java new file mode 100644 index 0000000..150d501 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandKillAll.java @@ -0,0 +1,71 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.BossEntityManager; +import com.songoda.epicbosses.utils.Message; +import org.bukkit.Bukkit; +import org.bukkit.World; +import org.bukkit.command.CommandSender; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 02-Oct-18 + */ +public class CommandKillAll extends AbstractCommand { + + private BossEntityManager bossEntityManager; + + public CommandKillAll(BossEntityManager bossEntityManager) { + super(false, "killall"); + this.bossEntityManager = bossEntityManager; + } + + @Override + protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) { + World world = null; + + if (args.length == 1) { + String worldArgs = args[0]; + + world = Bukkit.getWorld(worldArgs); + + if (world == null) { + Message.Boss_KillAll_WorldNotFound.msg(sender); + return ReturnType.SUCCESS; + } + } + + int amount = this.bossEntityManager.killAllHolders(world); + + if (args.length == 1) Message.Boss_KillAll_KilledWorld.msg(sender, amount, world.getName()); + else Message.Boss_KillAll_KilledAll.msg(sender, amount); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Bukkit.getWorlds().stream().map(World::getName).collect(Collectors.toList()); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss killall [world]"; + } + + @Override + public String getDescription() { + return "Removes all current bosses in the specified world."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandList.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandList.java new file mode 100644 index 0000000..4ab1a00 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandList.java @@ -0,0 +1,49 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.BossPanelManager; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 02-Oct-18 + */ +public class CommandList extends AbstractCommand { + + private BossPanelManager bossPanelManager; + + public CommandList(BossPanelManager bossPanelManager) { + super(true, "list", "show"); + this.bossPanelManager = bossPanelManager; + } + + @Override + protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) { + this.bossPanelManager.getBosses().openFor((Player) sender); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss list"; + } + + @Override + public String getDescription() { + return "Shows all the list of current boss entities."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandMenu.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandMenu.java new file mode 100644 index 0000000..9da9e8f --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandMenu.java @@ -0,0 +1,49 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.BossPanelManager; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 10-Oct-18 + */ +public class CommandMenu extends AbstractCommand { + + private BossPanelManager bossPanelManager; + + public CommandMenu(BossPanelManager bossPanelManager) { + super(true, "menu"); + this.bossPanelManager = bossPanelManager; + } + + @Override + protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) { + this.bossPanelManager.getMainMenu().openFor((Player) sender); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "/boss menu"; + } + + @Override + public String getSyntax() { + return null; + } + + @Override + public String getDescription() { + return "Opens up the menu to edit all current created bosses."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNearby.java similarity index 52% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNearby.java index c28fa39..c36ee5f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNearby.java @@ -1,13 +1,17 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveBossHolder; -import com.songoda.epicbosses.utils.*; -import com.songoda.epicbosses.utils.command.SubCommand; +import com.songoda.epicbosses.utils.MapUtils; +import com.songoda.epicbosses.utils.Message; +import com.songoda.epicbosses.utils.NumberUtils; +import com.songoda.epicbosses.utils.StringUtils; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -17,42 +21,31 @@ import java.util.Map; * @version 1.0.0 * @since 02-Oct-18 */ -public class BossNearbyCmd extends SubCommand { +public class CommandNearby extends AbstractCommand { private EpicBosses plugin; - public BossNearbyCmd(EpicBosses plugin) { - super("nearby"); - + public CommandNearby(EpicBosses plugin) { + super(true, "nearby"); this.plugin = plugin; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.nearby.hasPermission(sender)) { - Message.Boss_Nearby_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - + protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) { Player player = (Player) sender; Location location = player.getLocation(); double radius = this.plugin.getConfig().getDouble("Settings.defaultNearbyRadius", 250.0); double maxRadius = this.plugin.getConfig().getDouble("Limits.maxNearbyRadius", 500.0); String nearbyFormat = this.plugin.getConfig().getString("Settings.nearbyFormat", "{name} ({distance}m)"); - if (args.length == 2) { - Integer newNumber = NumberUtils.get().getInteger(args[1]); + if (args.length == 1) { + Integer newNumber = NumberUtils.get().getInteger(args[0]); if (newNumber != null) radius = newNumber; if (radius > maxRadius) { Message.Boss_Nearby_MaxRadius.msg(player, maxRadius); - return; + return ReturnType.SUCCESS; } } @@ -61,15 +54,38 @@ public class BossNearbyCmd extends SubCommand { if (sortedMap.isEmpty()) { Message.Boss_Nearby_NoneNearby.msg(player); - return; + return ReturnType.FAILURE; } List input = new LinkedList<>(); - sortedMap.forEach(((activeBossHolder, distance) -> { - input.add(nearbyFormat.replace("{name}", activeBossHolder.getName()).replace("{distance}", NumberUtils.get().formatDouble(distance))); - })); + sortedMap.forEach(((activeBossHolder, distance) -> + input.add(nearbyFormat.replace("{name}", activeBossHolder.getName()).replace("{distance}", NumberUtils.get().formatDouble(distance))))); Message.Boss_Nearby_Near.msg(player, StringUtils.get().appendList(input)); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Arrays.asList("1", "2", "3", "4", "5"); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.nearby"; + } + + @Override + public String getSyntax() { + return "/boss nearby [radius]"; + } + + @Override + public String getDescription() { + return "Displays all nearby bosses within the specified radius."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewAutoSpawn.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewAutoSpawn.java new file mode 100644 index 0000000..3c54541 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewAutoSpawn.java @@ -0,0 +1,70 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.api.BossAPI; +import com.songoda.epicbosses.autospawns.AutoSpawn; +import com.songoda.epicbosses.managers.BossSkillManager; +import com.songoda.epicbosses.managers.files.AutoSpawnFileManager; +import com.songoda.epicbosses.managers.files.SkillsFileManager; +import com.songoda.epicbosses.skills.SkillMode; +import com.songoda.epicbosses.utils.Message; +import org.bukkit.command.CommandSender; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public class CommandNewAutoSpawn extends AbstractCommand { + + private AutoSpawnFileManager autoSpawnFileManager; + + public CommandNewAutoSpawn(AutoSpawnFileManager autoSpawnFileManager) { + super(false, " "); + this.autoSpawnFileManager = autoSpawnFileManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length != 1) + return ReturnType.SYNTAX_ERROR; + String nameInput = args[0]; + + if (this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) { + Message.Boss_New_AlreadyExists.msg(sender, "AutoSpawn"); + return ReturnType.FAILURE; + } + + AutoSpawn autoSpawn = BossAPI.createBaseAutoSpawn(nameInput); + + if (autoSpawn == null) { + Message.Boss_New_SomethingWentWrong.msg(sender, "AutoSpawn"); + } else { + Message.Boss_New_AutoSpawn.msg(sender, nameInput); + } + + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Collections.singletonList("name"); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss new autospawn "; + } + + @Override + public String getDescription() { + return "Create a new auto spawn section."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewCommand.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewCommand.java new file mode 100644 index 0000000..cfd2ce9 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewCommand.java @@ -0,0 +1,95 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.files.CommandsFileManager; +import com.songoda.epicbosses.utils.Message; +import org.bukkit.command.CommandSender; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class CommandNewCommand extends AbstractCommand { + + private CommandsFileManager commandsFileManager; + + public CommandNewCommand(CommandsFileManager commandsFileManager) { + super(false, "new command"); + this.commandsFileManager = commandsFileManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length < 2) + return ReturnType.SYNTAX_ERROR; + String nameInput = args[0]; + + if (this.commandsFileManager.getCommands(nameInput) != null) { + Message.Boss_New_AlreadyExists.msg(sender, "Command"); + return ReturnType.FAILURE; + } + + List commands = appendList(args); + + this.commandsFileManager.addNewCommand(nameInput, commands); + this.commandsFileManager.save(); + + Message.Boss_New_Command.msg(sender, nameInput); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Collections.singletonList("name"); + } + return Collections.singletonList("command"); + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss new command "; + } + + @Override + public String getDescription() { + return "Create a new command section."; + } + + private List appendList(String[] args) { + String[] params = Arrays.copyOfRange(args, 2, args.length); + + List sections = new ArrayList<>(); + StringBuilder currentSection = new StringBuilder(); + + for (String param : params) { + String[] split = param.split("\\|"); + if (split.length == 1) { + currentSection.append(split[0]).append(" "); + continue; + } + + boolean firstAdded = false; + for (String piece : split) { + currentSection.append(piece).append(" "); + + if (!firstAdded) { + sections.add(currentSection.toString().trim()); + currentSection = new StringBuilder(); + firstAdded = true; + } + } + } + + if (!currentSection.toString().trim().isEmpty()) + sections.add(currentSection.toString().trim()); + + return sections; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewDropTable.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewDropTable.java new file mode 100644 index 0000000..bd9be00 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewDropTable.java @@ -0,0 +1,90 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.api.BossAPI; +import com.songoda.epicbosses.droptable.DropTable; +import com.songoda.epicbosses.managers.BossDropTableManager; +import com.songoda.epicbosses.managers.BossSkillManager; +import com.songoda.epicbosses.managers.files.DropTableFileManager; +import com.songoda.epicbosses.managers.files.SkillsFileManager; +import com.songoda.epicbosses.skills.SkillMode; +import com.songoda.epicbosses.utils.Message; +import org.bukkit.command.CommandSender; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public class CommandNewDropTable extends AbstractCommand { + + private DropTableFileManager dropTableFileManager; + private BossDropTableManager bossDropTableManager; + + public CommandNewDropTable(DropTableFileManager dropTableFileManager, BossDropTableManager bossDropTableManager) { + super(false, "new droptable"); + this.dropTableFileManager = dropTableFileManager; + this.bossDropTableManager = bossDropTableManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length != 2) + return ReturnType.SYNTAX_ERROR; + + String nameInput = args[0]; + String typeInput = args[1]; + boolean validType = false; + + if (this.dropTableFileManager.getDropTable(nameInput) != null) { + Message.Boss_New_AlreadyExists.msg(sender, "DropTable"); + return ReturnType.FAILURE; + } + + for (String s : this.bossDropTableManager.getValidDropTableTypes()) { + if (s.equalsIgnoreCase(typeInput)) { + validType = true; + break; + } + } + + if (!validType) { + Message.Boss_New_InvalidDropTableType.msg(sender); + return ReturnType.FAILURE; + } + + DropTable dropTable = BossAPI.createBaseDropTable(nameInput, typeInput); + + if (dropTable == null) { + Message.Boss_New_SomethingWentWrong.msg(sender, "DropTable"); + } else { + Message.Boss_New_DropTable.msg(sender, nameInput, typeInput); + } + + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Collections.singletonList("name"); + } else if (args.length == 2) { + return this.bossDropTableManager.getValidDropTableTypes(); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss new droptable "; + } + + @Override + public String getDescription() { + return "Create a new drop table section."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewMessage.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewMessage.java new file mode 100644 index 0000000..51e3add --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewMessage.java @@ -0,0 +1,99 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.files.CommandsFileManager; +import com.songoda.epicbosses.managers.files.MessagesFileManager; +import com.songoda.epicbosses.utils.Message; +import org.bukkit.command.CommandSender; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class CommandNewMessage extends AbstractCommand { + + private CommandsFileManager commandsFileManager; + private MessagesFileManager messagesFileManager; + + public CommandNewMessage(CommandsFileManager commandsFileManager, MessagesFileManager messagesFileManager) { + super(false, "new message"); + this.commandsFileManager = commandsFileManager; + this.messagesFileManager = messagesFileManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length < 2) + return ReturnType.SYNTAX_ERROR; + + String nameInput = args[0]; + + if (this.commandsFileManager.getCommands(nameInput) != null) { + Message.Boss_New_AlreadyExists.msg(sender, "Message"); + return ReturnType.FAILURE; + } + + List messages = appendList(args); + + this.messagesFileManager.addNewMessage(nameInput, messages); + this.messagesFileManager.save(); + + Message.Boss_New_Message.msg(sender, nameInput); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Collections.singletonList("name"); + } + return Collections.singletonList("message"); + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss new message "; + } + + @Override + public String getDescription() { + return "Create a new message section."; + } + + private List appendList(String[] args) { + String[] params = Arrays.copyOfRange(args, 2, args.length); + + List sections = new ArrayList<>(); + StringBuilder currentSection = new StringBuilder(); + + for (String param : params) { + String[] split = param.split("\\|"); + if (split.length == 1) { + currentSection.append(split[0]).append(" "); + continue; + } + + boolean firstAdded = false; + for (String piece : split) { + currentSection.append(piece).append(" "); + + if (!firstAdded) { + sections.add(currentSection.toString().trim()); + currentSection = new StringBuilder(); + firstAdded = true; + } + } + } + + if (!currentSection.toString().trim().isEmpty()) + sections.add(currentSection.toString().trim()); + + return sections; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewSkill.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewSkill.java new file mode 100644 index 0000000..5ea1339 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNewSkill.java @@ -0,0 +1,104 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.EpicBosses; +import com.songoda.epicbosses.api.BossAPI; +import com.songoda.epicbosses.managers.BossSkillManager; +import com.songoda.epicbosses.managers.files.SkillsFileManager; +import com.songoda.epicbosses.skills.Skill; +import com.songoda.epicbosses.skills.SkillMode; +import com.songoda.epicbosses.utils.Message; +import org.bukkit.command.CommandSender; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public class CommandNewSkill extends AbstractCommand { + + private SkillsFileManager skillsFileManager; + private BossSkillManager bossSkillManager; + + public CommandNewSkill(SkillsFileManager skillsFileManager, BossSkillManager bossSkillManager) { + super(false, "new skill"); + this.skillsFileManager = skillsFileManager; + this.bossSkillManager = bossSkillManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length != 3) + return ReturnType.SYNTAX_ERROR; + String nameInput = args[0]; + String typeInput = args[1]; + String modeInput = args[2]; + boolean validType = false, validMode = false; + List skillModes = SkillMode.getSkillModes(); + + if (this.skillsFileManager.getSkill(nameInput) != null) { + Message.Boss_New_AlreadyExists.msg(sender, "Skill"); + return ReturnType.FAILURE; + } + + for (String s : this.bossSkillManager.getValidSkillTypes()) { + if (s.equalsIgnoreCase(typeInput)) { + validType = true; + break; + } + } + + for (SkillMode skillMode : skillModes) { + if (skillMode.name().equalsIgnoreCase(modeInput)) { + validMode = true; + break; + } + } + + if (!validType) { + Message.Boss_New_InvalidSkillType.msg(sender); + return ReturnType.FAILURE; + } + + if (!validMode) { + Message.Boss_New_InvalidSkillMode.msg(sender); + return ReturnType.FAILURE; + } + + Skill skill = BossAPI.createBaseSkill(nameInput, typeInput, modeInput); + + if (skill == null) { + Message.Boss_New_SomethingWentWrong.msg(sender, "Skill"); + } else { + Message.Boss_New_Skill.msg(sender, nameInput, typeInput); + } + + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return Collections.singletonList("name"); + } else if (args.length == 2) { + return this.bossSkillManager.getValidSkillTypes(); + } else if (args.length == 3) { + return SkillMode.getSkillModes().stream().map(SkillMode::name).collect(Collectors.toList()); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss new skill "; + } + + @Override + public String getDescription() { + return "Create a new skill section."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandReload.java similarity index 50% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandReload.java index 7d253a9..16c3c47 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossReloadCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandReload.java @@ -1,41 +1,57 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.managers.BossEntityManager; import com.songoda.epicbosses.utils.IReloadable; import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.World; import org.bukkit.command.CommandSender; +import java.util.List; + /** * @author Charles Cullen * @version 1.0.0 * @since 02-Oct-18 */ -public class BossReloadCmd extends SubCommand { +public class CommandReload extends AbstractCommand { private BossEntityManager bossEntityManager; private IReloadable masterReloadable; - public BossReloadCmd(IReloadable reloadable, BossEntityManager bossEntityManager) { - super("reload"); - + public CommandReload(IReloadable reloadable, BossEntityManager bossEntityManager) { + super(false, "reload"); this.masterReloadable = reloadable; this.bossEntityManager = bossEntityManager; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.reload.hasPermission(sender)) { - Message.Boss_Reload_NoPermission.msg(sender); - return; - } - + protected ReturnType runCommand(CommandSender sender, String... args) { long currentMs = System.currentTimeMillis(); this.masterReloadable.reload(); this.bossEntityManager.killAllHolders((World) null); Message.Boss_Reload_Successful.msg(sender, (System.currentTimeMillis() - currentMs)); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender sender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "boss.reload"; + } + + @Override + public String getSyntax() { + return "/boss reload"; + } + + @Override + public String getDescription() { + return "Reloads EpicBosses and its configurations."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandShop.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandShop.java new file mode 100644 index 0000000..12e3247 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandShop.java @@ -0,0 +1,56 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.EpicBosses; +import com.songoda.epicbosses.utils.Message; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 10-Oct-18 + */ +public class CommandShop extends AbstractCommand { + + private EpicBosses plugin; + + public CommandShop(EpicBosses plugin) { + super(true, "shop", "buy", "store"); + + this.plugin = plugin; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + if (!this.plugin.getConfig().getBoolean("Toggles.bossShop", true)) { + Message.Boss_Shop_Disabled.msg(sender); + return ReturnType.FAILURE; + } + + plugin.getBossPanelManager().getShopPanel().openFor((Player) sender); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "boss.shop"; + } + + @Override + public String getSyntax() { + return "/boss shop"; + } + + @Override + public String getDescription() { + return "Opens the shop for a player to purchase boss eggs themselves."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSkills.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSkills.java new file mode 100644 index 0000000..ad4fd90 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSkills.java @@ -0,0 +1,49 @@ +package com.songoda.epicbosses.commands; + +import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.managers.BossPanelManager; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 04-Oct-18 + */ +public class CommandSkills extends AbstractCommand { + + private BossPanelManager bossPanelManager; + + public CommandSkills(BossPanelManager bossPanelManager) { + super(true, "skills", "skill"); + this.bossPanelManager = bossPanelManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + this.bossPanelManager.getCustomSkills().openFor((Player) sender); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss skills"; + } + + @Override + public String getDescription() { + return "Shows all current configured skills."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSpawn.java similarity index 50% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSpawn.java index ebaa047..89ef65b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSpawn.java @@ -1,72 +1,94 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.command.SubCommand; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + /** * @author Charles Cullen * @version 1.0.0 * @since 02-Oct-18 */ -public class BossSpawnCmd extends SubCommand { +public class CommandSpawn extends AbstractCommand { private BossesFileManager bossesFileManager; - public BossSpawnCmd(BossesFileManager bossesFileManager) { - super("spawn"); + public CommandSpawn(BossesFileManager bossesFileManager) { + super(false, "spawn"); this.bossesFileManager = bossesFileManager; } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_Spawn_NoPermission.msg(sender); - return; - } - - if (args.length < 2) { - Message.Boss_Spawn_InvalidArgs.msg(sender); - return; - } + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length == 0) + return ReturnType.SYNTAX_ERROR; Location spawnLocation; - if (args.length == 3) { - Location input = StringUtils.get().fromStringToLocation(args[2]); + if (args.length == 2) { + Location input = StringUtils.get().fromStringToLocation(args[1]); if (input == null) { Message.Boss_Spawn_InvalidLocation.msg(sender); - return; + return ReturnType.FAILURE; } spawnLocation = input; } else { if (!(sender instanceof Player)) { Message.Boss_Spawn_MustBePlayer.msg(sender); - return; + return ReturnType.FAILURE; } spawnLocation = ((Player) sender).getLocation(); } - String bossInput = args[1]; + String bossInput = args[0]; BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); if (bossEntity == null) { Message.Boss_Spawn_InvalidBoss.msg(sender); - return; + return ReturnType.FAILURE; } BossAPI.spawnNewBoss(bossEntity, spawnLocation, null, null, false); Message.Boss_Spawn_Spawned.msg(sender, bossInput, StringUtils.get().translateLocation(spawnLocation)); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return new ArrayList<>(bossesFileManager.getBossEntitiesMap().keySet()); + } else if (args.length == 2) { + return Collections.singletonList("world,0,100,0"); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.admin"; + } + + @Override + public String getSyntax() { + return "/boss spawn [location]"; + } + + @Override + public String getDescription() { + return "Spawns a specific boss at the defined location."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandTime.java similarity index 67% rename from plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java rename to plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandTime.java index c76da7a..3b3c422 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossTimeCmd.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandTime.java @@ -1,17 +1,17 @@ -package com.songoda.epicbosses.commands.boss; +package com.songoda.epicbosses.commands; +import com.songoda.core.commands.AbstractCommand; import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveAutoSpawnHolder; import com.songoda.epicbosses.holder.autospawn.ActiveIntervalAutoSpawnHolder; import com.songoda.epicbosses.managers.AutoSpawnManager; import com.songoda.epicbosses.utils.Message; import com.songoda.epicbosses.utils.NumberUtils; -import com.songoda.epicbosses.utils.Permission; import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.command.SubCommand; import com.songoda.epicbosses.utils.time.TimeUnit; import org.bukkit.command.CommandSender; +import java.util.ArrayList; import java.util.List; /** @@ -19,35 +19,27 @@ import java.util.List; * @version 1.0.0 * @since 02-Oct-18 */ -public class BossTimeCmd extends SubCommand { +public class CommandTime extends AbstractCommand { private AutoSpawnManager autoSpawnManager; - public BossTimeCmd(EpicBosses plugin) { - super("time"); - + public CommandTime(EpicBosses plugin) { + super(false, "time"); this.autoSpawnManager = plugin.getAutoSpawnManager(); } @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.time.hasPermission(sender)) { - Message.Boss_Time_NoPermission.msg(sender); - return; - } + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length != 1) + return ReturnType.SYNTAX_ERROR; - if (args.length != 2) { - Message.Boss_Time_InvalidArgs.msg(sender); - return; - } - - String section = args[1]; + String section = args[0]; boolean exists = this.autoSpawnManager.exists(section); List currentActive = this.autoSpawnManager.getIntervalAutoSpawns(); if (!exists) { Message.Boss_Time_DoesntExist.msg(sender, StringUtils.get().appendList(currentActive)); - return; + return ReturnType.FAILURE; } ActiveAutoSpawnHolder activeAutoSpawnHolder = this.autoSpawnManager.getActiveAutoSpawnHolder(section); @@ -56,7 +48,7 @@ public class BossTimeCmd extends SubCommand { if (remainingMs == 0 && activeIntervalAutoSpawnHolder.isSpawnAfterLastBossIsKilled()) { Message.Boss_Time_CurrentlyActive.msg(sender); - return; + return ReturnType.FAILURE; } String s = Message.General_TimeLayout.toString(); @@ -72,5 +64,29 @@ public class BossTimeCmd extends SubCommand { s = s.replace("{sec}", NumberUtils.get().formatDouble(remainingSecs)); Message.Boss_Time_GetRemainingTime.msg(sender, s, section); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return new ArrayList<>(this.autoSpawnManager.getAutoSpawns().keySet()); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.time"; + } + + @Override + public String getSyntax() { + return "/boss time

"; + } + + @Override + public String getDescription() { + return "Shows the time left till next auto spawn."; } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java deleted file mode 100644 index 427641d..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDropTableCmd.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.managers.BossPanelManager; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 04-Oct-18 - */ -public class BossDropTableCmd extends SubCommand { - - private BossPanelManager bossPanelManager; - - public BossDropTableCmd(BossPanelManager bossPanelManager) { - super("droptable"); - - this.bossPanelManager = bossPanelManager; - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_DropTable_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - - Player player = (Player) sender; - - this.bossPanelManager.getDropTables().openFor(player); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java deleted file mode 100644 index f286afd..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossHelpCmd.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.EpicBosses; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.NumberUtils; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Oct-18 - */ -public class BossHelpCmd extends SubCommand { - - public BossHelpCmd() { - super("help"); - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (Permission.admin.hasPermission(sender) || Permission.help.hasPermission(sender)) { - int pageNumber = 0; - - if (args.length > 1) { - Integer newNumber = NumberUtils.get().getInteger(args[1]); - - if (newNumber != null) pageNumber = newNumber; - } - - switch (pageNumber) { - default: - case 1: - Message.Boss_Help_Page1.msg(sender); - break; - case 2: - Message.Boss_Help_Page2.msg(sender); - break; - case 3: - Message.Boss_Help_Page3.msg(sender); - break; - case 4: - Message.Boss_Help_Page4.msg(sender); - break; - } - - return; - } - - sender.sendMessage(StringUtils.get().translateColor("EpicBosses &7Version " + EpicBosses.getInstance().getDescription().getVersion() + " Created with <3 by &5&l&oSongoda")); - Message.Boss_Help_NoPermission.msg(sender); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java deleted file mode 100644 index 4535a9c..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossItemsCmd.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.managers.BossPanelManager; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 04-Oct-18 - */ -public class BossItemsCmd extends SubCommand { - - private BossPanelManager bossPanelManager; - - public BossItemsCmd(BossPanelManager bossPanelManager) { - super("item", "items"); - - this.bossPanelManager = bossPanelManager; - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_Items_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - - Player player = (Player) sender; - - this.bossPanelManager.getCustomItems().openFor(player); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java deleted file mode 100644 index 74df466..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossKillAllCmd.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.managers.BossEntityManager; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.Bukkit; -import org.bukkit.World; -import org.bukkit.command.CommandSender; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Oct-18 - */ -public class BossKillAllCmd extends SubCommand { - - private BossEntityManager bossEntityManager; - - public BossKillAllCmd(BossEntityManager bossEntityManager) { - super("killall"); - - this.bossEntityManager = bossEntityManager; - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_KillAll_NoPermission.msg(sender); - return; - } - - World world = null; - - if (args.length == 2) { - String worldArgs = args[1]; - - world = Bukkit.getWorld(worldArgs); - - if (world == null) { - Message.Boss_KillAll_WorldNotFound.msg(sender); - return; - } - } - - int amount = this.bossEntityManager.killAllHolders(world); - - if (args.length == 2) Message.Boss_KillAll_KilledWorld.msg(sender, amount, world.getName()); - else Message.Boss_KillAll_KilledAll.msg(sender, amount); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java deleted file mode 100644 index bca8f17..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossListCmd.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.managers.BossPanelManager; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Oct-18 - */ -public class BossListCmd extends SubCommand { - - private BossPanelManager bossPanelManager; - - public BossListCmd(BossPanelManager bossPanelManager) { - super("list", "show"); - - this.bossPanelManager = bossPanelManager; - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_List_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - - Player player = (Player) sender; - - this.bossPanelManager.getBosses().openFor(player); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java deleted file mode 100644 index bda711c..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossMenuCmd.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.managers.BossPanelManager; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 10-Oct-18 - */ -public class BossMenuCmd extends SubCommand { - - private BossPanelManager bossPanelManager; - - public BossMenuCmd(BossPanelManager bossPanelManager) { - super("menu"); - - this.bossPanelManager = bossPanelManager; - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_Menu_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - - Player player = (Player) sender; - - this.bossPanelManager.getMainMenu().openFor(player); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java deleted file mode 100644 index 9ebe925..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java +++ /dev/null @@ -1,243 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.EpicBosses; -import com.songoda.epicbosses.api.BossAPI; -import com.songoda.epicbosses.autospawns.AutoSpawn; -import com.songoda.epicbosses.droptable.DropTable; -import com.songoda.epicbosses.managers.BossDropTableManager; -import com.songoda.epicbosses.managers.BossSkillManager; -import com.songoda.epicbosses.managers.files.*; -import com.songoda.epicbosses.skills.Skill; -import com.songoda.epicbosses.skills.SkillMode; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 19-Nov-18 - *

- * boss new droptable [name] [type] - * boss new skill [name] [type] [mode] - * boss new command [name] [commands] - * boss new message [name] [message] - * boss new autospawn [name] - */ -public class BossNewCmd extends SubCommand { - - private AutoSpawnFileManager autoSpawnFileManager; - private DropTableFileManager dropTableFileManager; - private BossDropTableManager bossDropTableManager; - private MessagesFileManager messagesFileManager; - private CommandsFileManager commandsFileManager; - private SkillsFileManager skillsFileManager; - private BossSkillManager bossSkillManager; - - public BossNewCmd(EpicBosses plugin) { - super("new"); - - this.bossSkillManager = plugin.getBossSkillManager(); - this.skillsFileManager = plugin.getSkillsFileManager(); - this.dropTableFileManager = plugin.getDropTableFileManager(); - this.bossDropTableManager = plugin.getBossDropTableManager(); - this.messagesFileManager = plugin.getBossMessagesFileManager(); - this.commandsFileManager = plugin.getBossCommandFileManager(); - this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_New_NoPermission.msg(sender); - return; - } - - //-------------------- - // A U T O S P A W N - //-------------------- - if (args.length == 3 && args[1].equalsIgnoreCase("autospawn")) { - String nameInput = args[2]; - - if (this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) { - Message.Boss_New_AlreadyExists.msg(sender, "AutoSpawn"); - return; - } - - AutoSpawn autoSpawn = BossAPI.createBaseAutoSpawn(nameInput); - - if (autoSpawn == null) { - Message.Boss_New_SomethingWentWrong.msg(sender, "AutoSpawn"); - } else { - Message.Boss_New_AutoSpawn.msg(sender, nameInput); - } - - return; - } - - - //------------------- - // C O M M A N D - //------------------- - if (args.length >= 4 && args[1].equalsIgnoreCase("command")) { - String nameInput = args[2]; - - if (this.commandsFileManager.getCommands(nameInput) != null) { - Message.Boss_New_AlreadyExists.msg(sender, "Command"); - return; - } - - List commands = appendList(args); - - this.commandsFileManager.addNewCommand(nameInput, commands); - this.commandsFileManager.save(); - - Message.Boss_New_Command.msg(sender, nameInput); - return; - } - - //------------------- - // M E S S A G E - //------------------- - if (args.length >= 4 && args[1].equalsIgnoreCase("message")) { - String nameInput = args[2]; - - if (this.commandsFileManager.getCommands(nameInput) != null) { - Message.Boss_New_AlreadyExists.msg(sender, "Message"); - return; - } - - List messages = appendList(args); - - this.messagesFileManager.addNewMessage(nameInput, messages); - this.messagesFileManager.save(); - - Message.Boss_New_Message.msg(sender, nameInput); - return; - } - - //---------------------- - // D R O P T A B L E - //---------------------- - if (args.length == 4 && args[1].equalsIgnoreCase("droptable")) { - String nameInput = args[2]; - String typeInput = args[3]; - boolean validType = false; - - if (this.dropTableFileManager.getDropTable(nameInput) != null) { - Message.Boss_New_AlreadyExists.msg(sender, "DropTable"); - return; - } - - for (String s : this.bossDropTableManager.getValidDropTableTypes()) { - if (s.equalsIgnoreCase(typeInput)) { - validType = true; - break; - } - } - - if (!validType) { - Message.Boss_New_InvalidDropTableType.msg(sender); - return; - } - - DropTable dropTable = BossAPI.createBaseDropTable(nameInput, typeInput); - - if (dropTable == null) { - Message.Boss_New_SomethingWentWrong.msg(sender, "DropTable"); - } else { - Message.Boss_New_DropTable.msg(sender, nameInput, typeInput); - } - - return; - } - - //------------------- - // S K I L L - //------------------- - if (args.length == 5 && args[1].equalsIgnoreCase("skill")) { - String nameInput = args[2]; - String typeInput = args[3]; - String modeInput = args[4]; - boolean validType = false, validMode = false; - List skillModes = SkillMode.getSkillModes(); - - if (this.skillsFileManager.getSkill(nameInput) != null) { - Message.Boss_New_AlreadyExists.msg(sender, "Skill"); - return; - } - - for (String s : this.bossSkillManager.getValidSkillTypes()) { - if (s.equalsIgnoreCase(typeInput)) { - validType = true; - break; - } - } - - for (SkillMode skillMode : skillModes) { - if (skillMode.name().equalsIgnoreCase(modeInput)) { - validMode = true; - break; - } - } - - if (!validType) { - Message.Boss_New_InvalidSkillType.msg(sender); - return; - } - - if (!validMode) { - Message.Boss_New_InvalidSkillMode.msg(sender); - return; - } - - Skill skill = BossAPI.createBaseSkill(nameInput, typeInput, modeInput); - - if (skill == null) { - Message.Boss_New_SomethingWentWrong.msg(sender, "Skill"); - } else { - Message.Boss_New_Skill.msg(sender, nameInput, typeInput); - } - - return; - } - - Message.Boss_New_InvalidArgs.msg(sender); - } - - private List appendList(String[] args) { - String[] params = Arrays.copyOfRange(args, 3, args.length); - - List sections = new ArrayList<>(); - StringBuilder currentSection = new StringBuilder(); - - for (String param : params) { - String[] split = param.split("\\|"); - if (split.length == 1) { - currentSection.append(split[0]).append(" "); - continue; - } - - boolean firstAdded = false; - for (String piece : split) { - currentSection.append(piece).append(" "); - - if (!firstAdded) { - sections.add(currentSection.toString().trim()); - currentSection = new StringBuilder(); - firstAdded = true; - } - } - } - - if (!currentSection.toString().trim().isEmpty()) - sections.add(currentSection.toString().trim()); - - return sections; - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java deleted file mode 100644 index 45bd6bc..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossShopCmd.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.EpicBosses; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 10-Oct-18 - */ -public class BossShopCmd extends SubCommand { - - private EpicBosses plugin; - - public BossShopCmd(EpicBosses plugin) { - super("shop", "buy", "store"); - - this.plugin = plugin; - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.shop.hasPermission(sender)) { - Message.Boss_Shop_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - - if (!this.plugin.getConfig().getBoolean("Toggles.bossShop", true)) { - Message.Boss_Shop_Disabled.msg(sender); - return; - } - - Player player = (Player) sender; - - plugin.getBossPanelManager().getShopPanel().openFor(player); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java deleted file mode 100644 index 2f237f9..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSkillsCmd.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.managers.BossPanelManager; -import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.Permission; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 04-Oct-18 - */ -public class BossSkillsCmd extends SubCommand { - - private BossPanelManager bossPanelManager; - - public BossSkillsCmd(BossPanelManager bossPanelManager) { - super("skills", "skill"); - - this.bossPanelManager = bossPanelManager; - } - - @Override - public void execute(CommandSender sender, String[] args) { - if (!Permission.admin.hasPermission(sender)) { - Message.Boss_Skills_NoPermission.msg(sender); - return; - } - - if (!(sender instanceof Player)) { - Message.General_MustBePlayer.msg(sender); - return; - } - - Player player = (Player) sender; - - this.bossPanelManager.getCustomSkills().openFor(player); - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java index d0317a8..b83b490 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/AutoSpawnManager.java @@ -11,10 +11,7 @@ import com.songoda.epicbosses.skills.interfaces.ICustomSettingAction; import com.songoda.epicbosses.utils.panel.base.ClickAction; import org.bukkit.inventory.ItemStack; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @author Charles Cullen @@ -67,6 +64,9 @@ public class AutoSpawnManager { return intervalAutoSpawns; } + public Map getAutoSpawns() { + return Collections.unmodifiableMap(this.activeAutoSpawnHolders); + } public boolean exists(String name) { List keyList = new ArrayList<>(this.activeAutoSpawnHolders.keySet()); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java deleted file mode 100644 index 17cc8c4..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossCommandManager.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.songoda.epicbosses.managers; - -import com.songoda.epicbosses.EpicBosses; -import com.songoda.epicbosses.commands.boss.*; -import com.songoda.epicbosses.utils.Debug; -import com.songoda.epicbosses.utils.ILoadable; -import com.songoda.epicbosses.utils.command.SubCommandService; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Oct-18 - */ -public class BossCommandManager implements ILoadable { - - private SubCommandService commandService; - private boolean hasBeenLoaded = false; - private EpicBosses epicBosses; - - public BossCommandManager(SubCommandService commandService, EpicBosses epicBosses) { - this.commandService = commandService; - this.epicBosses = epicBosses; - } - - @Override - public void load() { - if (this.hasBeenLoaded) { - Debug.FAILED_TO_LOAD_BOSSCOMMANDMANAGER.debug(); - return; - } - - this.commandService.registerSubCommand(new BossCreateCmd(this.epicBosses.getBossEntityContainer())); - this.commandService.registerSubCommand(new BossDebugCmd(this.epicBosses.getDebugManager())); - this.commandService.registerSubCommand(new BossDropTableCmd(this.epicBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossEditCmd(this.epicBosses.getBossPanelManager(), this.epicBosses.getBossEntityContainer())); - this.commandService.registerSubCommand(new BossGiveEggCmd(this.epicBosses.getBossesFileManager(), this.epicBosses.getBossEntityManager())); - this.commandService.registerSubCommand(new BossHelpCmd()); - this.commandService.registerSubCommand(new BossInfoCmd(this.epicBosses.getBossesFileManager(), this.epicBosses.getBossEntityManager())); - this.commandService.registerSubCommand(new BossItemsCmd(this.epicBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossKillAllCmd(this.epicBosses.getBossEntityManager())); - this.commandService.registerSubCommand(new BossListCmd(this.epicBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossMenuCmd(this.epicBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossNearbyCmd(this.epicBosses)); - this.commandService.registerSubCommand(new BossNewCmd(this.epicBosses)); - this.commandService.registerSubCommand(new BossReloadCmd(this.epicBosses, this.epicBosses.getBossEntityManager())); - this.commandService.registerSubCommand(new BossShopCmd(this.epicBosses)); - this.commandService.registerSubCommand(new BossSkillsCmd(this.epicBosses.getBossPanelManager())); - this.commandService.registerSubCommand(new BossSpawnCmd(this.epicBosses.getBossesFileManager())); - this.commandService.registerSubCommand(new BossTimeCmd(this.epicBosses)); - - this.hasBeenLoaded = true; - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java index f42a018..9275a71 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Message.java @@ -16,7 +16,6 @@ import org.bukkit.inventory.ItemStack; public enum Message { General_LocationFormat("{world}, {x}, {y}, {z}"), - General_MustBePlayer("&c&l(!) &cYou must be a player to use this command."), General_NotOnline("&c&l(!) &cThe specified player, {0}, is not online or a valid player."), General_CannotSpawn("&c&l(!) &cYou cannot spawn a boss at this location! &c&l(!)"), General_NotNumber("&c&l(!) &cThe number you have provided is not a proper number."), @@ -36,14 +35,11 @@ public enum Message { Boss_Create_InvalidArgs("&c&l(!) &cYou must use &n/boss create [name] [entity] &c to create a boss."), Boss_Create_NameAlreadyExists("&c&l(!) &cA boss already exists with the name {0}."), Boss_Create_NoEntitySpecified("&c&l(!) &cNo entity type was specified. Make sure to add an entity type! Possible entity types are: \n&7{0}"), - Boss_Create_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Create_SomethingWentWrong("&c&l(!) &cSomething went wrong in the API class while finalising the boss creation."), Boss_Create_SuccessfullyCreated("&b&lEpicBosses &8» &7A boss has successfully been created with the name &f{0}&7 and the entity type &f{1}&7."), - Boss_Debug_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Debug_Toggled("&b&lEpicBosses &8» &7You have toggled debug mode for &fEpicBosses &7to {0}."), - Boss_DropTable_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_DropTable_AddedNewReward("&b&lEpicBosses &8» &7You have added a new reward to the drop table &f{0}&7. Now opening the editing panel for the new reward."), Boss_DropTable_RewardChance("&b&lEpicBosses &8» &7You have {0} the chance for the reward section for &f{1}&7 to &f{2}%&7."), Boss_DropTable_RewardRemoved("&b&lEpicBosses &8» &7You have removed the reward section from the drop table."), @@ -59,7 +55,6 @@ public enum Message { Boss_DropTable_GiveMaxCommands("&b&lEpicBosses &8» &7You have {0} the max commands for the &f{1}&7 damage section to &f{1}&7."), Boss_DropTable_GiveRequiredPercentage("&b&lEpicBosses &8» &7You have {0} the required percentage for the &f{1}&7 damage section to &f{1}&7."), - Boss_Edit_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Edit_ItemStackHolderNull("&c&l(!) &cThe itemstack name that is provided for the spawn item doesn't exist or wasn't found."), Boss_Edit_CannotSpawn("&c&l(!) &cYou cannot spawn this boss while editing is enabled. If you think this is a mistake please contact an administrator to disable the editing of the boss."), Boss_Edit_CannotBeModified("&c&l(!) &cYou cannot modify this aspect because you do not have editing mode enabled on this boss."), @@ -69,62 +64,12 @@ public enum Message { Boss_Edit_Price("&b&lEpicBosses &8» &7Please input the new price of the &f{0}&7 Boss Entity. Please do not add commas and only use numbers. To cancel this input in to chat &f- &7."), Boss_Edit_PriceSet("&b&lEpicBosses &8» &7You have set the price of &f{0}&7 to &a$&f{1}&7."), - Boss_GiveEgg_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_GiveEgg_InvalidArgs("&c&l(!) &cYou must use &n/boss giveegg [name] [player] (amount)&c to give an egg."), Boss_GiveEgg_InvalidBoss("&c&l(!) &cThe specified boss is not a valid type."), Boss_GiveEgg_NotSet("&c&l(!) &cThe spawn item for the {0} boss has not been set yet."), Boss_GiveEgg_Given("&b&lEpicBosses &8» &7You have given {0} {1}x {2}'s boss spawn item."), Boss_GiveEgg_Received("&b&lEpicBosses &8» &7You have received {0}x {1} boss spawn item(s)."), - Boss_Help_NoPermission("&c&l(!) &cYou do not have access to this command."), - Boss_Help_Page1( - "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 1/4) &3&l]&8&m--------*----\n" + - "&b/boss help (page) &8» &7Displays boss commands.\n" + - "&b/boss create [name] [entity] &8» &7Start the creation of a boss.\n" + - "&b/boss edit (name) &8» &7Edit the specified boss.\n" + - "&b/boss info [name] &8» &7Shows information on the specified boss.\n" + - "&b/boss nearby (radius) &8» &7Shows the nearby bosses.\n" + - "&b/boss reload &8» &7Reloads the boss plugin.\n" + - "&7\n" + - "&7Use /boss help 2 to view the next page.\n" + - "&8&m----*-----------------------------------*----"), - Boss_Help_Page2( - "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 2/4) &3&l]&8&m--------*----\n" + - "&b/boss spawn [name] (location) &8» &7Spawns a boss at your" + - " location or the specified location.\n" + - "&7&o(Separate location with commas, an example is: world,0,100,0)\n" + - "&b/boss droptable &8» &7Shows all current drop tables.\n" + - "&b/boss items &8» &7Shows all current custom items.\n" + - "&b/boss skills &8» &7Shows all current set skills.\n" + - "&b/boss killall (world) &8» &7Kills all bosses/minions.\n" + - "&7\n" + - "&7Use /boss help 3 to view the next page.\n" + - "&8&m----*-----------------------------------*----"), - Boss_Help_Page3( - "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 3/4) &3&l]&8&m--------*----\n" + - "&b/boss time [section] &8» &7Shows the time left till next auto spawn.\n" + - "&b/boss giveegg [name] [player] (amount) &8» &7Used to be given a " + - "spawn item of the boss.\n" + - "&b/boss list &8» &7Shows all the list of current boss entities.\n" + - "&b/boss new skill [name] [type] [mode] &8» &7Create a new skill section.\n" + - "&b/boss new droptable [name] [type] &8» &7Create a new drop table section.\n" + - "&7\n" + - "&7Use /boss help 4 to view the next page.\n" + - "&8&m----*-----------------------------------*----"), - Boss_Help_Page4( - "&8&m----*--------&3&l[ &b&lBoss Help &7(Page 4/4) &3&l]&8&m--------*----\n" + - "&b/boss new command [name] [commands] &8» &7Used to create a new command section.\n" + - "&7&o(To add a new line use &7||&7&o in-between the messages.)\n" + - "&b/boss new message [name] [messages] &8» &7Used to create a new message section.\n" + - "&7&o(To add a new line use &7||&7&o in-between the messages.)\n" + - "&7/boss new autospawn [name] &8» &7Used to create a new auto spawn section.\n" + - "&b/boss debug &8» &7Used to toggle the debug aspect of the plugin.\n" + - "&7\n" + - "&7\n" + - "&7Use /boss help [page] to view the next page.\n" + - "&8&m----*-----------------------------------*----"), - - Boss_Info_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Info_InvalidArgs("&c&l(!) &cYou must use &n/boss info [name]&c to view info on a boss."), Boss_Info_CouldntFindBoss("&c&l(!) &cThe specified boss was not able to be retrieved, please try again."), Boss_Info_Display( @@ -133,7 +78,6 @@ public enum Message { "&bCurrently Active: &f{2}\n" + "&bComplete enough to spawn: &f{3}"), - Boss_Items_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Items_CannotBeRemoved("&c&l(!) &cThe selected item cannot be removed because it is still used in {0} different positions on the bosses."), Boss_Items_DefaultCannotBeRemoved("&c&l(!) &cThe selected item cannot be removed because it is the default item for something in one of the boss menu's."), Boss_Items_Removed("&b&lEpicBosses &8» &7The selected item has been removed from the EpicBosses custom items database."), @@ -144,11 +88,6 @@ public enum Message { Boss_KillAll_WorldNotFound("&c&l(!) &cThe specified world was not found. If you'd like to kill every boss/minion just use &f/boss killall&c without any arguments."), Boss_KillAll_KilledAll("&b&lEpicBosses &8» &7You have killed the boss(es) and minion(s) that were currently active on the server."), Boss_KillAll_KilledWorld("&b&lEpicBosses &8» &7You have killed the boss(es) and minion(s) that were in the world {1}."), - Boss_KillAll_NoPermission("&c&l(!) &cYou do not have access to this command."), - - Boss_List_NoPermission("&c&l(!) &cYou do not have access to this command."), - - Boss_Menu_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Messages_SetRadiusOnSpawn("&b&lEpicBosses &8» &7You have just {0} the radius for the onSpawn message to &f{1}&7."), Boss_Messages_SetRadiusOnDeath("&b&lEpicBosses &8» &7You have just {0} the radius for the onDeath message to &f{1}&7."), @@ -156,13 +95,10 @@ public enum Message { Boss_Messages_SetTauntRadius("&b&lEpicBosses &8» &7You have just {0} the radius for the taunt message to &f{1}&7."), Boss_Messages_SetTauntDelay("&b&lEpicBosses &8» &7You have just {0} the delay for the taunt message to &f{1}&7."), - Boss_Nearby_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Nearby_MaxRadius("&c&l(!) &cYou cannot check for bosses any further then &f{0}&c away from your position."), Boss_Nearby_NoneNearby("&b&lEpicBosses &8» &7There is currently no nearby bosses."), Boss_Nearby_Near("&b&lEpicBosses &8» &7Nearby bosses: &f{0}."), - Boss_New_NoPermission("&c&l(!) &cYou do not have access to this command."), - Boss_New_InvalidArgs("&c&l(!) &cInvalid arguments! You must use &n/boss new droptable [name] (type)&c or &n/boss new skill [name]&c!"), Boss_New_CreateArgumentsDropTable("&b&lEpicBosses &8» &7Create a new droptable with the command &f/boss new droptable [name] [type]&7."), Boss_New_CreateArgumentsSkill("&b&lEpicBosses &8» &7Create a new skill with the command &f/boss new skill [name] [type] [mode]&7."), Boss_New_CreateArgumentsMessage("&b&lEpicBosses &8» &7Create a new message with the command &f/boss new message [name] [message(s)]. \n&7&oUse &f|| &7&oto reference a new line."), @@ -179,15 +115,12 @@ public enum Message { Boss_New_Message("&b&lEpicBosses &8» &7You have created a new message with the name &f{0}&7."), Boss_New_SomethingWentWrong("&c&l(!) &cSomething went wrong while trying to create a new &f{0}&c."), - Boss_Reload_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Reload_Successful("&b&lEpicBosses &8» &7All boss data has been reloaded. The process took &f{0}ms&7."), Boss_Shop_Disabled("&c&l(!) &cThe boss shop is currently disabled."), - Boss_Shop_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Shop_NotEnoughBalance("&c&l(!) &cYou do not have enough money to make this purchase! You need &a$&f{0}&c."), Boss_Shop_Purchased("&b&lEpicBosses &8» &7You have purchased &f1x {0}&7."), - Boss_Skills_NoPermission("&c&l(!) &cYou do not have access to this command."), Boss_Skills_SetChance("&b&lEpicBosses &8» &7You have {0} the overall chance for the skill map to &f{1}%&7."), Boss_Skills_SetMultiplier("&b&lEpicBosses &8» &7You have {0} the multiplier to &f{1}&7."), Boss_Skills_SetRadius("&b&lEpicBosses &8» &7You have {0} the radius for the skill to &f{1}&7."), @@ -197,8 +130,6 @@ public enum Message { Boss_Skills_SetCommandChance("&b&lEpicBosses &8» &7You have {0} the chance for the command skill to &f{1}%&7."), Boss_Skills_SetMinionAmount("&b&lEpicBosses &8» &7You have {0} the amount of minions to spawn from this skill to &f{1}&7."), - Boss_Spawn_NoPermission("&c&l(!) &cYou do not have access to this command."), - Boss_Spawn_InvalidArgs("&c&l(!) &cYou must use &n/boss spawn [name] (location)&c to spawn a boss."), Boss_Spawn_InvalidLocation("&c&l(!) &cThe location string you have entered is not a valid location string. A valid location string should look like this: &fworld,100,65,100"), Boss_Spawn_MustBePlayer("&c&l(!) &cTo use this command without an input of location you must be a player."), Boss_Spawn_InvalidBoss("&c&l(!) &cThe specified boss is not a valid type."), @@ -208,8 +139,6 @@ public enum Message { Boss_Statistics_SetDisplayName("&b&lEpicBosses &8» &7Your next input in to chat will be the display name for the entity. If you enter &f-&7 it will remove/clear the display name of the entity. For color codes use the &f& &7sign."), Boss_Statistics_SetEntityFinder("&b&lEpicBosses &8» &7You have selected &f{0}&7 as the entity type for the boss."), - Boss_Time_NoPermission("&c&l(!) &cYou do not have access to this command."), - Boss_Time_InvalidArgs("&c&l(!) &cYou must use &n/boss time [section]&c to check the time left on a boss spawn."), Boss_Time_DoesntExist("&c&l(!) &cThe specified interval spawn system doesn't exist or editing has been toggled on so the section isn't ticking at the moment. Please use one of the following active system names: &f{0}&c."), Boss_Time_CurrentlyActive("&b&lEpicBosses &8» &7There is currently a boss spawned from this section so the countdown will not begin for the next to spawn until the last boss is killed."), Boss_Time_GetRemainingTime("&b&lEpicBosses &8» &7There is currently &f{0}&7 remaining on the &f{1}&7 interval spawn system."); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java deleted file mode 100644 index c426eba..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.songoda.epicbosses.utils.command; - -import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.command.attributes.*; -import org.bukkit.Bukkit; -import org.bukkit.command.CommandMap; -import org.bukkit.command.CommandSender; -import org.bukkit.command.defaults.BukkitCommand; - -import java.lang.reflect.Field; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.Arrays; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 28-Apr-18 - */ -public abstract class CommandService extends BukkitCommand { - - private static CommandMap _commandMap = null; - - private String permission, noPermissionMsg; - private String command, description; - private Class parameterClass; - private String[] aliases; - - public CommandService(Class cmd) { - super(cmd.getAnnotation(Name.class).value()); - - this.command = cmd.getAnnotation(Name.class).value(); - this.description = cmd.getAnnotation(Description.class).value(); - this.aliases = new String[]{}; - - if (cmd.isAnnotationPresent(Alias.class)) - this.aliases = cmd.getAnnotation(Alias.class).value(); - - if (cmd.isAnnotationPresent(Permission.class)) - this.permission = cmd.getAnnotation(Permission.class).value(); - - if (cmd.isAnnotationPresent(NoPermission.class)) - this.noPermissionMsg = cmd.getAnnotation(NoPermission.class).value(); - - getGenericClass(); - register(); - } - - @Override - public final boolean execute(CommandSender commandSender, String s, String[] args) { - if (this.permission != null && !testPermission(commandSender)) return false; - - - if (!parameterClass.isInstance(commandSender)) { - commandSender.sendMessage(StringUtils.get().translateColor("&4You cannot use that command.")); - return false; - } - - execute(parameterClass.cast(commandSender), args); - return true; - } - - public abstract void execute(T sender, String[] args); - - public String getCommand() { - return this.command; - } - - public String[] getArrayAliases() { - return this.aliases; - } - - @Override - public String getDescription() { - return this.description; - } - - private void register() { - if (_commandMap != null) { - setFields(); - _commandMap.register(command, this); - return; - } - - try { - Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap"); - field.setAccessible(true); - _commandMap = (CommandMap) field.get(Bukkit.getServer()); - - setFields(); - - _commandMap.register(command, this); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void setFields() { - if (this.aliases != null) setAliases(Arrays.asList(this.aliases)); - if (this.description != null) setDescription(this.description); - if (this.permission != null) setPermission(this.permission); - if (this.noPermissionMsg != null) setPermissionMessage(this.noPermissionMsg); - } - - private void getGenericClass() { - if (this.parameterClass == null) { - Type superClass = getClass().getGenericSuperclass(); - Type tType = ((ParameterizedType) superClass).getActualTypeArguments()[0]; - String className = tType.toString().split(" ")[1]; - try { - this.parameterClass = (Class) Class.forName(className); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - } - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/ISubCommandHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/ISubCommandHandler.java deleted file mode 100644 index 57dde25..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/ISubCommandHandler.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.songoda.epicbosses.utils.command; - -import org.bukkit.command.CommandSender; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 28-Apr-18 - */ -public interface ISubCommandHandler { - - void registerSubCommand(SubCommand subCommand); - - boolean handleSubCommand(CommandSender commandSender, String[] args); - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommand.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommand.java deleted file mode 100644 index 7b23e6a..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.songoda.epicbosses.utils.command; - -import org.bukkit.command.CommandSender; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 28-Apr-18 - */ -public abstract class SubCommand { - - private List aliases = new ArrayList<>(); - private String subCommand; - - public SubCommand(String subCommand) { - this.subCommand = subCommand; - } - - public SubCommand(String subCommand, String... subCommands) { - this(subCommand); - - this.aliases.addAll(Arrays.asList(subCommands)); - } - - public String getSubCommand() { - return this.subCommand; - } - - public List getAliases() { - return this.aliases; - } - - public boolean isSubCommand(String input) { - input = input.toLowerCase(); - - return (input.equals(this.subCommand) || this.aliases.contains(input)); - } - - public abstract void execute(CommandSender sender, String[] args); - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java deleted file mode 100644 index a6b56fc..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/SubCommandService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.songoda.epicbosses.utils.command; - -import org.bukkit.command.CommandSender; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 28-Apr-18 - */ -public abstract class SubCommandService extends CommandService implements ISubCommandHandler { - - private List subCommands = new ArrayList<>(); - - public SubCommandService(Class cmd) { - super(cmd); - } - - @Override - public void registerSubCommand(SubCommand subCommand) { - this.subCommands.add(subCommand); - } - - @Override - public boolean handleSubCommand(CommandSender commandSender, String[] args) { - for (SubCommand subCommand : this.subCommands) { - if (subCommand.isSubCommand(args[0])) { - subCommand.execute(commandSender, args); - return true; - } - } - - return false; - } -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java deleted file mode 100644 index 7439d71..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Alias.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.songoda.epicbosses.utils.command.attributes; - -import java.lang.annotation.*; - -/** - * Created by charl on 03-May-17. - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Alias { - - String[] value(); - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java deleted file mode 100644 index 50624d7..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Description.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.songoda.epicbosses.utils.command.attributes; - -import java.lang.annotation.*; - -/** - * Created by charl on 03-May-17. - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Description { - - String value(); - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java deleted file mode 100644 index 8e3d160..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Name.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.songoda.epicbosses.utils.command.attributes; - -import java.lang.annotation.*; - -/** - * Created by LukeBingham on 03/04/2017. - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Name { - - String value(); - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java deleted file mode 100644 index b172470..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/NoPermission.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.songoda.epicbosses.utils.command.attributes; - -import java.lang.annotation.*; - -/** - * @author AMinecraftDev - * @version 1.0.0 - * @since 08-Jun-17 - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface NoPermission { - - String value(); - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java deleted file mode 100644 index 636f120..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Permission.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.songoda.epicbosses.utils.command.attributes; - -import java.lang.annotation.*; - -/** - * Created by charl on 11-May-17. - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Permission { - - String value(); - -} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java deleted file mode 100644 index ec41fed..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/attributes/Suggest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.songoda.epicbosses.utils.command.attributes; - -import java.lang.annotation.*; - -/** - * Created by LukeBingham on 03/04/2017. - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Suggest { - - String value(); - -} From 8795e22ebae264358237e9ac6e88a6b74f488df6 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 21:56:52 -0400 Subject: [PATCH 07/16] Fixed async error effecting 1.13+ --- .../epicbosses/targeting/TargetHandler.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java index 5208440..e25d1b3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/targeting/TargetHandler.java @@ -1,8 +1,10 @@ package com.songoda.epicbosses.targeting; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.IActiveHolder; import com.songoda.epicbosses.managers.BossTargetManager; import com.songoda.epicbosses.utils.ServerUtils; +import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; @@ -46,31 +48,30 @@ public abstract class TargetHandler implements ITa } private void updateTarget() { - LivingEntity boss = getBossEntity(); - double radius = this.bossTargetManager.getTargetRadius(); + Bukkit.getScheduler().runTask(EpicBosses.getInstance(), () -> { + LivingEntity boss = getBossEntity(); + double radius = this.bossTargetManager.getTargetRadius(); - if (boss == null) return; + if (boss == null) return; - List nearbyEntities = new ArrayList<>(); - List nearbyBossEntities = boss.getNearbyEntities(radius, radius, radius); + List nearbyEntities = new ArrayList<>(); + List nearbyBossEntities = boss.getNearbyEntities(radius, radius, radius); - if (nearbyBossEntities == null) return; - for (Entity entity : nearbyBossEntities) { - if (!(entity instanceof Player)) continue; + for (Entity entity : nearbyBossEntities) { + if (!(entity instanceof Player)) continue; - LivingEntity livingEntity = (LivingEntity) entity; + LivingEntity livingEntity = (LivingEntity) entity; - if (livingEntity instanceof Player) { Player player = (Player) livingEntity; if (player.getGameMode() == GameMode.SPECTATOR || player.getGameMode() == GameMode.CREATIVE) continue; + + nearbyEntities.add(livingEntity); } - nearbyEntities.add(livingEntity); - } - - updateBoss(selectTarget(nearbyEntities)); + updateBoss(selectTarget(nearbyEntities)); + }); } private void updateBoss(LivingEntity newTarget) { From 67c52aee04f8410f47e4b31f65003efd4dee9347 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 23:04:32 -0400 Subject: [PATCH 08/16] Fix for items now appearing on older versions. --- .../epicbosses/utils/file/YmlFileHandler.java | 2 -- .../itemstack/ItemStackHolderConverter.java | 8 +++++- .../utils/itemstack/ItemStackUtils.java | 25 +++++++++++-------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java index 4702273..cfc0047 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java @@ -28,8 +28,6 @@ public class YmlFileHandler implements IFileHandler { if (!this.file.exists()) { if (this.saveResource) { String name = this.file.getName(); - - System.out.println(name); javaPlugin.saveResource(name, false); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java index 6e8b0d8..314574d 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackHolderConverter.java @@ -4,6 +4,7 @@ import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.epicbosses.utils.IConverter; import com.songoda.epicbosses.utils.exceptions.NotImplementedException; import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder; +import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import java.util.List; @@ -21,8 +22,13 @@ public class ItemStackHolderConverter implements IConverter lore = (List) configurationSection.getList("lore", null); List enchants = (List) configurationSection.getList("enchants", null); diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java index 848780e..76ad18e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackUtils.java @@ -113,11 +113,16 @@ public class ItemStackUtils { } public static ItemStack createItemStack(ConfigurationSection configurationSection, int amount, Map replacedMap) { - String type = configurationSection.getString("type"); + + CompatibleMaterial material = CompatibleMaterial.getMaterial(configurationSection.getString("type")); + + String type = material.getMaterial().name(); String name = configurationSection.getString("name"); List lore = configurationSection.getStringList("lore"); List enchants = configurationSection.getStringList("enchants"); - short durability = (short) configurationSection.getInt("durability"); + Short durability = (Short) configurationSection.get("durability"); + if (material.getData() != -1) durability = (short) material.getData(); + String owner = configurationSection.getString("owner"); Map map = new HashMap<>(); List newLore = new ArrayList<>(); @@ -215,12 +220,8 @@ public class ItemStackUtils { if (!map.isEmpty()) { itemStack.addUnsafeEnchantments(map); } - if (configurationSection.contains("durability")) { - short dura = itemStack.getType().getMaxDurability(); - dura -= (short) durability - 1; - - itemStack.setDurability(dura); - } + if (durability != null) + itemStack.setDurability(durability); if (configurationSection.contains("owner") && itemStack.getType() == CompatibleMaterial.PLAYER_HEAD.getMaterial()) { SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta(); @@ -383,8 +384,12 @@ public class ItemStackUtils { @SuppressWarnings("unchecked") public static ItemStackHolder getItemStackHolder(ConfigurationSection configurationSection) { Integer amount = (Integer) configurationSection.get("amount", null); - String type = configurationSection.getString("type", null); - Short durability = (Short) configurationSection.get("durability", null); + + CompatibleMaterial material = CompatibleMaterial.getMaterial(configurationSection.getString("type", null)); + + String type = material.getMaterial().name(); + Short durability = (Short) configurationSection.get("durability"); + if (material.getData() != -1) durability = (short) material.getData(); String name = configurationSection.getString("name", null); List lore = (List) configurationSection.getList("lore", null); List enchants = (List) configurationSection.getList("enchants", null); From ff58c57b7e88dc2b79b0d5abd196559b9c806474 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 23:21:52 -0400 Subject: [PATCH 09/16] Edit command is no longer case sensitive. --- .../src/com/songoda/epicbosses/commands/CommandEdit.java | 8 ++++++-- .../songoda/epicbosses/container/BossEntityContainer.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java index 2275452..297b89f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java @@ -1,6 +1,7 @@ package com.songoda.epicbosses.commands; import com.songoda.core.commands.AbstractCommand; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.container.BossEntityContainer; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.managers.BossPanelManager; @@ -8,8 +9,10 @@ import com.songoda.epicbosses.utils.Message; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; /** * @author Charles Cullen @@ -44,7 +47,8 @@ public class CommandEdit extends AbstractCommand { return ReturnType.FAILURE; } - BossEntity bossEntity = this.bossEntityContainer.getData().get(input); + BossEntity bossEntity = bossEntityContainer.getData().entrySet().stream() + .filter(e -> e.getKey().equalsIgnoreCase(input)).findFirst().get().getValue(); this.bossPanelManager.getMainBossEditMenu().openFor(player, bossEntity); break; @@ -55,7 +59,7 @@ public class CommandEdit extends AbstractCommand { @Override protected List onTab(CommandSender commandSender, String... args) { if (args.length == 1) { - return Collections.singletonList("name"); + return new ArrayList<>(EpicBosses.getInstance().getBossesFileManager().getBossEntitiesMap().keySet()); } return null; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java b/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java index 7a9a31e..a18b398 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/container/BossEntityContainer.java @@ -66,6 +66,6 @@ public class BossEntityContainer implements IContainer, @Override public boolean exists(String string) { - return this.container.containsKey(string); + return this.container.keySet().stream().anyMatch(name -> name.equalsIgnoreCase(string)); } } From 91b7efd71e3fcd12293d14507a8ee06cf6525c5a Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 7 Oct 2019 23:46:12 -0400 Subject: [PATCH 10/16] Armor compatibility. --- .../utils/itemstack/ItemStackConverter.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java index b81d41b..5506912 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/ItemStackConverter.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.utils.itemstack; +import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.epicbosses.utils.IReplaceableConverter; import com.songoda.epicbosses.utils.StringUtils; import com.songoda.epicbosses.utils.itemstack.converters.EnchantConverter; @@ -101,23 +102,20 @@ public class ItemStackConverter implements IReplaceableConverter lore = itemStackHolder.getLore(), enchants = itemStackHolder.getEnchants(); - if (type.contains(":")) { - durability = Short.valueOf(type.split(":")[1]); - } - - if (durability != null) itemStack.setDurability(durability); + if (durability != -1) itemStack.setDurability(durability); if (enchants != null) itemStack.addUnsafeEnchantments(this.enchantConverter.from(enchants)); if (name != null || skullOwner != null || lore != null || spawnerId != null) { From e5eddd4e5c79ecc255ed6c838550101c9c1a87bf Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Oct 2019 01:25:47 -0400 Subject: [PATCH 11/16] Boss minion targeting issues are now resolved. --- .../listeners/during/BossMinionTargetListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java index 433eec6..dc4eb2a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java @@ -28,7 +28,7 @@ public class BossMinionTargetListener implements Listener { Entity entityTargeting = event.getEntity(); LivingEntity entityTargeted = event.getTarget(); - if (entityTargeting == null || entityTargeted == null) return; + if (entityTargeted == null) return; if (!(entityTargeting instanceof LivingEntity)) return; LivingEntity livingEntity = (LivingEntity) entityTargeting; @@ -38,14 +38,14 @@ public class BossMinionTargetListener implements Listener { if (targetingBossHolder != null) { for (ActiveMinionHolder minionHolder : targetingBossHolder.getActiveMinionHolderMap().values()) { - if (minionHolder.getLivingEntityMap().containsValue(entityTargeted)) { + if (minionHolder.getLivingEntityMap().containsValue(entityTargeted.getUniqueId())) { event.setCancelled(true); return; } } } else if (targetedBossHolder != null) { for (ActiveMinionHolder minionHolder : targetedBossHolder.getActiveMinionHolderMap().values()) { - if (minionHolder.getLivingEntityMap().containsValue(entityTargeting)) { + if (minionHolder.getLivingEntityMap().containsValue(entityTargeting.getUniqueId())) { event.setCancelled(true); return; } From aa61bffbdbf6ade9bba7adf037e015646dc5e359 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Oct 2019 01:29:40 -0400 Subject: [PATCH 12/16] Removed code that would unload bosses on restart. --- plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java index edb72a7..936abb3 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java @@ -90,7 +90,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable { @Override public void onPluginDisable() { this.autoSpawnManager.stopIntervalSystems(); - this.bossEntityManager.killAllHolders((World) null); } @Override From 6b707436ef97f7cc23b7f564c305bc47cf15472c Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Oct 2019 01:29:53 -0400 Subject: [PATCH 13/16] Added code to respawn unloaded bosses. --- .../listeners/during/BossDamageListener.java | 18 +++++++++++++++++- .../mechanics/boss/NameMechanic.java | 5 ++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java index 21e2789..b38ee58 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java @@ -1,9 +1,12 @@ package com.songoda.epicbosses.listeners.during; +import com.songoda.core.utils.TextUtils; import com.songoda.epicbosses.EpicBosses; +import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.events.BossDamageEvent; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.BossEntityManager; +import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.utils.ServerUtils; import org.bukkit.entity.*; import org.bukkit.event.EventHandler; @@ -19,9 +22,11 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; public class BossDamageListener implements Listener { private BossEntityManager bossEntityManager; + private BossesFileManager bossesFileManager; public BossDamageListener(EpicBosses plugin) { this.bossEntityManager = plugin.getBossEntityManager(); + this.bossesFileManager = plugin.getBossesFileManager(); } @EventHandler(priority = EventPriority.MONITOR) @@ -36,7 +41,18 @@ public class BossDamageListener implements Listener { double damage = event.getDamage(); Player player = null; - if (activeBossHolder == null) return; + if (activeBossHolder == null) { + // Check to see if this was a boss and respawn it if so. + String convert = TextUtils.convertFromInvisibleString(livingEntity.getCustomName()); + if (convert.startsWith("BOSS:")) { + String name = convert.split(":")[1]; + + BossEntity bossEntity = bossesFileManager.getBossEntity(name); + bossEntityManager.createActiveBossHolder(bossEntity, livingEntity.getLocation(), name, null); + livingEntity.remove(); + } + return; + } if (entityDamaging instanceof Player) { player = (Player) entityDamaging; diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java index cd334f5..384f906 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.mechanics.boss; +import com.songoda.core.utils.TextUtils; import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; @@ -16,8 +17,6 @@ import org.bukkit.entity.LivingEntity; */ public class NameMechanic implements IBossMechanic { - private EpicBosses plugin = EpicBosses.getInstance(); - @Override public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; @@ -30,7 +29,7 @@ public class NameMechanic implements IBossMechanic { if (livingEntity == null || customName == null) continue; String formattedName = StringUtils.get().translateColor(customName); - livingEntity.setCustomName(formattedName); + livingEntity.setCustomName(TextUtils.convertToInvisibleString("BOSS:" + activeBossHolder.getName() + ":") + formattedName); livingEntity.setCustomNameVisible(true); } From 2fe1d506b7f583d25fd3ad0b5c8bace9cd19ebcb Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Oct 2019 02:01:26 -0400 Subject: [PATCH 14/16] Auto tame tameable mounts. --- .../epicbosses/mechanics/boss/EntityTypeMechanic.java | 6 ++++++ .../epicbosses/mechanics/minions/EntityTypeMechanic.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java index edf2e64..49181a4 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java @@ -8,7 +8,9 @@ import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.mechanics.IBossMechanic; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.EntityFinder; +import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Tameable; /** * @author Charles Cullen @@ -45,6 +47,10 @@ public class EntityTypeMechanic implements IBossMechanic { return false; } + if (lowerLivingEntity instanceof Tameable) { + ((Tameable) lowerLivingEntity).setTamed(true); + } + lowerLivingEntity.setPassenger(livingEntity); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java index 6d9b571..795f397 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java @@ -8,7 +8,9 @@ import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.mechanics.IMinionMechanic; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.EntityFinder; +import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Tameable; /** * @author Charles Cullen @@ -46,6 +48,10 @@ public class EntityTypeMechanic implements IMinionMechanic { return false; } + if (lowerLivingEntity instanceof Tameable) { + ((Tameable) lowerLivingEntity).setTamed(true); + } + lowerLivingEntity.setPassenger(livingEntity); } } From 73c5ec1efd413429422d538b090fecf8b62475fc Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Oct 2019 02:15:28 -0400 Subject: [PATCH 15/16] Don't dupe mounts. --- .../epicbosses/listeners/during/BossDamageListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java index b38ee58..9d46427 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossDamageListener.java @@ -49,6 +49,13 @@ public class BossDamageListener implements Listener { BossEntity bossEntity = bossesFileManager.getBossEntity(name); bossEntityManager.createActiveBossHolder(bossEntity, livingEntity.getLocation(), name, null); + + if (livingEntity.isInsideVehicle() && livingEntity.getVehicle() != null) + livingEntity.getVehicle().remove(); + + if (livingEntity.getPassenger() != null) + livingEntity.getPassenger().remove(); + livingEntity.remove(); } return; From 50847321aded3961d44dcf3f293533cec0293d34 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Oct 2019 02:26:05 -0400 Subject: [PATCH 16/16] No spawning babies. --- .../epicbosses/mechanics/boss/EntityTypeMechanic.java | 5 +---- .../mechanics/minions/EntityTypeMechanic.java | 5 +---- .../src/com/songoda/epicbosses/utils/EntityFinder.java | 10 ++++++++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java index 49181a4..4a43ecf 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java @@ -8,6 +8,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.mechanics.IBossMechanic; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.EntityFinder; +import org.bukkit.entity.Ageable; import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Tameable; @@ -47,10 +48,6 @@ public class EntityTypeMechanic implements IBossMechanic { return false; } - if (lowerLivingEntity instanceof Tameable) { - ((Tameable) lowerLivingEntity).setTamed(true); - } - lowerLivingEntity.setPassenger(livingEntity); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java index 795f397..066633b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java @@ -8,6 +8,7 @@ import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.mechanics.IMinionMechanic; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.EntityFinder; +import org.bukkit.entity.Ageable; import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Tameable; @@ -48,10 +49,6 @@ public class EntityTypeMechanic implements IMinionMechanic { return false; } - if (lowerLivingEntity instanceof Tameable) { - ((Tameable) lowerLivingEntity).setTamed(true); - } - lowerLivingEntity.setPassenger(livingEntity); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java index 72600df..4be5b41 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java @@ -3,8 +3,10 @@ package com.songoda.epicbosses.utils; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.entity.handlers.*; import org.bukkit.Location; +import org.bukkit.entity.Ageable; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Tameable; import java.util.ArrayList; import java.util.Arrays; @@ -132,6 +134,14 @@ public enum EntityFinder { return null; } + if (livingEntity instanceof Tameable) { + ((Tameable) livingEntity).setTamed(true); + } + + if (livingEntity instanceof Ageable) { + ((Ageable) livingEntity).setAdult(); + } + return livingEntity; } else { return (LivingEntity) location.getWorld().spawnEntity(location, getEntityType());