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 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>EpicBosses</artifactId> 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 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>EpicBosses</artifactId> 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 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>EpicBosses</artifactId> 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 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>EpicBosses</artifactId> 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/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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>EpicBosses</artifactId> - <groupId>com.songoda.epicbosses</groupId> - <version>maven-version-number</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>WorldGuard-Legacy</artifactId> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>org.spigotmc</groupId> - <artifactId>spigot</artifactId> - <version>1.12.2</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.songoda.epicbosses</groupId> - <artifactId>WorldGuardHelper</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.sk89q</groupId> - <artifactId>worldedit</artifactId> - <version>6.1.9</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.sk89q</groupId> - <artifactId>worldguard</artifactId> - <version>6.2.2</version> - <scope>provided</scope> - </dependency> - </dependencies> -</project> \ 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<String> getRegionNames(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if(worldGuard == null) { - this.worldGuard = WGBukkit.getPlugin(); - } - - List<String> regions = new ArrayList<>(); - List<String> parentNames = new ArrayList<>(); - // this prototype is different from v5 to v6, but they're both Iterable - Iterable<ProtectedRegion> set = (Iterable<ProtectedRegion>) 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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>EpicBosses</artifactId> - <groupId>com.songoda.epicbosses</groupId> - <version>maven-version-number</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>WorldGuard</artifactId> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>org.spigotmc</groupId> - <artifactId>spigot</artifactId> - <version>1.14.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.songoda.epicbosses</groupId> - <artifactId>WorldGuardHelper</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.sk89q</groupId> - <artifactId>worldedit</artifactId> - <version>7.0.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.sk89q</groupId> - <artifactId>worldguard</artifactId> - <version>7.0.0</version> - <scope>provided</scope> - </dependency> - </dependencies> -</project> \ 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<String> getRegionNames(Location loc) { - if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) { - if (worldGuard == null) { - this.worldGuard = WorldGuard.getInstance(); - } - - List<String> regions = new ArrayList<>(); - List<String> 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..aa62cd0 100644 --- a/plugin-modules/Core/pom.xml +++ b/plugin-modules/Core/pom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>EpicBosses</artifactId> @@ -20,6 +20,12 @@ <version>1.14.4</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>com.songoda</groupId> + <artifactId>SongodaCore</artifactId> + <version>LATEST</version> + <scope>compile</scope> + </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>FactionHelper</artifactId> @@ -50,24 +56,6 @@ <version>${project.version}</version> <scope>compile</scope> </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>WorldGuardHelper</artifactId> - <version>${project.version}</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>WorldGuard</artifactId> - <version>${project.version}</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>WorldGuard-Legacy</artifactId> - <version>${project.version}</version> - <scope>compile</scope> - </dependency> </dependencies> <build> @@ -89,8 +77,8 @@ <createDependencyReducedPom>false</createDependencyReducedPom> <relocations> <relocation> - <pattern>org.bstats</pattern> - <shadedPattern>com.songoda.epicbosses.utils.bstats</shadedPattern> + <pattern>com.songoda.core</pattern> + <shadedPattern>com.songoda.epicbosses.core</shadedPattern> </relocation> <relocation> <pattern>utils.factions</pattern> @@ -107,24 +95,6 @@ </execution> </executions> </plugin> - <!--<plugin>--> - <!--<groupId>org.apache.maven.plugins</groupId>--> - <!--<artifactId>maven-antrun-plugin</artifactId>--> - <!--<version>1.8</version>--> - <!--<executions>--> - <!--<execution>--> - <!--<phase>install</phase>--> - <!--<configuration>--> - <!--<target>--> - <!--<copy file="target/${build.finalName}.jar" tofile="D:/Servers/1.13.2/plugins/${build.finalName}.jar"/>--> - <!--</target>--> - <!--</configuration>--> - <!--<goals>--> - <!--<goal>run</goal>--> - <!--</goals>--> - <!--</execution>--> - <!--</executions>--> - <!--</plugin>--> </plugins> </build> </project> \ 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 86% rename from plugin-modules/Core/resources-json/current/items.json rename to plugin-modules/Core/resources-json/items.json index ca8ed68..fcdd9cb 100644 --- a/plugin-modules/Core/resources-json/current/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-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/current/config.yml deleted file mode 100644 index db0af25..0000000 --- a/plugin-modules/Core/resources-yml/current/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/current/editor.yml b/plugin-modules/Core/resources-yml/current/editor.yml deleted file mode 100644 index c641c0f..0000000 --- a/plugin-modules/Core/resources-yml/current/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: WHITE_STAINED_GLASS_PANE - name: '&7' - Items: - '2': - 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.' - 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: 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.' - 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.' - 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: GLASS_PANE - name: '&7' - '47': - type: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - name: '&7' - '54': - type: GLASS_PANE - name: '&7' -ListPanel: - name: '{panelName}' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 50 - Items: - '46': - type: GLASS_PANE - name: '&7' - '47': - type: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - name: '&7' - '54': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - name: '&7' - '54': - type: GLASS_PANE - name: '&7' -AddItemsMenu: - name: '&b&lAdd Item Menu' - slots: 27 - Settings: - emptySpaceFiller: true - EmptySpaceFiller: - name: '&7' - type: LIGHT_BLUE_STAINED_GLASS_PANE - 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: LIME_DYE - 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: WHITE_STAINED_GLASS_PANE - 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: BLAZE_POWDER - 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: 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.' - 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: 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.' - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: GUNPOWDER - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '47': - type: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - name: '&7' - '49': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '52': - type: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: SHIELD - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '48': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - '53': - type: WHITE_STAINED_GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: 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' - 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: WHITE_STAINED_GLASS_PANE - 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: SLIME_SPAWN_EGG - 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: WHITE_STAINED_GLASS_PANE - 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: TALL_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: WHITE_STAINED_GLASS_PANE - 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: TALL_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: WHITE_STAINED_GLASS_PANE - name: '&7' - Buttons: - backButton: 5 - Items: - '2': - type: TALL_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: 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.' - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - Buttons: - backButton: 5 - Items: - '2': - type: TALL_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: WHITE_STAINED_GLASS_PANE - 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: 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' - 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: WHITE_STAINED_GLASS_PANE - 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: 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.' - Button: Type -SkillTypeEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: WHITE_STAINED_GLASS_PANE - 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: 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.' - 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.' - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: GUNPOWDER - name: '&e&lPotion Effect Type' - lore: - - '&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' - 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}' - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: 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%' - Button: Chance -CustomSkillEditorPanel: - name: '&b&l{name} Skill Editor' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: WHITE_STAINED_GLASS_PANE - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - 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: 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.' - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - Buttons: - backButton: 9 - Items: - '3': - 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.' - 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: WHITE_STAINED_GLASS_PANE - 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: 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.' - 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: WHITE_STAINED_GLASS_PANE - 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: 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.' - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - Buttons: - backButton: 23 - Items: - '5': - type: DIAMOND - name: '&b&lPosition: &f{position}' - '11': - 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.' - 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: 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%' - 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: 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.' - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - Buttons: - backButton: 9 - Items: - '3': - type: GUNPOWDER - 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: WHITE_STAINED_GLASS_PANE - 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: 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.' - 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: GLASS_PANE - name: '&7' - '47': - type: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - name: '&7' - '54': - type: GLASS_PANE - name: '&7' -AutoSpawnCustomSettingsEditMenu: - name: '&b&l{name} AutoSpawn' - slots: 54 - Settings: - backButton: true - fillTo: 45 - Buttons: - backButton: 50 - Items: - '46': - type: GLASS_PANE - name: '&7' - '47': - type: GLASS_PANE - name: '&7' - '48': - type: GLASS_PANE - 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: GLASS_PANE - name: '&7' - '53': - type: GLASS_PANE - name: '&7' - '54': - type: GLASS_PANE - name: '&7' -AutoSpawnSpecialSettingsEditMenu: - name: '&b&l{name} AutoSpawn' - slots: 9 - Settings: - backButton: true - emptySpaceFiller: true - EmptySpaceFiller: - type: WHITE_STAINED_GLASS_PANE - 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: 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' - 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' - 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: WHITE_STAINED_GLASS_PANE - name: '&7' - Buttons: - backButton: 9 - Items: - '2': - 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.' - 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...' - 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: 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/resources-yml/display.yml b/plugin-modules/Core/resources-yml/display.yml new file mode 100644 index 0000000..2f11c06 --- /dev/null +++ b/plugin-modules/Core/resources-yml/display.yml @@ -0,0 +1,223 @@ +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/editor.yml b/plugin-modules/Core/resources-yml/editor.yml new file mode 100644 index 0000000..7ad12c0 --- /dev/null +++ b/plugin-modules/Core/resources-yml/editor.yml @@ -0,0 +1,2984 @@ +# 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: WHITE_STAINED_GLASS_PANE + name: '&7' + Items: + '2': + 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.' + 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: 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.' + 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.' + 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: GLASS_PANE + name: '&7' + '47': + type: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + name: '&7' + '54': + type: GLASS_PANE + name: '&7' +ListPanel: + name: '{panelName}' + slots: 54 + Settings: + backButton: true + fillTo: 45 + Buttons: + backButton: 50 + Items: + '46': + type: GLASS_PANE + name: '&7' + '47': + type: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + name: '&7' + '54': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + name: '&7' + '54': + type: GLASS_PANE + name: '&7' +AddItemsMenu: + name: '&b&lAdd Item Menu' + slots: 27 + Settings: + emptySpaceFiller: true + EmptySpaceFiller: + name: '&7' + type: LIGHT_BLUE_STAINED_GLASS_PANE + 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: LIME_DYE + 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: WHITE_STAINED_GLASS_PANE + 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: BLAZE_POWDER + 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: 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.' + 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: 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.' + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + 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: GUNPOWDER + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '47': + type: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + name: '&7' + '49': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '52': + type: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + 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 display.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: WHITE_STAINED_GLASS_PANE + 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: SHIELD + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '48': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + '53': + type: WHITE_STAINED_GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + 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: 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' + 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: WHITE_STAINED_GLASS_PANE + 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: SLIME_SPAWN_EGG + 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: WHITE_STAINED_GLASS_PANE + 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: TALL_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: WHITE_STAINED_GLASS_PANE + 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: TALL_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: WHITE_STAINED_GLASS_PANE + name: '&7' + Buttons: + backButton: 5 + Items: + '2': + type: TALL_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: 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.' + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + Buttons: + backButton: 5 + Items: + '2': + type: TALL_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: WHITE_STAINED_GLASS_PANE + 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: 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' + 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: WHITE_STAINED_GLASS_PANE + 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: 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.' + Button: Type +SkillTypeEditorPanel: + name: '&b&l{name} Skill Editor' + slots: 9 + Settings: + backButton: true + emptySpaceFiller: true + EmptySpaceFiller: + type: WHITE_STAINED_GLASS_PANE + 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: 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.' + 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.' + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + 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: GUNPOWDER + name: '&e&lPotion Effect Type' + lore: + - '&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' + 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}' + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + 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: 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%' + Button: Chance +CustomSkillEditorPanel: + name: '&b&l{name} Skill Editor' + slots: 9 + Settings: + backButton: true + emptySpaceFiller: true + EmptySpaceFiller: + type: WHITE_STAINED_GLASS_PANE + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + 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: 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.' + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + Buttons: + backButton: 9 + Items: + '3': + 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.' + 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: WHITE_STAINED_GLASS_PANE + 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: 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.' + 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: WHITE_STAINED_GLASS_PANE + 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: 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.' + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + Buttons: + backButton: 23 + Items: + '5': + type: DIAMOND + name: '&b&lPosition: &f{position}' + '11': + 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.' + 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: 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%' + 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: 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.' + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + Buttons: + backButton: 9 + Items: + '3': + type: GUNPOWDER + 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: WHITE_STAINED_GLASS_PANE + 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: 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.' + 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: GLASS_PANE + name: '&7' + '47': + type: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + name: '&7' + '54': + type: GLASS_PANE + name: '&7' +AutoSpawnCustomSettingsEditMenu: + name: '&b&l{name} AutoSpawn' + slots: 54 + Settings: + backButton: true + fillTo: 45 + Buttons: + backButton: 50 + Items: + '46': + type: GLASS_PANE + name: '&7' + '47': + type: GLASS_PANE + name: '&7' + '48': + type: GLASS_PANE + 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: GLASS_PANE + name: '&7' + '53': + type: GLASS_PANE + name: '&7' + '54': + type: GLASS_PANE + name: '&7' +AutoSpawnSpecialSettingsEditMenu: + name: '&b&l{name} AutoSpawn' + slots: 9 + Settings: + backButton: true + emptySpaceFiller: true + EmptySpaceFiller: + type: WHITE_STAINED_GLASS_PANE + 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: 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' + 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' + 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: WHITE_STAINED_GLASS_PANE + name: '&7' + Buttons: + backButton: 9 + Items: + '2': + 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.' + 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...' + 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: 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/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/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/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..936abb3 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/EpicBosses.java @@ -0,0 +1,404 @@ +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.*; +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 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 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 CommandManager commandManager; + + private DebugManager debugManager = new DebugManager(); + + private YmlFileHandler langFileHandler, editorFileHandler, displayFileHandler; + private FileConfiguration lang, editor, display; + + private boolean debug = true; + + public static EpicBosses getInstance() { + return INSTANCE; + } + + @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(); + } + + @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(); + + // 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(); + + //RELOAD/LOAD ALL MANAGERS + this.bossSkillManager.load(); + this.bossHookManager.reload(); + this.bossLocationManager.reload(); + this.bossMechanicManager.load(); + this.minionMechanicManager.load(); + + saveMessagesToFile(); + + 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<Config> 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 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 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 CommandManager getCommandManager() { + return commandManager; + } + + 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..97766ae 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,21 +49,21 @@ import java.util.Map; */ public class BossAPI { - private static CustomBosses PLUGIN; + private static EpicBosses PLUGIN; /** * Used to update the variable to the * plugin instance so the methods can * pull variables in the main class to use * in their method. - * + * <p> * This should only ever be used in house and * never to be used by an outside party. * * @param plugin - the plugin instance. */ - public BossAPI(CustomBosses plugin) { - if(PLUGIN != null) { + public BossAPI(EpicBosses plugin) { + if (PLUGIN != null) { Debug.ATTEMPTED_TO_UPDATE_PLUGIN.debug(); return; } @@ -80,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(); @@ -146,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<String, BossEntity> entry : PLUGIN.getBossEntityContainer().getData().entrySet()) { - if(entry.getValue().equals(bossEntity)) { + for (Map.Entry<String, BossEntity> entry : PLUGIN.getBossEntityContainer().getData().entrySet()) { + if (entry.getValue().equals(bossEntity)) { return entry.getKey(); } } @@ -174,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<String, Skill> entry : PLUGIN.getSkillsFileManager().getSkillMap().entrySet()) { - if(entry.getValue().equals(skill)) return entry.getKey(); + for (Map.Entry<String, Skill> entry : PLUGIN.getSkillsFileManager().getSkillMap().entrySet()) { + if (entry.getValue().equals(skill)) return entry.getKey(); } return null; @@ -189,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<String, AutoSpawn> entry : PLUGIN.getAutoSpawnFileManager().getAutoSpawnMap().entrySet()) { - if(entry.getValue().equals(autoSpawn)) return entry.getKey(); + for (Map.Entry<String, AutoSpawn> entry : PLUGIN.getAutoSpawnFileManager().getAutoSpawnMap().entrySet()) { + if (entry.getValue().equals(autoSpawn)) return entry.getKey(); } return null; @@ -204,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<String, DropTable> entry : PLUGIN.getDropTableFileManager().getDropTables().entrySet()) { - if(entry.getValue().equals(dropTable)) return entry.getKey(); + for (Map.Entry<String, DropTable> entry : PLUGIN.getDropTableFileManager().getDropTables().entrySet()) { + if (entry.getValue().equals(dropTable)) return entry.getKey(); } return null; @@ -219,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<String, MinionEntity> entry : PLUGIN.getMinionEntityContainer().getData().entrySet()) { - if(entry.getValue().equals(minionEntity)) { + for (Map.Entry<String, MinionEntity> entry : PLUGIN.getMinionEntityContainer().getData().entrySet()) { + if (entry.getValue().equals(minionEntity)) { return entry.getKey(); } } @@ -229,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); @@ -250,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); @@ -297,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; } @@ -312,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; } @@ -325,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); @@ -355,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. */ @@ -363,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; } @@ -401,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. */ @@ -409,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; } @@ -422,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) { @@ -443,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; } @@ -463,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; } @@ -478,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; } @@ -487,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); @@ -504,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/autospawns/AutoSpawn.java b/plugin-modules/Core/src/com/songoda/epicbosses/autospawns/AutoSpawn.java index 2ae090c..b78e7db 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<String> entities; - @Expose @Getter @Setter private AutoSpawnSettings autoSpawnSettings; - @Expose @Getter @Setter private JsonObject customData; + @Expose + private boolean editing; + @Expose + private String type; + @Expose + private List<String> entities; + @Expose + private AutoSpawnSettings autoSpawnSettings; + @Expose + private JsonObject customData; public AutoSpawn(boolean editing, List<String> entities, AutoSpawnSettings autoSpawnSettings) { this.editing = editing; @@ -30,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); } @@ -38,13 +41,52 @@ public class AutoSpawn { } public boolean isCompleteEnoughToSpawn() { - if(this.type == null) return false; + if (this.type == null) return false; List<String> entities = getEntities(); - if(entities == null || entities.isEmpty()) return false; + if (entities == null || entities.isEmpty()) return false; return true; } + public boolean isEditing() { + return this.editing; + } + + public void setEditing(boolean editing) { + this.editing = editing; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public List<String> getEntities() { + return this.entities; + } + + public void setEntities(List<String> 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<SpawnType> getSpawnTypes() { List<SpawnType> 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 3cbbc5e..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 @@ -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<AutoSpawn> 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<AutoSpawn> 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(); @@ -74,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; @@ -88,7 +92,7 @@ public class IntervalSpawnHandler { String modifyValue; int newAmount; - if(amountToModifyBy > 0) { + if (amountToModifyBy > 0) { modifyValue = "increased"; newAmount = currentAmount + amountToModifyBy; } else { @@ -96,7 +100,7 @@ public class IntervalSpawnHandler { newAmount = currentAmount + amountToModifyBy; } - if(newAmount <= 0) { + if (newAmount <= 0) { newAmount = 0; } @@ -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..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 @@ -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 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 6dd8f26..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 @@ -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; @@ -53,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; } @@ -72,22 +73,22 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { List<String> 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<String> 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); @@ -96,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()); @@ -104,7 +105,7 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler { List<String> 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); @@ -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 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/commands/BossCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/BossCmd.java deleted file mode 100644 index 3453765..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<CommandSender> { - - 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<String> 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 52% 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 4158d95..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,70 +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<EntityFinder> 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)) { + if (this.bossEntityContainer.exists(name)) { Message.Boss_Create_NameAlreadyExists.msg(sender, name); - return; + return ReturnType.FAILURE; } EntityFinder entityFinder = EntityFinder.get(entityTypeInput); - if(entityFinder == null) { + if (entityFinder == null) { Message.Boss_Create_EntityTypeNotFound.msg(sender, entityTypeInput); - return; + return ReturnType.FAILURE; } BossEntity bossEntity = BossAPI.createBaseBossEntity(name, entityTypeInput); - if(bossEntity == null) { + 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<String> 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> <entity>"; + } + + @Override + public String getDescription() { + return "Start the creation of a boss."; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDebug.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDebug.java new file mode 100644 index 0000000..c2241cd --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandDebug.java @@ -0,0 +1,62 @@ +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 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 CommandDebug extends AbstractCommand { + + private DebugManager debugManager; + + public CommandDebug(DebugManager debugManager) { + super(true, "debug"); + this.debugManager = debugManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + Player player = (Player) sender; + String toggled; + + if (this.debugManager.isToggled(player.getUniqueId())) { + this.debugManager.togglePlayerOff(player.getUniqueId()); + toggled = "Off"; + } else { + this.debugManager.togglePlayerOn(player.getUniqueId()); + toggled = "On"; + } + + Message.Boss_Debug_Toggled.msg(player, toggled); + return ReturnType.SUCCESS; + } + + @Override + protected List<String> 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<String> 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/CommandEdit.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java new file mode 100644 index 0000000..297b89f --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandEdit.java @@ -0,0 +1,81 @@ +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; +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 + * @version 1.0.0 + * @since 02-Oct-18 + */ +public class CommandEdit extends AbstractCommand { + + private BossEntityContainer bossEntityContainer; + private BossPanelManager bossPanelManager; + + public CommandEdit(BossPanelManager bossPanelManager, BossEntityContainer bossEntityContainer) { + super(true, "edit"); + this.bossPanelManager = bossPanelManager; + this.bossEntityContainer = bossEntityContainer; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + Player player = (Player) sender; + + switch (args.length) { + default: + case 0: + this.bossPanelManager.getBosses().openFor(player); + break; + case 1: + String input = args[0]; + + if (!this.bossEntityContainer.exists(input)) { + Message.Boss_Edit_DoesntExist.msg(sender); + return ReturnType.FAILURE; + } + + BossEntity bossEntity = bossEntityContainer.getData().entrySet().stream() + .filter(e -> e.getKey().equalsIgnoreCase(input)).findFirst().get().getValue(); + + this.bossPanelManager.getMainBossEditMenu().openFor(player, bossEntity); + break; + } + return ReturnType.SUCCESS; + } + + @Override + protected List<String> onTab(CommandSender commandSender, String... args) { + if (args.length == 1) { + return new ArrayList<>(EpicBosses.getInstance().getBossesFileManager().getBossEntitiesMap().keySet()); + } + return null; + } + + @Override + public String getPermissionNode() { + return "boss.edit"; + } + + @Override + public String getSyntax() { + return "/boss edit <name>"; + } + + @Override + public String getDescription() { + return "Edit a specified boss."; + } +} diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandGiveEgg.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandGiveEgg.java new file mode 100644 index 0000000..f50a6d0 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandGiveEgg.java @@ -0,0 +1,115 @@ +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 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 CommandGiveEgg extends AbstractCommand { + + private BossEntityManager bossEntityManager; + private BossesFileManager bossesFileManager; + + public CommandGiveEgg(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { + super(false, "give", "giveegg"); + + this.bossesFileManager = bossesFileManager; + this.bossEntityManager = bossEntityManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + + if (args.length < 2) { + Message.Boss_GiveEgg_InvalidArgs.msg(sender); + return ReturnType.FAILURE; + } + + int amount = 1; + + if (args.length == 3) { + String amountInput = args[2]; + + if (NumberUtils.get().isInt(amountInput)) { + amount = Integer.valueOf(amountInput); + } else { + Message.General_NotNumber.msg(sender); + return ReturnType.FAILURE; + } + } + + String playerInput = args[1]; + Player player = Bukkit.getPlayer(playerInput); + + if (player == null) { + Message.General_NotOnline.msg(sender, playerInput); + return ReturnType.FAILURE; + } + + String bossInput = args[0]; + BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); + + if (bossEntity == null) { + Message.Boss_GiveEgg_InvalidBoss.msg(sender); + return ReturnType.FAILURE; + } + + ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity); + + if (spawnItem == null) { + Message.Boss_GiveEgg_NotSet.msg(sender); + return ReturnType.FAILURE; + } + + spawnItem.setAmount(amount); + player.getInventory().addItem(spawnItem); + + Message.Boss_GiveEgg_Given.msg(sender, player.getName(), amount, bossInput); + Message.Boss_GiveEgg_Received.msg(player, amount, bossInput); + return ReturnType.SUCCESS; + } + + @Override + protected List<String> 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 <name> <player> [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/CommandInfo.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandInfo.java new file mode 100644 index 0000000..e42e396 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandInfo.java @@ -0,0 +1,74 @@ +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 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 CommandInfo extends AbstractCommand { + + private BossEntityManager bossEntityManager; + private BossesFileManager bossesFileManager; + + public CommandInfo(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { + super(false, "info"); + this.bossesFileManager = bossesFileManager; + this.bossEntityManager = bossEntityManager; + } + + @Override + protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) { + if (args.length != 1) { + Message.Boss_Info_InvalidArgs.msg(sender); + return ReturnType.FAILURE; + } + + String input = args[0]; + BossEntity bossEntity = this.bossesFileManager.getBossEntity(input); + + if (bossEntity == null) { + Message.Boss_Info_CouldntFindBoss.msg(sender); + return ReturnType.FAILURE; + } + + boolean editing = bossEntity.isEditing(); + int active = this.bossEntityManager.getCurrentlyActive(bossEntity); + boolean complete = bossEntity.isCompleteEnoughToSpawn(); + + Message.Boss_Info_Display.msg(sender, input, editing, active, complete); + return ReturnType.SUCCESS; + } + + @Override + protected List<String> 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 <name>"; + } + + @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<String> 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<String> 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<String> 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<String> 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/CommandNearby.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNearby.java new file mode 100644 index 0000000..c36ee5f --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandNearby.java @@ -0,0 +1,91 @@ +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.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; + +/** + * @author Charles Cullen + * @version 1.0.0 + * @since 02-Oct-18 + */ +public class CommandNearby extends AbstractCommand { + + private EpicBosses plugin; + + public CommandNearby(EpicBosses plugin) { + super(true, "nearby"); + this.plugin = plugin; + } + + @Override + 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 == 1) { + Integer newNumber = NumberUtils.get().getInteger(args[0]); + + if (newNumber != null) radius = newNumber; + + if (radius > maxRadius) { + Message.Boss_Nearby_MaxRadius.msg(player, maxRadius); + return ReturnType.SUCCESS; + } + } + + Map<ActiveBossHolder, Double> nearbyBosses = this.plugin.getBossEntityManager().getActiveBossHoldersWithinRadius(radius, location); + Map<ActiveBossHolder, Double> sortedMap = MapUtils.get().sortByValue(nearbyBosses); + + if (sortedMap.isEmpty()) { + Message.Boss_Nearby_NoneNearby.msg(player); + return ReturnType.FAILURE; + } + + List<String> input = new LinkedList<>(); + + 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<String> 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<String> 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 <name>"; + } + + @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<String> commands = appendList(args); + + this.commandsFileManager.addNewCommand(nameInput, commands); + this.commandsFileManager.save(); + + Message.Boss_New_Command.msg(sender, nameInput); + return ReturnType.SUCCESS; + } + + @Override + protected List<String> 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 <name> <commands...>"; + } + + @Override + public String getDescription() { + return "Create a new command section."; + } + + private List<String> appendList(String[] args) { + String[] params = Arrays.copyOfRange(args, 2, args.length); + + List<String> 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<String> 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 <name> <type>"; + } + + @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<String> messages = appendList(args); + + this.messagesFileManager.addNewMessage(nameInput, messages); + this.messagesFileManager.save(); + + Message.Boss_New_Message.msg(sender, nameInput); + return ReturnType.SUCCESS; + } + + @Override + protected List<String> 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 <name> <message...>"; + } + + @Override + public String getDescription() { + return "Create a new message section."; + } + + private List<String> appendList(String[] args) { + String[] params = Arrays.copyOfRange(args, 2, args.length); + + List<String> 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<SkillMode> 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<String> 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 <name> <type> <mods>"; + } + + @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 03ee346..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<String> 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<String> 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<String> 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/CommandSpawn.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSpawn.java new file mode 100644 index 0000000..89ef65b --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/commands/CommandSpawn.java @@ -0,0 +1,94 @@ +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.StringUtils; +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 CommandSpawn extends AbstractCommand { + + private BossesFileManager bossesFileManager; + + public CommandSpawn(BossesFileManager bossesFileManager) { + super(false, "spawn"); + + this.bossesFileManager = bossesFileManager; + } + + @Override + protected ReturnType runCommand(CommandSender sender, String... args) { + if (args.length == 0) + return ReturnType.SYNTAX_ERROR; + + Location spawnLocation; + + if (args.length == 2) { + Location input = StringUtils.get().fromStringToLocation(args[1]); + + if (input == null) { + Message.Boss_Spawn_InvalidLocation.msg(sender); + return ReturnType.FAILURE; + } + + spawnLocation = input; + } else { + if (!(sender instanceof Player)) { + Message.Boss_Spawn_MustBePlayer.msg(sender); + return ReturnType.FAILURE; + } + + spawnLocation = ((Player) sender).getLocation(); + } + + String bossInput = args[0]; + BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); + + if (bossEntity == null) { + Message.Boss_Spawn_InvalidBoss.msg(sender); + 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<String> 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 <name> [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 62% 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 769235d..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.epicbosses.CustomBosses; +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,44 +19,36 @@ 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(CustomBosses 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<String> currentActive = this.autoSpawnManager.getIntervalAutoSpawns(); - if(!exists) { + if (!exists) { Message.Boss_Time_DoesntExist.msg(sender, StringUtils.get().appendList(currentActive)); - return; + return ReturnType.FAILURE; } ActiveAutoSpawnHolder activeAutoSpawnHolder = this.autoSpawnManager.getActiveAutoSpawnHolder(section); 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; + 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<String> 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 <section>"; + } + + @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/BossDebugCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java deleted file mode 100644 index 2266508..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossDebugCmd.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -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; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 09-Oct-18 - */ -public class BossDebugCmd extends SubCommand { - - private DebugManager debugManager; - - public BossDebugCmd(DebugManager debugManager) { - super("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; - } - - Player player = (Player) sender; - String toggled; - - if(this.debugManager.isToggled(player.getUniqueId())) { - this.debugManager.togglePlayerOff(player.getUniqueId()); - toggled = "Off"; - } else { - this.debugManager.togglePlayerOn(player.getUniqueId()); - toggled = "On"; - } - - Message.Boss_Debug_Toggled.msg(player, toggled); - } -} 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 fca3648..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/BossEditCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java deleted file mode 100644 index 2edbb8f..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossEditCmd.java +++ /dev/null @@ -1,63 +0,0 @@ -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; -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 BossEditCmd extends SubCommand { - - private BossEntityContainer bossEntityContainer; - private BossPanelManager bossPanelManager; - - public BossEditCmd(BossPanelManager bossPanelManager, BossEntityContainer bossEntityContainer) { - super("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; - } - - Player player = (Player) sender; - - switch(args.length) { - default: - case 1: - this.bossPanelManager.getBosses().openFor(player); - break; - case 2: - String input = args[1]; - - if(!this.bossEntityContainer.exists(input)) { - Message.Boss_Edit_DoesntExist.msg(sender); - return; - } - - BossEntity bossEntity = this.bossEntityContainer.getData().get(input); - - this.bossPanelManager.getMainBossEditMenu().openFor(player, bossEntity); - break; - } - } -} 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 deleted file mode 100644 index 39d4d86..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossGiveEggCmd.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -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.Player; -import org.bukkit.inventory.ItemStack; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 14-Nov-18 - */ -public class BossGiveEggCmd extends SubCommand { - - private BossEntityManager bossEntityManager; - private BossesFileManager bossesFileManager; - - public BossGiveEggCmd(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { - super("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; - } - - if(args.length < 3) { - Message.Boss_GiveEgg_InvalidArgs.msg(sender); - return; - } - - int amount = 1; - - if(args.length == 4) { - String amountInput = args[3]; - - if(NumberUtils.get().isInt(amountInput)) { - amount = Integer.valueOf(amountInput); - } else { - Message.General_NotNumber.msg(sender); - return; - } - } - - String playerInput = args[2]; - Player player = Bukkit.getPlayer(playerInput); - - if(player == null) { - Message.General_NotOnline.msg(sender, playerInput); - return; - } - - String bossInput = args[1]; - BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); - - if(bossEntity == null) { - Message.Boss_GiveEgg_InvalidBoss.msg(sender); - return; - } - - ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity); - - if(spawnItem == null) { - Message.Boss_GiveEgg_NotSet.msg(sender); - return; - } - - spawnItem.setAmount(amount); - player.getInventory().addItem(spawnItem); - - Message.Boss_GiveEgg_Given.msg(sender, player.getName(), amount, bossInput); - Message.Boss_GiveEgg_Received.msg(player, amount, bossInput); - } -} 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 beef297..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.CustomBosses; -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 " + CustomBosses.get().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/BossInfoCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java deleted file mode 100644 index e5d372a..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossInfoCmd.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -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; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Oct-18 - */ -public class BossInfoCmd extends SubCommand { - - private BossEntityManager bossEntityManager; - private BossesFileManager bossesFileManager; - - public BossInfoCmd(BossesFileManager bossesFileManager, BossEntityManager bossEntityManager) { - super("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) { - Message.Boss_Info_InvalidArgs.msg(sender); - return; - } - - String input = args[1]; - BossEntity bossEntity = this.bossesFileManager.getBossEntity(input); - - if(bossEntity == null) { - Message.Boss_Info_CouldntFindBoss.msg(sender); - return; - } - - boolean editing = bossEntity.isEditing(); - int active = this.bossEntityManager.getCurrentlyActive(bossEntity); - boolean complete = bossEntity.isCompleteEnoughToSpawn(); - - Message.Boss_Info_Display.msg(sender, input, editing, active, complete); - } -} 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 9489d6e..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 cb1bec8..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 449079f..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 2a008db..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/BossNearbyCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java deleted file mode 100644 index 8751b1a..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNearbyCmd.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.CustomBosses; -import com.songoda.epicbosses.file.ConfigFileHandler; -import com.songoda.epicbosses.holder.ActiveBossHolder; -import com.songoda.epicbosses.utils.*; -import com.songoda.epicbosses.utils.command.SubCommand; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Oct-18 - */ -public class BossNearbyCmd extends SubCommand { - - private CustomBosses plugin; - - public BossNearbyCmd(CustomBosses plugin) { - super("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; - } - - 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(newNumber != null) radius = newNumber; - - if(radius > maxRadius) { - Message.Boss_Nearby_MaxRadius.msg(player, maxRadius); - return; - } - } - - Map<ActiveBossHolder, Double> nearbyBosses = this.plugin.getBossEntityManager().getActiveBossHoldersWithinRadius(radius, location); - Map<ActiveBossHolder, Double> sortedMap = MapUtils.get().sortByValue(nearbyBosses); - - if(sortedMap.isEmpty()) { - Message.Boss_Nearby_NoneNearby.msg(player); - return; - } - - List<String> input = new LinkedList<>(); - - 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)); - } -} 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 a354b9d..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossNewCmd.java +++ /dev/null @@ -1,244 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -import com.songoda.epicbosses.CustomBosses; -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; -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(CustomBosses 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<String> 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<String> 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<SkillMode> 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<String> appendList(String[] args) { - String[] params = Arrays.copyOfRange(args, 3, args.length); - - List<String> 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 dfd4746..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.CustomBosses; -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 CustomBosses plugin; - - public BossShopCmd(CustomBosses 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 d56bb38..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/commands/boss/BossSpawnCmd.java b/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java deleted file mode 100644 index 3852f57..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/commands/boss/BossSpawnCmd.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.songoda.epicbosses.commands.boss; - -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; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 02-Oct-18 - */ -public class BossSpawnCmd extends SubCommand { - - private BossesFileManager bossesFileManager; - - public BossSpawnCmd(BossesFileManager bossesFileManager) { - super("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; - } - - Location spawnLocation; - - if(args.length == 3) { - Location input = StringUtils.get().fromStringToLocation(args[2]); - - if(input == null) { - Message.Boss_Spawn_InvalidLocation.msg(sender); - return; - } - - spawnLocation = input; - } else { - if(!(sender instanceof Player)) { - Message.Boss_Spawn_MustBePlayer.msg(sender); - return; - } - - spawnLocation = ((Player) sender).getLocation(); - } - - String bossInput = args[1]; - BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput); - - if(bossEntity == null) { - Message.Boss_Spawn_InvalidBoss.msg(sender); - return; - } - - BossAPI.spawnNewBoss(bossEntity, spawnLocation, null, null, false); - Message.Boss_Spawn_Spawned.msg(sender, bossInput, StringUtils.get().translateLocation(spawnLocation)); - } -} 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..a18b398 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<Map<String, BossEntity>, } public String getName(BossEntity bossEntity) { - for(Map.Entry<String, BossEntity> entry : getData().entrySet()) { - if(entry.getValue().equals(bossEntity)) return entry.getKey(); + for (Map.Entry<String, BossEntity> entry : getData().entrySet()) { + if (entry.getValue().equals(bossEntity)) return entry.getKey(); } return null; @@ -36,8 +36,8 @@ public class BossEntityContainer implements IContainer<Map<String, BossEntity>, int completed = 0; int failed = 0; - for(Map.Entry<String, BossEntity> entry : stringBossEntityMap.entrySet()) { - if(getData().containsKey(entry.getKey())) { + for (Map.Entry<String, BossEntity> 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<Map<String, BossEntity>, } - if(failed > 0) { + if (failed > 0) { Debug.BOSS_CONTAINER_SAVE.debug(completed, failed, stringBuilder.toString()); } @@ -66,6 +66,6 @@ public class BossEntityContainer implements IContainer<Map<String, BossEntity>, @Override public boolean exists(String string) { - return this.container.containsKey(string); + return this.container.keySet().stream().anyMatch(name -> name.equalsIgnoreCase(string)); } } 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<Map<String, MinionEntit } public String getName(MinionEntity minionEntity) { - for(Map.Entry<String, MinionEntity> entry : getData().entrySet()) { - if(entry.getValue().equals(minionEntity)) return entry.getKey(); + for (Map.Entry<String, MinionEntity> entry : getData().entrySet()) { + if (entry.getValue().equals(minionEntity)) return entry.getKey(); } return null; @@ -36,8 +36,8 @@ public class MinionEntityContainer implements IContainer<Map<String, MinionEntit int completed = 0; int failed = 0; - for(Map.Entry<String, MinionEntity> entry : stringMinionEntityMap.entrySet()) { - if(getData().containsKey(entry.getKey())) { + for (Map.Entry<String, MinionEntity> 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<Map<String, MinionEntit completed++; } - if(failed > 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 b352cfb..b571833 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; @@ -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,11 +41,26 @@ public class DropTable { } public DropTableElement getDropTableData() { - if(getDropType().equalsIgnoreCase("DROP")) { + if (getDropType().equalsIgnoreCase("DROP")) { return BossesGson.get().fromJson(this.rewards, DropTableElement.class); } return null; } + public String getDropType() { + return this.dropType; + } + + 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 44f0f10..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 @@ -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<String, Double> dropRewards; - @Expose @Getter @Setter private Boolean randomDrops; - @Expose @Getter @Setter private Integer dropMaxDrops; + @Expose + private Map<String, Double> dropRewards; + @Expose + private Boolean randomDrops; + @Expose + private Integer dropMaxDrops; public DropTableElement(Map<String, Double> dropRewards, Boolean randomDrops, Integer dropMaxDrops) { this.dropRewards = dropRewards; @@ -23,4 +24,27 @@ public class DropTableElement { this.dropMaxDrops = dropMaxDrops; } + public Map<String, Double> getDropRewards() { + return this.dropRewards; + } + + public void setDropRewards(Map<String, Double> 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/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<String, Map<String, GiveTableSubElement>> giveRewards; + @Expose + private Map<String, Map<String, GiveTableSubElement>> giveRewards; public GiveTableElement(Map<String, Map<String, GiveTableSubElement>> giveRewards) { this.giveRewards = giveRewards; } + public Map<String, Map<String, GiveTableSubElement>> getGiveRewards() { + return this.giveRewards; + } + + public void setGiveRewards(Map<String, Map<String, GiveTableSubElement>> 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..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 @@ -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<String, Double> 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<String, Double> items, commands; + @Expose + private Integer maxDrops, maxCommands; + @Expose + private Boolean randomDrops, randomCommands; + @Expose + private Double requiredPercentage; public GiveTableSubElement(Map<String, Double> items, Map<String, Double> 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<String, Double> getItems() { + return this.items; + } + + public void setItems(Map<String, Double> items) { + this.items = items; + } + + public Map<String, Double> getCommands() { + return this.commands; + } + + public void setCommands(Map<String, Double> 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 9dc12a6..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 @@ -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<String, Double> sprayRewards; - @Expose @Getter @Setter private Boolean randomSprayDrops; - @Expose @Getter @Setter private Integer sprayMaxDistance, sprayMaxDrops; + @Expose + private Map<String, Double> sprayRewards; + @Expose + private Boolean randomSprayDrops; + @Expose + private Integer sprayMaxDistance, sprayMaxDrops; public SprayTableElement(Map<String, Double> sprayRewards, Boolean randomSprayDrops, Integer sprayMaxDistance, Integer sprayMaxDrops) { this.sprayRewards = sprayRewards; @@ -24,4 +25,35 @@ public class SprayTableElement { this.sprayMaxDrops = sprayMaxDrops; } + public Map<String, Double> getSprayRewards() { + return this.sprayRewards; + } + + public void setSprayRewards(Map<String, Double> 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/entity/BossEntity.java b/plugin-modules/Core/src/com/songoda/epicbosses/entity/BossEntity.java index b658c9b..54fd6be 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,22 @@ 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 @Getter private final List<EntityStatsElement> 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<EntityStatsElement> entityStats; + @Expose + private final MessagesElement messages; + @Expose + private final CommandsElement commands; + @Expose + 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<EntityStatsElement> entityStats, SkillsElement skills, DropsElement drops, MessagesElement messages, CommandsElement commands) { this.editing = editing; @@ -41,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(); @@ -55,24 +58,24 @@ public class BossEntity { public List<String> getIncompleteSectionsToEnable() { List<String> 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"); } } } @@ -81,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(); @@ -101,4 +104,64 @@ public class BossEntity { public boolean canBeBought() { return !isEditing() && isBuyable() && (getPrice() != null) && isCompleteEnoughToSpawn(); } + + public String getSpawnItem() { + 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<EntityStatsElement> 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; + } } 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..031837d 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<EntityStatsElement> entityStats; + @Expose + private final List<EntityStatsElement> 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<EntityStatsElement> entityStats) { this.editing = editing; this.entityStats = entityStats; } + + public List<EntityStatsElement> getEntityStats() { + return this.entityStats; + } + + 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; + } } 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..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 @@ -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 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 55c0b77..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 @@ -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 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 b85c801..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 @@ -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<PotionEffectHolder> potions; + @Expose + private MainStatsElement mainStats; + @Expose + private EquipmentElement equipment; + @Expose + private HandsElement hands; + @Expose + private List<PotionEffectHolder> potions; public EntityStatsElement(MainStatsElement mainStatsElement, EquipmentElement equipmentElement, HandsElement handsElement, List<PotionEffectHolder> potionEffectHolders) { this.mainStats = mainStatsElement; @@ -26,4 +28,35 @@ public class EntityStatsElement { this.potions = potionEffectHolders; } + public MainStatsElement getMainStats() { + return this.mainStats; + } + + 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<PotionEffectHolder> getPotions() { + return this.potions; + } + + public void setPotions(List<PotionEffectHolder> 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..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 @@ -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 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 7c2e2d0..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 @@ -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 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 ab4457e..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 @@ -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 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 c45e407..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 @@ -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 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 c22e13c..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 @@ -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 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 109fed3..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 @@ -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 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 b5a40c9..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 @@ -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<String> skills; + @Expose + private Double overallChance; + @Expose + private String masterMessage; + @Expose + private List<String> skills; public SkillsElement(Double overallChance, String masterMessage, List<String> skills) { this.overallChance = overallChance; @@ -23,4 +24,27 @@ public class SkillsElement { this.skills = skills; } + public Double getOverallChance() { + return this.overallChance; + } + + public void setOverallChance(Double overallChance) { + this.overallChance = overallChance; + } + + public String getMasterMessage() { + return this.masterMessage; + } + + public void setMasterMessage(String masterMessage) { + this.masterMessage = masterMessage; + } + + public List<String> getSkills() { + return this.skills; + } + + public void setSkills(List<String> 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..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 @@ -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<String> taunts; + @Expose + private Integer delay, radius; + @Expose + private List<String> taunts; public TauntElement(Integer delay, Integer radius, List<String> taunts) { this.delay = delay; @@ -22,4 +22,27 @@ public class TauntElement { this.taunts = taunts; } + public Integer getDelay() { + return this.delay; + } + + public void setDelay(Integer delay) { + this.delay = delay; + } + + public Integer getRadius() { + return this.radius; + } + + public void setRadius(Integer radius) { + this.radius = radius; + } + + public List<String> getTaunts() { + return this.taunts; + } + + public void setTaunts(List<String> 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..3f325ee 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; @@ -28,12 +27,28 @@ public class BossDamageEvent extends Event { this.damage = damageAmount; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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..e26c927 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,20 +13,28 @@ 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; this.autoSpawn = autoSpawn; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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..621b797 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; @@ -26,12 +25,24 @@ public class BossSkillEvent extends Event { this.skill = skill; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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..7034503 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,20 +13,28 @@ 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; this.autoSpawn = autoSpawn; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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..1a66142 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; @@ -26,12 +25,24 @@ public class PreBossDeathEvent extends Event { this.killer = killer; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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..6b751de 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; @@ -24,12 +23,24 @@ public class PreBossSkillEvent extends Event { this.damagingEntity = damagingEntity; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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..3f32f54 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,18 +13,22 @@ 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; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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..7686d73 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); @@ -26,12 +24,20 @@ public class PreBossSpawnItemEvent extends PreBossSpawnEvent { this.player = player; } + public static HandlerList getHandlerList() { + return handlers; + } + @Override public HandlerList getHandlers() { return handlers; } - 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/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<Map<String, AutoSpawn>> { 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<Map<String, AutoSpawn>> { public void saveFile(Map<String, AutoSpawn> map) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, AutoSpawn>>(){}.getType(); + Type type = new TypeToken<Map<String, AutoSpawn>>() { + }.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<Map<String, BossEntity>> { 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<Map<String, BossEntity>> { public void saveFile(Map<String, BossEntity> map) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, BossEntity>>(){}.getType(); + Type type = new TypeToken<Map<String, BossEntity>>() { + }.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<Map<String, List<String>>> fileReader.close(); - if(jsonObject != null) { - Type listType = new TypeToken<List<String>>(){}.getType(); + if (jsonObject != null) { + Type listType = new TypeToken<List<String>>() { + }.getType(); jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); @@ -65,7 +66,8 @@ public class CommandsFileHandler extends FileHandler<Map<String, List<String>>> public void saveFile(Map<String, List<String>> stringListMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, List<String>>>(){}.getType(); + Type type = new TypeToken<Map<String, List<String>>>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(stringListMap), type)); fileWriter.flush(); 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/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<Map<String, DropTable>> { 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<Map<String, DropTable>> { public void saveFile(Map<String, DropTable> stringDropTableMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, ItemStackHolder>>(){}.getType(); + Type type = new TypeToken<Map<String, ItemStackHolder>>() { + }.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 720e2dd..ff97eae 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; @@ -46,7 +44,7 @@ public class ItemStackFileHandler extends FileHandler<Map<String, ItemStackHolde fileReader.close(); - if(jsonObject != null) { + if (jsonObject != null) { jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); ItemStackHolder itemStackHolder = GSON.fromJson(entry.getValue(), ItemStackHolder.class); @@ -65,7 +63,8 @@ public class ItemStackFileHandler extends FileHandler<Map<String, ItemStackHolde public void saveFile(Map<String, ItemStackHolder> map) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, ItemStackHolder>>(){}.getType(); + Type type = new TypeToken<Map<String, ItemStackHolder>>() { + }.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<Map<String, List<String>>> fileReader.close(); - if(jsonObject != null) { - Type listType = new TypeToken<List<String>>(){}.getType(); + if (jsonObject != null) { + Type listType = new TypeToken<List<String>>() { + }.getType(); jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); @@ -65,7 +66,8 @@ public class MessagesFileHandler extends FileHandler<Map<String, List<String>>> public void saveFile(Map<String, List<String>> stringListMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, List<String>>>(){}.getType(); + Type type = new TypeToken<Map<String, List<String>>>() { + }.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 39d93e4..9700f19 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; @@ -45,7 +44,7 @@ public class MinionsFileHandler extends FileHandler<Map<String, MinionEntity>> { fileReader.close(); - if(jsonObject != null) { + if (jsonObject != null) { jsonObject.entrySet().forEach(entry -> { String id = entry.getKey(); MinionEntity minionEntity = GSON.fromJson(entry.getValue(), MinionEntity.class); @@ -64,7 +63,8 @@ public class MinionsFileHandler extends FileHandler<Map<String, MinionEntity>> { public void saveFile(Map<String, MinionEntity> stringMinionEntityMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, MinionEntity>>(){}.getType(); + Type type = new TypeToken<Map<String, MinionEntity>>() { + }.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<Map<String, Skill>> { 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<Map<String, Skill>> { public void saveFile(Map<String, Skill> skillMap) { try { FileWriter fileWriter = new FileWriter(getFile()); - Type type = new TypeToken<Map<String, Skill>>(){}.getType(); + Type type = new TypeToken<Map<String, Skill>>() { + }.getType(); fileWriter.write(GSON.toJson(new HashMap<>(skillMap), type)); fileWriter.flush(); 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..61101f8 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<AutoSpawn> panelHandler; + private final IVariablePanelHandler<AutoSpawn> 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<AutoSpawn> panelHandler) { @@ -59,28 +57,28 @@ 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) { - Bukkit.getScheduler().scheduleSyncDelayedTask(CustomBosses.get(), AutoSpawnVariableHandler.this::finish); + 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(); 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<AutoSpawn> 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..e9802bd 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<BossEntity, EntityStatsElement> panelHandler; + private final ISubVariablePanelHandler<BossEntity, EntityStatsElement> 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<BossEntity, EntityStatsElement> panelHandler) { @@ -56,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; } @@ -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<BossEntity, EntityStatsElement> 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..19871e7 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<BossEntity> panelHandler; + private final IVariablePanelHandler<BossEntity> 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<BossEntity> panelHandler) { @@ -56,25 +54,25 @@ 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(); 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<BossEntity> 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..0f6c62e 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<Skill> panelHandler; - @Getter private final SkillsFileManager skillsFileManager; - @Getter private final Player player; - @Getter private final Skill skill; + private final IVariablePanelHandler<Skill> 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<Skill> panelHandler) { @@ -52,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; } @@ -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<Skill> 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/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<List<String>> public List<String> getListItem(String id) { List<String> 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 cc93a1b..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 @@ -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<ItemStack> { private ItemsFileManager itemsFileManager; - public GetDropTableItemStack(CustomBosses plugin) { + public GetDropTableItemStack(EpicBosses plugin) { this.itemsFileManager = plugin.getItemStackManager(); } @@ -25,14 +25,14 @@ public class GetDropTableItemStack implements IGetDropTableListItem<ItemStack> { 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/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<ActiveBossHolder> activeBossHolders = new ArrayList<>(); + private List<ActiveBossHolder> 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<ActiveBossHolder> 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 aa34499..d7fea15 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; @@ -24,18 +21,18 @@ import java.util.stream.Collectors; */ 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<Integer, ActiveMinionHolder> activeMinionHolderMap = new HashMap<>(); - @Getter private Map<Integer, UUID> livingEntityMap = new HashMap<>(); - @Getter private List<IBossDeathHandler> postBossDeathHandlers = new ArrayList<>(); - @Getter private Map<UUID, Double> mapOfDamagingUsers = new HashMap<>(); - @Getter private String spawningPlayerName; + private Map<Integer, ActiveMinionHolder> activeMinionHolderMap = new HashMap<>(); + private Map<Integer, UUID> livingEntityMap = new HashMap<>(); + private List<IBossDeathHandler> postBossDeathHandlers = new ArrayList<>(); + private Map<UUID, Double> mapOfDamagingUsers = new HashMap<>(); + private String spawningPlayerName; - @Getter @Setter private TargetHandler<ActiveBossHolder> targetHandler = null; - @Getter @Setter private boolean isDead = false, customSpawnMessage = false; + private TargetHandler<ActiveBossHolder> targetHandler = null; + private boolean isDead = false, customSpawnMessage = false; public ActiveBossHolder(BossEntity bossEntity, Location spawnLocation, String name, Player spawningPlayer) { this.location = spawnLocation; @@ -123,4 +120,60 @@ public class ActiveBossHolder implements IActiveHolder { return true; } + + public BossEntity getBossEntity() { + return this.bossEntity; + } + + public Location getLocation() { + return this.location; + } + + public String getName() { + return this.name; + } + + public Map<Integer, ActiveMinionHolder> getActiveMinionHolderMap() { + return this.activeMinionHolderMap; + } + + public Map<Integer, UUID> getLivingEntityMap() { + return this.livingEntityMap; + } + + public List<IBossDeathHandler> getPostBossDeathHandlers() { + return this.postBossDeathHandlers; + } + + public Map<UUID, Double> getMapOfDamagingUsers() { + return this.mapOfDamagingUsers; + } + + public String getSpawningPlayerName() { + return this.spawningPlayerName; + } + + public TargetHandler<ActiveBossHolder> getTargetHandler() { + return this.targetHandler; + } + + public void setTargetHandler(TargetHandler<ActiveBossHolder> 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 6f78139..0468391 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; @@ -22,13 +19,12 @@ import org.bukkit.entity.Entity; */ public class ActiveMinionHolder implements IActiveHolder { - @Getter @Setter private TargetHandler<ActiveMinionHolder> targetHandler = null; - - @Getter private Map<Integer, UUID> livingEntityMap = new HashMap<>(); - @Getter private ActiveBossHolder activeBossHolder; - @Getter private final MinionEntity minionEntity; - @Getter private final Location location; - @Getter private final String name; + private final MinionEntity minionEntity; + private final Location location; + private final String name; + private TargetHandler<ActiveMinionHolder> targetHandler = null; + private Map<Integer, UUID> livingEntityMap = new HashMap<>(); + private ActiveBossHolder activeBossHolder; public ActiveMinionHolder(ActiveBossHolder activeBossHolder, MinionEntity minionEntity, Location spawnLocation, String name) { this.activeBossHolder = activeBossHolder; @@ -44,7 +40,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(); @@ -93,11 +89,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; @@ -108,4 +104,31 @@ public class ActiveMinionHolder implements IActiveHolder { return this.activeBossHolder.hasAttacked(uuid); } + public TargetHandler<ActiveMinionHolder> getTargetHandler() { + return this.targetHandler; + } + + public void setTargetHandler(TargetHandler<ActiveMinionHolder> targetHandler) { + this.targetHandler = targetHandler; + } + + public Map<Integer, UUID> 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; + } } 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<UUID, Double> sortedDamageMap, percentageMap; - @Getter private final BossEntity bossEntity; - @Getter private final Location location; + private final Map<UUID, Double> sortedDamageMap, percentageMap; + private final BossEntity bossEntity; + private final Location location; public DeadBossHolder(BossEntity bossEntity, Location deathLocation, Map<UUID, Double> sortedDamageMap, Map<UUID, Double> percentageMap) { this.location = deathLocation; @@ -25,4 +24,19 @@ public class DeadBossHolder { this.percentageMap = percentageMap; } + public Map<UUID, Double> getSortedDamageMap() { + return this.sortedDamageMap; + } + + public Map<UUID, Double> 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..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 @@ -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); @@ -40,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; } @@ -55,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."); } @@ -84,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; } @@ -101,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; @@ -109,7 +104,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder { ServerUtils.get().logDebug("AutoSpawn Spawn Attempt: " + this.intervalSpawnElement.attemptSpawn(this)); - if(isSpawnAfterLastBossIsKilled()) { + if (isSpawnAfterLastBossIsKilled()) { cancelCurrentInterval(); return; } @@ -134,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; } @@ -144,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(); } @@ -156,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; } @@ -164,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; } @@ -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..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 @@ -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(); } @@ -44,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); @@ -86,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); } @@ -95,19 +97,19 @@ public class BossDeathListener implements Listener { ServerUtils.get().runTaskAsync(() -> { List<String> positionsMessage = this.bossEntityManager.getOnDeathPositionMessage(bossEntity); - if(messages != null) { - if(positionsMessage != null) { + if (messages != null) { + if (positionsMessage != null) { List<String> finalPositionsMessage = new ArrayList<>(); int current = 1; - for(Map.Entry<UUID, Double> entry : mapOfDamage.entrySet()) { - if(current > onlyShow) break; + for (Map.Entry<UUID, Double> entry : mapOfDamage.entrySet()) { + if (current > onlyShow) break; List<String> 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; @@ -125,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<String> 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); @@ -153,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 3807871..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 @@ -1,9 +1,12 @@ package com.songoda.epicbosses.listeners.during; -import com.songoda.epicbosses.CustomBosses; +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(CustomBosses plugin) { + public BossDamageListener(EpicBosses plugin) { this.bossEntityManager = plugin.getBossEntityManager(); + this.bossesFileManager = plugin.getBossesFileManager(); } @EventHandler(priority = EventPriority.MONITOR) @@ -29,37 +34,55 @@ 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) { + // 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]; - if(entityDamaging instanceof Player) { + 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; + } + + 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/BossMinionTargetListener.java b/plugin-modules/Core/src/com/songoda/epicbosses/listeners/during/BossMinionTargetListener.java index 578bfda..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 @@ -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(); } @@ -31,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; @@ -41,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; } 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..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 @@ -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(); @@ -46,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; @@ -57,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); @@ -83,7 +84,7 @@ public class BossSkillListener implements Listener { List<String> skills = bossEntity.getSkills().getSkills(); List<String> masterMessage = BossAPI.getStoredMessages(bossEntity.getSkills().getMasterMessage()); - if(skills.isEmpty()) { + if (skills.isEmpty()) { Debug.SKILL_EMPTY_SKILLS.debug(BossAPI.getBossEntityName(bossEntity)); return; } @@ -93,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 2d8f66b..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 @@ -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,8 @@ 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 +24,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; @@ -43,13 +38,11 @@ public class BossSpawnListener implements Listener { private BossLocationManager bossLocationManager; private BossEntityManager bossEntityManager; 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.bossTauntManager = epicBosses.getBossTauntManager(); + this.bossEntityManager = epicBosses.getBossEntityManager(); + this.bossLocationManager = epicBosses.getBossLocationManager(); } @EventHandler @@ -59,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<BossEntity, ItemStack> entitiesAndSpawnItems = this.bossEntityManager.getMapOfEntitiesAndSpawnItems(); - ItemStack itemStack = this.versionHandler.getItemInHand(player); + ItemStack itemStack = player.getItemInHand(); BossEntity bossEntity = null; - for(Map.Entry<BossEntity, ItemStack> entry : entitiesAndSpawnItems.entrySet()) { - if(ItemStackUtils.isItemStackSame(itemStack, entry.getValue())) { + for (Map.Entry<BossEntity, ItemStack> 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; @@ -84,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; @@ -98,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); } } @@ -123,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(); @@ -147,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 6cd9bd2..b83b490 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; @@ -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 @@ -27,14 +24,18 @@ public class AutoSpawnManager { private AutoSpawnFileManager autoSpawnFileManager; - public AutoSpawnManager(CustomBosses plugin) { + public AutoSpawnManager(EpicBosses plugin) { this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); } + public static ICustomSettingAction createAutoSpawnAction(String name, String current, List<String> extraInformation, ItemStack displayStack, ClickAction clickAction) { + return new CustomAutoSpawnActionCreator(name, current, extraInformation, displayStack, clickAction); + } + public void startIntervalSystems() { Map<String, AutoSpawn> autoSpawnMap = this.autoSpawnFileManager.getAutoSpawnMap(); - if(!this.activeAutoSpawnHolders.isEmpty()) { + if (!this.activeAutoSpawnHolders.isEmpty()) { stopIntervalSystems(); } @@ -56,19 +57,22 @@ public class AutoSpawnManager { List<String> intervalAutoSpawns = new ArrayList<>(); autoSpawnHolderMap.forEach((name, autoSpawnHolder) -> { - if(autoSpawnHolder.getSpawnType() == SpawnType.INTERVAL) { + if (autoSpawnHolder.getSpawnType() == SpawnType.INTERVAL) { intervalAutoSpawns.add(name); } }); return intervalAutoSpawns; } + public Map<String, ActiveAutoSpawnHolder> getAutoSpawns() { + return Collections.unmodifiableMap(this.activeAutoSpawnHolders); + } public boolean exists(String name) { List<String> 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<String> extraInformation, ItemStack displayStack, ClickAction clickAction) { - return new CustomAutoSpawnActionCreator(name, current, extraInformation, displayStack, clickAction); - } - private static class CustomAutoSpawnActionCreator implements ICustomSettingAction { private final List<String> 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 deleted file mode 100644 index 3e8762e..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.CustomBosses; -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 CustomBosses customBosses; - - public BossCommandManager(SubCommandService<?> commandService, CustomBosses customBosses) { - this.commandService = commandService; - this.customBosses = customBosses; - } - - @Override - public void load() { - if(this.hasBeenLoaded) { - Debug.FAILED_TO_LOAD_BOSSCOMMANDMANAGER.debug(); - 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 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.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..20e56f8 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<String> validDropTableTypes = Arrays.asList("SPRAY", "DROP", "GIVE"); + private final List<String> validDropTableTypes = Arrays.asList("SPRAY", "DROP", "GIVE"); private final IGetDropTableListItem<ItemStack> getDropTableItemStack; private final IGetDropTableListItem<List<String>> getDropTableCommand; - public BossDropTableManager(CustomBosses plugin) { + public BossDropTableManager(EpicBosses plugin) { this.getDropTableItemStack = new GetDropTableItemStack(plugin); this.getDropTableCommand = new GetDropTableCommand(); } @@ -46,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); } @@ -57,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); } @@ -71,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); @@ -86,20 +81,20 @@ public class BossDropTableManager { List<ItemStack> totalRewards = new ArrayList<>(); List<String> 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())); @@ -109,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); @@ -122,21 +117,21 @@ public class BossDropTableManager { private List<ItemStack> getCustomRewards(boolean random, int max, Map<String, Double> chanceMap) { List<ItemStack> newListToMerge = new ArrayList<>(); - if(chanceMap == null) return newListToMerge; + if (chanceMap == null) return newListToMerge; List<String> 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; } @@ -150,21 +145,21 @@ public class BossDropTableManager { private List<String> getCommands(boolean random, int max, Map<String, Double> chanceMap) { List<String> newListToMerge = new ArrayList<>(); - if(chanceMap == null) return newListToMerge; + if (chanceMap == null) return newListToMerge; List<String> 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<String> commands = this.getDropTableCommand.getListItem(itemName); - if(commands == null) { + if (commands == null) { Debug.DROP_TABLE_FAILED_TO_GET_ITEM.debug(); continue; } @@ -175,4 +170,7 @@ public class BossDropTableManager { return newListToMerge; } + public List<String> 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 2905f2c..5484a8a 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; @@ -53,23 +53,23 @@ 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) { - 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); amountOfBosses++; @@ -117,14 +117,14 @@ public class BossEntityManager { } } - CustomBosses.get().getAutoSpawnManager().clearAutoSpawns(); + EpicBosses.getInstance().getAutoSpawnManager().clearAutoSpawns(); return amountOfBosses; } 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(); @@ -137,19 +137,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; } @@ -158,20 +158,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; } @@ -183,7 +183,7 @@ public class BossEntityManager { String id = bossEntity.getMessages().getOnSpawn().getMessage(); List<String> messages = BossAPI.getStoredMessages(id); - if(messages == null) { + if (messages == null) { Debug.FAILED_TO_LOAD_MESSAGES.debug(id); return Collections.EMPTY_LIST; } @@ -194,7 +194,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; } @@ -203,7 +203,7 @@ public class BossEntityManager { String id = bossEntity.getCommands().getOnSpawn(); List<String> commands = BossAPI.getStoredCommands(id); - if(commands == null) { + if (commands == null) { Debug.FAILED_TO_LOAD_COMMANDS.debug(id); return Collections.EMPTY_LIST; } @@ -215,7 +215,7 @@ public class BossEntityManager { String id = bossEntity.getMessages().getOnDeath().getMessage(); List<String> messages = BossAPI.getStoredMessages(id); - if(messages == null) { + if (messages == null) { Debug.FAILED_TO_LOAD_MESSAGES.debug(id); return Collections.EMPTY_LIST; } @@ -226,7 +226,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; } @@ -234,7 +234,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; } @@ -243,7 +243,7 @@ public class BossEntityManager { String id = bossEntity.getMessages().getOnDeath().getPositionMessage(); List<String> messages = BossAPI.getStoredMessages(id); - if(messages == null) { + if (messages == null) { Debug.FAILED_TO_LOAD_MESSAGES.debug(id); return null; } @@ -255,7 +255,7 @@ public class BossEntityManager { String id = bossEntity.getCommands().getOnDeath(); List<String> commands = BossAPI.getStoredCommands(id); - if(commands == null) { + if (commands == null) { Debug.FAILED_TO_LOAD_COMMANDS.debug(id); return null; } @@ -285,24 +285,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); @@ -317,9 +317,9 @@ public class BossEntityManager { public ActiveBossHolder getActiveBossHolder(LivingEntity livingEntity) { List<ActiveBossHolder> currentList = getActiveBossHolders(); - for(ActiveBossHolder activeBossHolder : currentList) { - for(Map.Entry<Integer, UUID> entry : activeBossHolder.getLivingEntityMap().entrySet()) { - if(entry.getValue().equals(livingEntity.getUniqueId())) return activeBossHolder; + for (ActiveBossHolder activeBossHolder : currentList) { + for (Map.Entry<Integer, UUID> entry : activeBossHolder.getLivingEntityMap().entrySet()) { + if (entry.getValue().equals(livingEntity.getUniqueId())) return activeBossHolder; } } @@ -327,7 +327,7 @@ public class BossEntityManager { } public void removeActiveBossHolder(ActiveBossHolder activeBossHolder) { - for(Map.Entry<Integer, UUID> entry : activeBossHolder.getLivingEntityMap().entrySet()) { + for (Map.Entry<Integer, UUID> entry : activeBossHolder.getLivingEntityMap().entrySet()) { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(entry.getValue()); if (livingEntity != null && !livingEntity.isDead()) livingEntity.remove(); @@ -337,7 +337,7 @@ public class BossEntityManager { } public boolean isAllEntitiesDead(ActiveBossHolder activeBossHolder) { - for(Map.Entry<Integer, UUID> entry : activeBossHolder.getLivingEntityMap().entrySet()) { + for (Map.Entry<Integer, UUID> entry : activeBossHolder.getLivingEntityMap().entrySet()) { LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(entry.getValue()); if (livingEntity != null && !livingEntity.isDead()) return false; @@ -360,14 +360,14 @@ public class BossEntityManager { Map<UUID, Double> 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; @@ -386,23 +386,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<ItemStack> 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<ItemStack> itemStacks = this.bossDropTableManager.getDropItems(dropTableElement); @@ -415,7 +415,7 @@ public class BossEntityManager { private void sprayDrops(SprayTableElement sprayTableElement, List<ItemStack> rewards, DeadBossHolder deadBossHolder) { Integer maximumDistance = sprayTableElement.getSprayMaxDistance(); - if(maximumDistance == null) maximumDistance = 10; + if (maximumDistance == null) maximumDistance = 10; Location deathLocation = deadBossHolder.getLocation(); Integer finalMaximumDistance = maximumDistance; @@ -427,8 +427,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 dbdc69f..23511cf 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossHookManager.java @@ -1,108 +1,102 @@ 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 java.util.List; +import utils.factions.FactionsM; +import utils.factions.FactionsOne; +import utils.factions.FactionsUUID; +import utils.factions.LegacyFactions; /** * @author Charles Cullen * @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<String> worldGuardSpawnRegions, worldguardBlockedRegions; - @Getter private boolean askyblockOwnIsland, factionWarzone; + private final EpicBosses plugin; + private boolean askyblockEnabled, factionsEnabled; + private boolean askyblockOwnIsland, factionWarzone; + private IASkyblockHelper aSkyblockHelper; + private IFactionHelper factionHelper; - @Getter private IWorldGuardHelper worldGuardHelper; - @Getter private IASkyblockHelper aSkyblockHelper; - @Getter private IFactionHelper factionHelper; - - private final CustomBosses 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..9f495f4 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,15 +18,15 @@ 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; } @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 1e0bed1..4dde9cd 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,14 @@ import java.util.List; */ public class BossLocationManager implements IReloadable { - @Getter private boolean useBlockedWorlds; - @Getter private List<String> blockedWorlds; - private final BossHookManager bossHookManager; - private final CustomBosses plugin; + private final EpicBosses plugin; + private boolean useBlockedWorlds; + private List<String> blockedWorlds; - 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 +37,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 +51,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<String> 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<String> 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 +91,11 @@ public class BossLocationManager implements IReloadable { return true; } + public boolean isUseBlockedWorlds() { + return this.useBlockedWorlds; + } + + public List<String> 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..5c42497 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; @@ -20,11 +19,11 @@ import java.util.Queue; */ public class BossMechanicManager implements IMechanicManager<BossEntity, ActiveBossHolder, IBossMechanic> { + private final EpicBosses epicBosses; private Queue<IBossMechanic> mechanics; - private final CustomBosses customBosses; - public BossMechanicManager(CustomBosses customBosses) { - this.customBosses = customBosses; + public BossMechanicManager(EpicBosses epicBosses) { + this.epicBosses = epicBosses; } @Override @@ -34,8 +33,8 @@ public class BossMechanicManager implements IMechanicManager<BossEntity, ActiveB registerMechanic(new EntityTypeMechanic()); registerMechanic(new NameMechanic()); registerMechanic(new HealthMechanic()); - registerMechanic(new EquipmentMechanic(this.customBosses.getItemStackManager())); - registerMechanic(new WeaponMechanic(this.customBosses.getItemStackManager())); + registerMechanic(new EquipmentMechanic(this.epicBosses.getItemStackManager())); + registerMechanic(new WeaponMechanic(this.epicBosses.getItemStackManager())); registerMechanic(new PotionMechanic()); registerMechanic(new SettingsMechanic()); } @@ -47,22 +46,22 @@ public class BossMechanicManager implements IMechanicManager<BossEntity, ActiveB @Override public void handleMechanicApplication(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(bossEntity != null && activeBossHolder != null) { - if(bossEntity.isEditing()) { + if (bossEntity != null && activeBossHolder != null) { + if (bossEntity.isEditing()) { Debug.ATTEMPTED_TO_SPAWN_WHILE_DISABLED.debug(); return; } Queue<IBossMechanic> 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()); } } @@ -70,9 +69,9 @@ public class BossMechanicManager implements IMechanicManager<BossEntity, ActiveB } private boolean didMechanicApplicationFail(IBossMechanic mechanic, BossEntity bossEntity, ActiveBossHolder activeBossHolder) { - if(mechanic == null) return true; + if (mechanic == null) return true; - if(!mechanic.applyMechanic(bossEntity, activeBossHolder)) { + if (!mechanic.applyMechanic(bossEntity, activeBossHolder)) { Debug.MECHANIC_APPLICATION_FAILED.debug(mechanic.getClass().getSimpleName()); return true; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java index 638e738..cf27839 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossPanelManager.java @@ -1,5 +1,6 @@ package com.songoda.epicbosses.managers; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.autospawns.AutoSpawn; import com.songoda.epicbosses.droptable.DropTable; @@ -10,19 +11,23 @@ import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.elements.EntityStatsElement; import com.songoda.epicbosses.entity.elements.EquipmentElement; import com.songoda.epicbosses.entity.elements.HandsElement; +import com.songoda.epicbosses.panel.*; import com.songoda.epicbosses.panel.additems.CustomItemsAddItemsParentPanelHandler; import com.songoda.epicbosses.panel.autospawns.*; import com.songoda.epicbosses.panel.bosses.*; import com.songoda.epicbosses.panel.bosses.commands.OnDeathCommandEditor; import com.songoda.epicbosses.panel.bosses.commands.OnSpawnCommandEditor; -import com.songoda.epicbosses.panel.bosses.list.BossListEquipmentEditorPanel; import com.songoda.epicbosses.panel.bosses.equipment.BootsEditorPanel; import com.songoda.epicbosses.panel.bosses.equipment.ChestplateEditorPanel; import com.songoda.epicbosses.panel.bosses.equipment.HelmetEditorPanel; import com.songoda.epicbosses.panel.bosses.equipment.LeggingsEditorPanel; +import com.songoda.epicbosses.panel.bosses.list.BossListEquipmentEditorPanel; import com.songoda.epicbosses.panel.bosses.list.BossListStatisticEditorPanel; import com.songoda.epicbosses.panel.bosses.list.BossListWeaponEditorPanel; -import com.songoda.epicbosses.panel.bosses.text.*; +import com.songoda.epicbosses.panel.bosses.text.DeathTextEditorPanel; +import com.songoda.epicbosses.panel.bosses.text.SkillMasterMessageTextEditorPanel; +import com.songoda.epicbosses.panel.bosses.text.SpawnTextEditorPanel; +import com.songoda.epicbosses.panel.bosses.text.TauntTextEditorPanel; import com.songoda.epicbosses.panel.bosses.weapons.MainHandEditorPanel; import com.songoda.epicbosses.panel.bosses.weapons.OffHandEditorPanel; import com.songoda.epicbosses.panel.droptables.DropTableTypeEditorPanel; @@ -48,12 +53,14 @@ import com.songoda.epicbosses.panel.droptables.types.spray.SprayDropNewRewardPan import com.songoda.epicbosses.panel.droptables.types.spray.SprayDropRewardListPanel; import com.songoda.epicbosses.panel.droptables.types.spray.SprayDropRewardMainEditPanel; import com.songoda.epicbosses.panel.droptables.types.spray.SprayDropTableMainEditorPanel; -import com.songoda.epicbosses.panel.handlers.*; +import com.songoda.epicbosses.panel.handlers.ListMessageListEditor; +import com.songoda.epicbosses.panel.handlers.SingleMessageListEditor; import com.songoda.epicbosses.panel.skills.MainSkillEditorPanel; import com.songoda.epicbosses.panel.skills.SkillTypeEditorPanel; import com.songoda.epicbosses.panel.skills.custom.CommandSkillEditorPanel; import com.songoda.epicbosses.panel.skills.custom.CustomSkillEditorPanel; import com.songoda.epicbosses.panel.skills.custom.GroupSkillEditorPanel; +import com.songoda.epicbosses.panel.skills.custom.PotionSkillEditorPanel; import com.songoda.epicbosses.panel.skills.custom.commands.CommandListSkillEditorPanel; import com.songoda.epicbosses.panel.skills.custom.commands.ModifyCommandEditorPanel; import com.songoda.epicbosses.panel.skills.custom.custom.CustomSkillTypeEditorPanel; @@ -61,22 +68,17 @@ import com.songoda.epicbosses.panel.skills.custom.custom.MinionSelectEditorPanel import com.songoda.epicbosses.panel.skills.custom.custom.SpecialSettingsEditorPanel; import com.songoda.epicbosses.panel.skills.custom.potions.CreatePotionEffectEditorPanel; import com.songoda.epicbosses.panel.skills.custom.potions.PotionEffectTypeEditorPanel; -import com.songoda.epicbosses.panel.skills.custom.PotionSkillEditorPanel; import com.songoda.epicbosses.skills.Skill; import com.songoda.epicbosses.skills.elements.SubCommandSkillElement; import com.songoda.epicbosses.skills.types.CustomSkillElement; +import com.songoda.epicbosses.utils.ILoadable; +import com.songoda.epicbosses.utils.StringUtils; +import com.songoda.epicbosses.utils.panel.base.IPanelHandler; import com.songoda.epicbosses.utils.panel.base.ISubSubVariablePanelHandler; import com.songoda.epicbosses.utils.panel.base.ISubVariablePanelHandler; import com.songoda.epicbosses.utils.panel.base.IVariablePanelHandler; -import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder; -import lombok.Getter; -import com.songoda.epicbosses.CustomBosses; -import com.songoda.epicbosses.panel.*; -import com.songoda.epicbosses.utils.ILoadable; -import com.songoda.epicbosses.utils.IReloadable; -import com.songoda.epicbosses.utils.StringUtils; -import com.songoda.epicbosses.utils.panel.base.IPanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; +import com.songoda.epicbosses.utils.potion.holder.PotionEffectHolder; import org.bukkit.configuration.file.FileConfiguration; import java.util.Collection; @@ -89,55 +91,46 @@ import java.util.Map; * @version 1.0.0 * @since 10-Oct-18 */ -public class BossPanelManager implements ILoadable, IReloadable { +public class BossPanelManager implements ILoadable { private static final String HELMET_EDITOR_PATH = "HelmetEditorPanel", CHESTPLATE_EDITOR_PATH = "ChestplateEditorPanel", LEGGINGS_EDITOR_PATH = "LeggingsEditorPanel", BOOTS_EDITOR_PATH = "BootsEditorPanel", MAIN_HAND_EDITOR_PATH = "MainHandEditorPanel", OFF_HAND_EDITOR_PATH = "OffHandEditorPanel"; - - @Getter private IPanelHandler mainMenu, customItems, bosses, autoSpawns, dropTables, customSkills, shopPanel; - @Getter private IPanelHandler customItemAddItemsMenu; - - @Getter private ISubVariablePanelHandler<BossEntity, EntityStatsElement> equipmentEditMenu, helmetEditorMenu, chestplateEditorMenu, leggingsEditorMenu, bootsEditorMenu; - @Getter private ISubVariablePanelHandler<BossEntity, EntityStatsElement> weaponEditMenu, offHandEditorMenu, mainHandEditorMenu; - @Getter private ISubVariablePanelHandler<BossEntity, EntityStatsElement> statisticMainEditMenu, entityTypeEditMenu; - @Getter private IVariablePanelHandler<BossEntity> mainBossEditMenu, dropsEditMenu, targetingEditMenu, skillsBossEditMenu, skillListBossEditMenu, commandsMainEditMenu, onSpawnCommandEditMenu, + private final EpicBosses epicBosses; + private IPanelHandler mainMenu, customItems, bosses, autoSpawns, dropTables, customSkills, shopPanel; + private IPanelHandler customItemAddItemsMenu; + private ISubVariablePanelHandler<BossEntity, EntityStatsElement> equipmentEditMenu, helmetEditorMenu, chestplateEditorMenu, leggingsEditorMenu, bootsEditorMenu; + private ISubVariablePanelHandler<BossEntity, EntityStatsElement> weaponEditMenu, offHandEditorMenu, mainHandEditorMenu; + private ISubVariablePanelHandler<BossEntity, EntityStatsElement> statisticMainEditMenu, entityTypeEditMenu; + private IVariablePanelHandler<BossEntity> 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; - - @Getter private IVariablePanelHandler<Skill> mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel; - @Getter private ISubVariablePanelHandler<Skill, PotionEffectHolder> createPotionEffectMenu, potionEffectTypeEditMenu; - @Getter private ISubVariablePanelHandler<Skill, SubCommandSkillElement> modifyCommandEditMenu, commandListSkillEditMenu; - @Getter private ISubVariablePanelHandler<Skill, CustomSkillElement> customSkillTypeEditorMenu, specialSettingsEditorMenu, minionSelectEditorMenu; - - @Getter private IVariablePanelHandler<DropTable> mainDropTableEditMenu, dropTableTypeEditMenu; - - @Getter private ISubVariablePanelHandler<DropTable, SprayTableElement> sprayDropTableMainEditMenu; - @Getter private DropTableRewardMainEditorPanel<SprayTableElement> sprayDropRewardMainEditPanel; - @Getter private DropTableNewRewardEditorPanel<SprayTableElement> sprayDropNewRewardEditPanel; - @Getter private DropTableRewardsListEditorPanel<SprayTableElement> sprayDropRewardListPanel; - - @Getter private ISubVariablePanelHandler<DropTable, GiveRewardEditHandler> giveRewardMainEditMenu, giveCommandRewardListPanel, giveCommandNewRewardPanel; - @Getter private ISubSubVariablePanelHandler<DropTable, GiveRewardEditHandler, String> giveCommandRewardMainEditMenu; - @Getter private ISubSubVariablePanelHandler<DropTable, GiveTableElement, String> giveRewardRewardsListMenu; - @Getter private ISubVariablePanelHandler<DropTable, GiveTableElement> giveRewardPositionListMenu; - @Getter private DropTableRewardMainEditorPanel<GiveRewardEditHandler> giveDropRewardMainEditPanel; - @Getter private DropTableNewRewardEditorPanel<GiveRewardEditHandler> giveDropNewRewardEditPanel; - @Getter private DropTableRewardsListEditorPanel<GiveRewardEditHandler> giveDropRewardListPanel; - - @Getter private ISubVariablePanelHandler<DropTable, DropTableElement> dropDropTableMainEditMenu; - @Getter private DropTableRewardMainEditorPanel<DropTableElement> dropDropRewardMainEditPanel; - @Getter private DropTableNewRewardEditorPanel<DropTableElement> dropDropNewRewardEditPanel; - @Getter private DropTableRewardsListEditorPanel<DropTableElement> dropDropRewardListPanel; - - @Getter private IVariablePanelHandler<AutoSpawn> mainAutoSpawnEditPanel, autoSpawnEntitiesEditPanel, autoSpawnSpecialSettingsEditorPanel, autoSpawnTypeEditorPanel, autoSpawnCustomSettingsEditorPanel, + private BossListEditorPanel equipmentListEditMenu, weaponListEditMenu, statisticListEditMenu; + private IVariablePanelHandler<Skill> mainSkillEditMenu, customMessageEditMenu, skillTypeEditMenu, potionSkillEditorPanel, commandSkillEditorPanel, groupSkillEditorPanel, customSkillEditorPanel; + private ISubVariablePanelHandler<Skill, PotionEffectHolder> createPotionEffectMenu, potionEffectTypeEditMenu; + private ISubVariablePanelHandler<Skill, SubCommandSkillElement> modifyCommandEditMenu, commandListSkillEditMenu; + private ISubVariablePanelHandler<Skill, CustomSkillElement> customSkillTypeEditorMenu, specialSettingsEditorMenu, minionSelectEditorMenu; + private IVariablePanelHandler<DropTable> mainDropTableEditMenu, dropTableTypeEditMenu; + private ISubVariablePanelHandler<DropTable, SprayTableElement> sprayDropTableMainEditMenu; + private DropTableRewardMainEditorPanel<SprayTableElement> sprayDropRewardMainEditPanel; + private DropTableNewRewardEditorPanel<SprayTableElement> sprayDropNewRewardEditPanel; + private DropTableRewardsListEditorPanel<SprayTableElement> sprayDropRewardListPanel; + private ISubVariablePanelHandler<DropTable, GiveRewardEditHandler> giveRewardMainEditMenu, giveCommandRewardListPanel, giveCommandNewRewardPanel; + private ISubSubVariablePanelHandler<DropTable, GiveRewardEditHandler, String> giveCommandRewardMainEditMenu; + private ISubSubVariablePanelHandler<DropTable, GiveTableElement, String> giveRewardRewardsListMenu; + private ISubVariablePanelHandler<DropTable, GiveTableElement> giveRewardPositionListMenu; + private DropTableRewardMainEditorPanel<GiveRewardEditHandler> giveDropRewardMainEditPanel; + private DropTableNewRewardEditorPanel<GiveRewardEditHandler> giveDropNewRewardEditPanel; + private DropTableRewardsListEditorPanel<GiveRewardEditHandler> giveDropRewardListPanel; + private ISubVariablePanelHandler<DropTable, DropTableElement> dropDropTableMainEditMenu; + private DropTableRewardMainEditorPanel<DropTableElement> dropDropRewardMainEditPanel; + private DropTableNewRewardEditorPanel<DropTableElement> dropDropNewRewardEditPanel; + private DropTableRewardsListEditorPanel<DropTableElement> dropDropRewardListPanel; + private IVariablePanelHandler<AutoSpawn> mainAutoSpawnEditPanel, autoSpawnEntitiesEditPanel, autoSpawnSpecialSettingsEditorPanel, autoSpawnTypeEditorPanel, autoSpawnCustomSettingsEditorPanel, autoSpawnMessageEditorPanel; + private PanelBuilder addItemsBuilder; - @Getter private PanelBuilder addItemsBuilder; - private final CustomBosses customBosses; - - public BossPanelManager(CustomBosses customBosses) { - this.customBosses = customBosses; + public BossPanelManager(EpicBosses epicBosses) { + this.epicBosses = epicBosses; } @Override @@ -169,7 +162,6 @@ public class BossPanelManager implements ILoadable, IReloadable { loadAutoSpawnEditMenus(); } - @Override public void reload() { reloadMainMenu(); reloadShopMenu(); @@ -199,11 +191,11 @@ public class BossPanelManager implements ILoadable, IReloadable { } public int isItemStackUsed(String name) { - Collection<BossEntity> values = this.customBosses.getBossEntityContainer().getData().values(); + Collection<BossEntity> 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; } @@ -238,11 +230,11 @@ public class BossPanelManager implements ILoadable, IReloadable { public PanelBuilder getListMenu(String path) { Map<String, String> 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 +244,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 +282,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 +298,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 +369,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 +380,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<Skill>(this, getListMenu("Skills.MainEdit"), this.customBosses) { + this.mainSkillEditMenu = new MainSkillEditorPanel(this, panelBuilder, this.epicBosses); + this.customMessageEditMenu = new SingleMessageListEditor<Skill>(this, getListMenu("Skills.MainEdit"), this.epicBosses) { @Override public String getCurrent(Skill object) { @@ -399,7 +391,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 +404,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 +453,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<BossEntity>(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<BossEntity>(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public String getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getOnSpawn().getMessage(); @@ -493,7 +485,7 @@ public class BossPanelManager implements ILoadable, IReloadable { return BossAPI.getBossEntityName(object); } }; - this.onDeathTextEditMenu = new SingleMessageListEditor<BossEntity>(this, getListMenu("Boss.Text"), this.customBosses) { + this.onDeathTextEditMenu = new SingleMessageListEditor<BossEntity>(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public String getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getOnDeath().getMessage(); @@ -514,7 +506,7 @@ public class BossPanelManager implements ILoadable, IReloadable { return BossAPI.getBossEntityName(object); } }; - this.onDeathPositionTextEditMenu = new SingleMessageListEditor<BossEntity>(this, getListMenu("Boss.Text"), this.customBosses) { + this.onDeathPositionTextEditMenu = new SingleMessageListEditor<BossEntity>(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public String getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getOnDeath().getPositionMessage(); @@ -535,7 +527,7 @@ public class BossPanelManager implements ILoadable, IReloadable { return BossAPI.getBossEntityName(object); } }; - this.onTauntTextEditMenu = new ListMessageListEditor<BossEntity>(this, getListMenu("Boss.Text"), this.customBosses) { + this.onTauntTextEditMenu = new ListMessageListEditor<BossEntity>(this, getListMenu("Boss.Text"), this.epicBosses) { @Override public List<String> getCurrent(BossEntity bossEntity) { return bossEntity.getMessages().getTaunts().getTaunts(); @@ -545,7 +537,7 @@ public class BossPanelManager implements ILoadable, IReloadable { public void updateMessage(BossEntity bossEntity, String modifiedValue) { List<String> current = getCurrent(bossEntity); - if(current.contains(modifiedValue)) { + if (current.contains(modifiedValue)) { current.remove(modifiedValue); } else { current.add(modifiedValue); @@ -567,7 +559,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 +583,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 +605,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 +639,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 +661,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 +681,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 +701,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 +719,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 +737,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 +759,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 +777,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 +795,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 +815,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 +831,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 +849,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 +863,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 +877,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 +891,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 +905,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 +920,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<BossEntity, EntityStatsElement> getEquipmentEditMenu() { + return this.equipmentEditMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getHelmetEditorMenu() { + return this.helmetEditorMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getChestplateEditorMenu() { + return this.chestplateEditorMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getLeggingsEditorMenu() { + return this.leggingsEditorMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getBootsEditorMenu() { + return this.bootsEditorMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getWeaponEditMenu() { + return this.weaponEditMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getOffHandEditorMenu() { + return this.offHandEditorMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getMainHandEditorMenu() { + return this.mainHandEditorMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getStatisticMainEditMenu() { + return this.statisticMainEditMenu; + } + + public ISubVariablePanelHandler<BossEntity, EntityStatsElement> getEntityTypeEditMenu() { + return this.entityTypeEditMenu; + } + + public IVariablePanelHandler<BossEntity> getMainBossEditMenu() { + return this.mainBossEditMenu; + } + + public IVariablePanelHandler<BossEntity> getDropsEditMenu() { + return this.dropsEditMenu; + } + + public IVariablePanelHandler<BossEntity> getTargetingEditMenu() { + return this.targetingEditMenu; + } + + public IVariablePanelHandler<BossEntity> getSkillsBossEditMenu() { + return this.skillsBossEditMenu; + } + + public IVariablePanelHandler<BossEntity> getSkillListBossEditMenu() { + return this.skillListBossEditMenu; + } + + public IVariablePanelHandler<BossEntity> getCommandsMainEditMenu() { + return this.commandsMainEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnSpawnCommandEditMenu() { + return this.onSpawnCommandEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnDeathCommandEditMenu() { + return this.onDeathCommandEditMenu; + } + + public IVariablePanelHandler<BossEntity> getMainDropsEditMenu() { + return this.mainDropsEditMenu; + } + + public IVariablePanelHandler<BossEntity> getMainTextEditMenu() { + return this.mainTextEditMenu; + } + + public IVariablePanelHandler<BossEntity> getMainTauntEditMenu() { + return this.mainTauntEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnSpawnTextEditMenu() { + return this.onSpawnTextEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnSpawnSubTextEditMenu() { + return this.onSpawnSubTextEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnDeathTextEditMenu() { + return this.onDeathTextEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnDeathSubTextEditMenu() { + return this.onDeathSubTextEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnDeathPositionTextEditMenu() { + return this.onDeathPositionTextEditMenu; + } + + public IVariablePanelHandler<BossEntity> getOnTauntTextEditMenu() { + return this.onTauntTextEditMenu; + } + + public IVariablePanelHandler<BossEntity> getSpawnItemEditMenu() { + return this.spawnItemEditMenu; + } + + public IVariablePanelHandler<BossEntity> getBossShopEditMenu() { + return this.bossShopEditMenu; + } + + public IVariablePanelHandler<BossEntity> getBossSkillMasterMessageTextEditMenu() { + return this.bossSkillMasterMessageTextEditMenu; + } + + public BossListEditorPanel getEquipmentListEditMenu() { + return this.equipmentListEditMenu; + } + + public BossListEditorPanel getWeaponListEditMenu() { + return this.weaponListEditMenu; + } + + public BossListEditorPanel getStatisticListEditMenu() { + return this.statisticListEditMenu; + } + + public IVariablePanelHandler<Skill> getMainSkillEditMenu() { + return this.mainSkillEditMenu; + } + + public IVariablePanelHandler<Skill> getCustomMessageEditMenu() { + return this.customMessageEditMenu; + } + + public IVariablePanelHandler<Skill> getSkillTypeEditMenu() { + return this.skillTypeEditMenu; + } + + public IVariablePanelHandler<Skill> getPotionSkillEditorPanel() { + return this.potionSkillEditorPanel; + } + + public IVariablePanelHandler<Skill> getCommandSkillEditorPanel() { + return this.commandSkillEditorPanel; + } + + public IVariablePanelHandler<Skill> getGroupSkillEditorPanel() { + return this.groupSkillEditorPanel; + } + + public IVariablePanelHandler<Skill> getCustomSkillEditorPanel() { + return this.customSkillEditorPanel; + } + + public ISubVariablePanelHandler<Skill, PotionEffectHolder> getCreatePotionEffectMenu() { + return this.createPotionEffectMenu; + } + + public ISubVariablePanelHandler<Skill, PotionEffectHolder> getPotionEffectTypeEditMenu() { + return this.potionEffectTypeEditMenu; + } + + public ISubVariablePanelHandler<Skill, SubCommandSkillElement> getModifyCommandEditMenu() { + return this.modifyCommandEditMenu; + } + + public ISubVariablePanelHandler<Skill, SubCommandSkillElement> getCommandListSkillEditMenu() { + return this.commandListSkillEditMenu; + } + + public ISubVariablePanelHandler<Skill, CustomSkillElement> getCustomSkillTypeEditorMenu() { + return this.customSkillTypeEditorMenu; + } + + public ISubVariablePanelHandler<Skill, CustomSkillElement> getSpecialSettingsEditorMenu() { + return this.specialSettingsEditorMenu; + } + + public ISubVariablePanelHandler<Skill, CustomSkillElement> getMinionSelectEditorMenu() { + return this.minionSelectEditorMenu; + } + + public IVariablePanelHandler<DropTable> getMainDropTableEditMenu() { + return this.mainDropTableEditMenu; + } + + public IVariablePanelHandler<DropTable> getDropTableTypeEditMenu() { + return this.dropTableTypeEditMenu; + } + + public ISubVariablePanelHandler<DropTable, SprayTableElement> getSprayDropTableMainEditMenu() { + return this.sprayDropTableMainEditMenu; + } + + public DropTableRewardMainEditorPanel<SprayTableElement> getSprayDropRewardMainEditPanel() { + return this.sprayDropRewardMainEditPanel; + } + + public DropTableNewRewardEditorPanel<SprayTableElement> getSprayDropNewRewardEditPanel() { + return this.sprayDropNewRewardEditPanel; + } + + public DropTableRewardsListEditorPanel<SprayTableElement> getSprayDropRewardListPanel() { + return this.sprayDropRewardListPanel; + } + + public ISubVariablePanelHandler<DropTable, GiveRewardEditHandler> getGiveRewardMainEditMenu() { + return this.giveRewardMainEditMenu; + } + + public ISubVariablePanelHandler<DropTable, GiveRewardEditHandler> getGiveCommandRewardListPanel() { + return this.giveCommandRewardListPanel; + } + + public ISubVariablePanelHandler<DropTable, GiveRewardEditHandler> getGiveCommandNewRewardPanel() { + return this.giveCommandNewRewardPanel; + } + + public ISubSubVariablePanelHandler<DropTable, GiveRewardEditHandler, String> getGiveCommandRewardMainEditMenu() { + return this.giveCommandRewardMainEditMenu; + } + + public ISubSubVariablePanelHandler<DropTable, GiveTableElement, String> getGiveRewardRewardsListMenu() { + return this.giveRewardRewardsListMenu; + } + + public ISubVariablePanelHandler<DropTable, GiveTableElement> getGiveRewardPositionListMenu() { + return this.giveRewardPositionListMenu; + } + + public DropTableRewardMainEditorPanel<GiveRewardEditHandler> getGiveDropRewardMainEditPanel() { + return this.giveDropRewardMainEditPanel; + } + + public DropTableNewRewardEditorPanel<GiveRewardEditHandler> getGiveDropNewRewardEditPanel() { + return this.giveDropNewRewardEditPanel; + } + + public DropTableRewardsListEditorPanel<GiveRewardEditHandler> getGiveDropRewardListPanel() { + return this.giveDropRewardListPanel; + } + + public ISubVariablePanelHandler<DropTable, DropTableElement> getDropDropTableMainEditMenu() { + return this.dropDropTableMainEditMenu; + } + + public DropTableRewardMainEditorPanel<DropTableElement> getDropDropRewardMainEditPanel() { + return this.dropDropRewardMainEditPanel; + } + + public DropTableNewRewardEditorPanel<DropTableElement> getDropDropNewRewardEditPanel() { + return this.dropDropNewRewardEditPanel; + } + + public DropTableRewardsListEditorPanel<DropTableElement> getDropDropRewardListPanel() { + return this.dropDropRewardListPanel; + } + + public IVariablePanelHandler<AutoSpawn> getMainAutoSpawnEditPanel() { + return this.mainAutoSpawnEditPanel; + } + + public IVariablePanelHandler<AutoSpawn> getAutoSpawnEntitiesEditPanel() { + return this.autoSpawnEntitiesEditPanel; + } + + public IVariablePanelHandler<AutoSpawn> getAutoSpawnSpecialSettingsEditorPanel() { + return this.autoSpawnSpecialSettingsEditorPanel; + } + + public IVariablePanelHandler<AutoSpawn> getAutoSpawnTypeEditorPanel() { + return this.autoSpawnTypeEditorPanel; + } + + public IVariablePanelHandler<AutoSpawn> getAutoSpawnCustomSettingsEditorPanel() { + return this.autoSpawnCustomSettingsEditorPanel; + } + + public IVariablePanelHandler<AutoSpawn> 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..95b95e6 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,13 +31,17 @@ public class BossSkillManager implements ILoadable { private static final Set<CustomSkillHandler> SKILLS = new HashSet<>(); - @Getter private final List<String> validSkillTypes = Arrays.asList("Potion", "Group", "Custom", "Command"); - private CustomBosses plugin; + private final List<String> validSkillTypes = Arrays.asList("Potion", "Group", "Custom", "Command"); + private EpicBosses plugin; - public BossSkillManager(CustomBosses plugin) { + public BossSkillManager(EpicBosses plugin) { 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)); @@ -54,7 +57,7 @@ public class BossSkillManager implements ILoadable { } public void handleSkill(List<String> masterMessage, Skill skill, List<LivingEntity> targetedEntities, ActiveBossHolder activeBossHolder, boolean message, boolean subSkill) { - if(skill == null) { + if (skill == null) { Debug.SKILL_NOT_FOUND.debug(); return; } @@ -63,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); @@ -88,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)); } @@ -98,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); } @@ -106,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); } @@ -114,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); } @@ -122,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); } @@ -134,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); } @@ -153,23 +156,23 @@ public class BossSkillManager implements ILoadable { List<LivingEntity> 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); } } @@ -183,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; } @@ -193,17 +196,17 @@ 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<String> getValidSkillTypes() { + return this.validSkillTypes; } private static class CustomSkillActionCreator implements ICustomSettingAction { 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..d4605af 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; } @@ -35,11 +34,11 @@ public class BossTargetManager { String targeting = bossEntity.getTargeting(); TargetHandler<ActiveBossHolder> 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); @@ -53,11 +52,11 @@ public class BossTargetManager { String targeting = minionEntity.getTargeting(); TargetHandler<ActiveMinionHolder> 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); @@ -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..275150b 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,28 +20,28 @@ import java.util.Queue; */ public class BossTauntManager { - private CustomBosses plugin; + private EpicBosses plugin; - public BossTauntManager(CustomBosses plugin) { + public BossTauntManager(EpicBosses plugin) { this.plugin = plugin; } 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<String> 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<String> 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 d069779..bfc7dd9 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; @@ -19,11 +19,11 @@ import java.util.Queue; */ public class MinionMechanicManager implements IMechanicManager<MinionEntity, ActiveMinionHolder, IMinionMechanic> { + private final EpicBosses epicBosses; private Queue<IMinionMechanic> mechanics; - private final CustomBosses customBosses; - public MinionMechanicManager(CustomBosses customBosses) { - this.customBosses = customBosses; + public MinionMechanicManager(EpicBosses epicBosses) { + this.epicBosses = epicBosses; } @Override @@ -33,8 +33,8 @@ public class MinionMechanicManager implements IMechanicManager<MinionEntity, Act registerMechanic(new EntityTypeMechanic()); registerMechanic(new NameMechanic()); registerMechanic(new HealthMechanic()); - registerMechanic(new EquipmentMechanic(this.customBosses.getItemStackManager())); - registerMechanic(new WeaponMechanic(this.customBosses.getItemStackManager())); + registerMechanic(new EquipmentMechanic(this.epicBosses.getItemStackManager())); + registerMechanic(new WeaponMechanic(this.epicBosses.getItemStackManager())); registerMechanic(new PotionMechanic()); registerMechanic(new SettingsMechanic()); } @@ -46,22 +46,22 @@ public class MinionMechanicManager implements IMechanicManager<MinionEntity, Act @Override public void handleMechanicApplication(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) { - if(minionEntity != null && activeMinionHolder != null) { - if(minionEntity.isEditing()) { + if (minionEntity != null && activeMinionHolder != null) { + if (minionEntity.isEditing()) { Debug.ATTEMPTED_TO_SPAWN_WHILE_DISABLED.debug(); return; } Queue<IMinionMechanic> 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<MinionEntity, Act } private boolean didMechanicApplicationFail(IMinionMechanic mechanic, MinionEntity minionEntity, ActiveMinionHolder activeBossHolder) { - if(mechanic == null) return true; + if (mechanic == null) return true; - if(!mechanic.applyMechanic(minionEntity, activeBossHolder)) { + if (!mechanic.applyMechanic(minionEntity, activeBossHolder)) { Debug.MECHANIC_APPLICATION_FAILED.debug(mechanic.getClass().getSimpleName()); return true; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/PlaceholderManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/PlaceholderManager.java index ea2ec66..af6fa1a 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/PlaceholderManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/PlaceholderManager.java @@ -1,6 +1,6 @@ package com.songoda.epicbosses.managers; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.holder.ActiveAutoSpawnHolder; import com.songoda.epicbosses.holder.autospawn.ActiveIntervalAutoSpawnHolder; import me.clip.placeholderapi.expansion.PlaceholderExpansion; @@ -10,7 +10,7 @@ public class PlaceholderManager extends PlaceholderExpansion { private AutoSpawnManager autoSpawnManager; - public PlaceholderManager(CustomBosses plugin) { + public PlaceholderManager(EpicBosses plugin) { this.autoSpawnManager = plugin.getAutoSpawnManager(); } @@ -62,7 +62,7 @@ public class PlaceholderManager extends PlaceholderExpansion { @Override public String getVersion() { - return CustomBosses.get().getDescription().getVersion(); + return EpicBosses.getInstance().getDescription().getVersion(); } @Override diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/AutoSpawnFileManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/AutoSpawnFileManager.java index 6bf4451..fe0d2c2 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/AutoSpawnFileManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/files/AutoSpawnFileManager.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.autospawns.AutoSpawn; import com.songoda.epicbosses.file.AutoSpawnFileHandler; import com.songoda.epicbosses.utils.ILoadable; @@ -21,7 +21,7 @@ public class AutoSpawnFileManager implements ILoadable, ISavable, IReloadable { private Map<String, AutoSpawn> 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); @@ -43,7 +43,7 @@ public class AutoSpawnFileManager implements ILoadable, ISavable, IReloadable { } public void saveAutoSpawn(String name, AutoSpawn autoSpawn) { - if(this.autoSpawnMap.containsKey(name)) return; + if (this.autoSpawnMap.containsKey(name)) return; this.autoSpawnMap.put(name, autoSpawn); save(); 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..8f20196 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 @@ -48,7 +48,7 @@ public class BossesFileManager implements ILoadable, ISavable, IReloadable { } public void saveBossEntity(String name, BossEntity bossEntity) { - if(this.bossEntityContainer.exists(name)) return; + if (this.bossEntityContainer.exists(name)) return; this.bossEntityContainer.saveData(name, bossEntity); } 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..7156407 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<String, List<String>> 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 @@ -51,7 +51,7 @@ public class CommandsFileManager implements ILoadable, ISavable, IReloadable { } public boolean addNewCommand(String id, List<String> 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/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<String, ItemStackHolder> 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..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 @@ -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<String, List<String>> 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(); } @@ -51,7 +49,7 @@ public class MessagesFileManager implements ILoadable, ISavable, IReloadable { } public boolean addNewMessage(String id, List<String> 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/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<String, Skill> 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/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java index e064f9d..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,7 +8,10 @@ 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; /** * @author Charles Cullen @@ -19,7 +22,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 +30,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/NameMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/NameMechanic.java index c472c30..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,6 +1,7 @@ package com.songoda.epicbosses.mechanics.boss; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.core.utils.TextUtils; +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 +17,20 @@ import org.bukkit.entity.LivingEntity; */ public class NameMechanic implements IBossMechanic { - private CustomBosses plugin = CustomBosses.get(); - @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(TextUtils.convertToInvisibleString("BOSS:" + activeBossHolder.getName() + ":") + formattedName); + livingEntity.setCustomNameVisible(true); } return true; 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<PotionEffectHolder> 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 ae2055a..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; @@ -7,7 +8,6 @@ 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 org.bukkit.entity.LivingEntity; import org.bukkit.inventory.EntityEquipment; @@ -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..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,7 +8,10 @@ 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; /** * @author Charles Cullen @@ -19,7 +22,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 +30,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/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/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<PotionEffectHolder> 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/panel/AddItemsPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/AddItemsPanel.java index f6ecd4d..bdeebfb 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(); @@ -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 acb889b..6ffb216 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(); @@ -44,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; @@ -55,31 +58,32 @@ public class AutoSpawnsPanel extends MainListPanelHandler { private void loadPage(Panel panel, int requestedPage, Map<String, AutoSpawn> autoSpawnMap, List<String> 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<String, String> replaceMap = new HashMap<>(); List<String> entities = (List<String>) 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); @@ -88,8 +92,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..8848ca0 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 @@ -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<String, BossEntity> bossEntityMap, List<String> 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<String, String> replaceMap = new HashMap<>(); replaceMap.put("{name}", name); - replaceMap.put("{enabled}", ""+entity.isEditing()); + 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) { + 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 b115f11..e376694 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(); @@ -41,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; @@ -53,8 +52,9 @@ public class CustomItemsPanel extends MainListPanelHandler { private void loadPage(Panel panel, int requestedPage, Map<String, ItemStackHolder> currentItemStacks, List<String> 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); @@ -63,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); @@ -78,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 0baeecc..25d4906 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; @@ -48,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; @@ -59,8 +58,9 @@ public class CustomSkillsPanel extends MainListPanelHandler { private void loadPage(Panel panel, int requestedPage, Map<String, Skill> currentSkills, List<String> 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); @@ -73,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); @@ -84,8 +84,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..848c74b 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; @@ -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<String, DropTable> dropTableMap, List<String> 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); } @@ -75,8 +76,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..1015b24 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<BossEntity, EntityStatsElement> { - 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; @@ -39,7 +43,7 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler<BossEntity, E int maxPage = panel.getMaxPage(ItemStackUtils.getSpawnableEntityTypes()); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, list, bossEntity, entityStatsElement); return true; @@ -76,8 +80,9 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler<BossEntity, E String entityTypeValue = entityStatsElement.getMainStats().getEntityType(); ServerUtils.get().runTaskAsync(() -> 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); @@ -86,13 +91,13 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler<BossEntity, E replaceMap.put("{name}", StringUtils.get().formatString(entityType.name())); - if(entityTypeValue != null) { + if (entityTypeValue != null) { EntityFinder entityFinder = EntityFinder.get(entityTypeValue); if (entityFinder != null) { for (String s : entityFinder.getNames()) { if (s.equalsIgnoreCase(entityType.name())) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.EntityType.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.EntityType.selectedName"), replaceMap); found = true; break; } @@ -100,14 +105,14 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler<BossEntity, E } } - if(!found) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.EntityType.name"), replaceMap); + if (!found) { + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.EntityType.name"), replaceMap); } panel.setItem(realisticSlot, itemStack, e -> { 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 ef71e1a..ff6bdf2 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(); } @@ -53,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; @@ -72,15 +69,16 @@ public class ShopPanel extends PanelHandler { private void loadPage(Panel panel, int page, List<String> entryList, Map<String, BossEntity> 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); } @@ -89,26 +87,25 @@ 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); Player player = (Player) e.getWhoClicked(); - if(spawnItem == null) { + if (spawnItem == null) { Debug.FAILED_TO_GIVE_SPAWN_EGG.debug(e.getWhoClicked().getName(), name); 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()); }); @@ -120,7 +117,7 @@ public class ShopPanel extends PanelHandler { Map<String, BossEntity> 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 2b49ce1..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 @@ -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<AutoSpawn> { - 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; @@ -41,12 +41,12 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler<Aut public void fillPanel(Panel panel, AutoSpawn autoSpawn) { List<ICustomSettingAction> 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<Aut private void loadPage(Panel panel, int page, List<ICustomSettingAction> 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,23 +96,23 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler<Aut replaceMap.put("{name}", name); replaceMap.put("{currently}", currently); - if(displayStack == null || displayStack.getType() == Material.AIR) return; + if (displayStack == null || displayStack.getType() == Material.AIR) return; - ItemStackUtils.applyDisplayName(displayStack, this.plugin.getConfig().getString("Display.AutoSpawns.CustomSettings.name"), replaceMap); + ItemStackUtils.applyDisplayName(displayStack, this.plugin.getDisplay().getString("Display.AutoSpawns.CustomSettings.name"), replaceMap); ItemMeta itemMeta = displayStack.getItemMeta(); - List<String> lore = this.plugin.getConfig().getStringList("Display.AutoSpawns.CustomSettings.lore"); + List<String> lore = this.plugin.getDisplay().getStringList("Display.AutoSpawns.CustomSettings.lore"); List<String> 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<Aut displayStack.setItemMeta(itemMeta); panel.setItem(realisticSlot, displayStack, event -> { - 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 78869f8..990a41e 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<AutoSpawn private AutoSpawnFileManager autoSpawnFileManager; private BossesFileManager bossesFileManager; private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public AutoSpawnEntitiesEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public AutoSpawnEntitiesEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -53,7 +53,7 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler<AutoSpawn 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, autoSpawn); return true; @@ -86,8 +86,9 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler<AutoSpawn List<String> current = (List<String>) 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,25 +97,25 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler<AutoSpawn Map<String, String> 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)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.AutoSpawns.Entities.selectedName"), replaceMap); + if (current.contains(name)) { + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.AutoSpawns.Entities.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.AutoSpawns.Entities.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.AutoSpawns.Entities.name"), replaceMap); } - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.AutoSpawns.Entities.lore"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.AutoSpawns.Entities.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> { - 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/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<Au private AutoSpawnFileManager autoSpawnFileManager; - public AutoSpawnSpawnMessageEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public AutoSpawnSpawnMessageEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder, plugin); this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); 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 af3a152..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 @@ -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.autospawns.settings.AutoSpawnSettings; @@ -31,7 +31,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au private AutoSpawnFileManager autoSpawnFileManager; - public AutoSpawnSpecialSettingsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public AutoSpawnSpecialSettingsEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.autoSpawnFileManager = plugin.getAutoSpawnFileManager(); @@ -47,11 +47,11 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au Map<String, String> 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<Au private ClickAction getShuffleEntitiesButton(AutoSpawn autoSpawn) { return event -> { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); @@ -97,13 +97,13 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au private ClickAction getMaxAliveEntitiesButton(AutoSpawn autoSpawn) { return event -> { - 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<Au int currentAmount = ObjectUtils.getValue(settings.getMaxAliveAtOnce(), 1); int newAmount = currentAmount + amountToModifyBy; - if(newAmount <= 1) newAmount = 1; + if (newAmount <= 1) newAmount = 1; settings.setMaxAliveAtOnce(newAmount); save(autoSpawn, event); @@ -121,13 +121,13 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au private ClickAction getAmountPerSpawnButton(AutoSpawn autoSpawn) { return event -> { - 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<Au int currentAmount = ObjectUtils.getValue(settings.getAmountPerSpawn(), 1); int newAmount = currentAmount + amountToModifyBy; - if(newAmount <= 1) newAmount = 1; + if (newAmount <= 1) newAmount = 1; settings.setAmountPerSpawn(newAmount); save(autoSpawn, event); @@ -145,7 +145,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au private ClickAction getChunkIsntLoadedButton(AutoSpawn autoSpawn) { return event -> { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); @@ -156,7 +156,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au private ClickAction getOverrideSpawnMessageButton(AutoSpawn autoSpawn) { return event -> { - if(isBlocked(autoSpawn, event)) return; + if (isBlocked(autoSpawn, event)) return; AutoSpawnSettings settings = autoSpawn.getAutoSpawnSettings(); @@ -166,7 +166,7 @@ public class AutoSpawnSpecialSettingsEditorPanel extends VariablePanelHandler<Au } private boolean isBlocked(AutoSpawn autoSpawn, InventoryClickEvent event) { - if(!autoSpawn.isEditing()) { + if (!autoSpawn.isEditing()) { Message.Boss_AutoSpawn_MustToggleEditing.msg(event.getWhoClicked()); return true; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnTypeEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnTypeEditorPanel.java index bb9afac..76348ce 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnTypeEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/autospawns/AutoSpawnTypeEditorPanel.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.autospawns.types.IntervalSpawnElement; @@ -27,7 +27,7 @@ public class AutoSpawnTypeEditorPanel extends VariablePanelHandler<AutoSpawn> { 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(); @@ -67,7 +67,7 @@ public class AutoSpawnTypeEditorPanel extends VariablePanelHandler<AutoSpawn> { 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 40ae147..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 @@ -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<AutoSpawn> { 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(); @@ -49,7 +46,7 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler<AutoSpawn> { public void openFor(Player player, AutoSpawn autoSpawn) { Map<String, String> 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(); @@ -83,10 +80,10 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler<AutoSpawn> { 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; } @@ -98,7 +95,7 @@ public class MainAutoSpawnEditorPanel extends VariablePanelHandler<AutoSpawn> { 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 52d018a..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 @@ -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<BossEntit protected final BossesFileManager bossesFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; private String type; - public BossListEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin, String type) { + public BossListEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin, String type) { super(bossPanelManager, panelBuilder); this.itemStackConverter = new ItemStackConverter(); @@ -66,8 +65,8 @@ public abstract class BossListEditorPanel extends VariablePanelHandler<BossEntit replaceMap.put("{position}", "" + entityStatsElement.getMainStats().getPosition()); replaceMap.put("{targetType}", this.type); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.List.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Boss.List.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.List.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Boss.List.lore"), replaceMap); panel.setItem(slot, itemStack, event -> { ClickType click = event.getClick(); @@ -76,7 +75,7 @@ public abstract class BossListEditorPanel extends VariablePanelHandler<BossEntit if (click == ClickType.LEFT || click == ClickType.SHIFT_LEFT) { getAction(bossEntity, entityStatsElement).onClick(event); } else { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -114,7 +113,7 @@ public abstract class BossListEditorPanel extends VariablePanelHandler<BossEntit fillPanel(panel, bossEntity); panel.getPanelBuilderCounter().getSlotsWith("CreateEntity").forEach(slot -> 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 ef1f41f..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 @@ -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<BossEntity> { 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(); @@ -46,7 +46,7 @@ public class BossShopEditorPanel extends VariablePanelHandler<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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 0295790..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 @@ -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<BossEntity> { 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(); @@ -59,7 +59,7 @@ public class DropsEditorPanel extends VariablePanelHandler<BossEntity> { 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<BossEntity> { 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<BossEntity> { ItemStack itemStack = this.itemStackConverter.from(itemStackHolder); - if(itemStack == null) { + if (itemStack == null) { itemStack = new ItemStack(Material.BARRIER); } @@ -127,11 +128,11 @@ public class DropsEditorPanel extends VariablePanelHandler<BossEntity> { 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()) { + 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 2509f13..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 @@ -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<BossEntity> { 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(); @@ -46,13 +45,13 @@ public class DropsMainEditorPanel extends VariablePanelHandler<BossEntity> { 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); @@ -82,7 +81,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler<BossEntity> { private ClickAction getNaturalDropsAction(BossEntity bossEntity, Boolean current) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -96,7 +95,7 @@ public class DropsMainEditorPanel extends VariablePanelHandler<BossEntity> { 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 783d31c..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 @@ -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<BossEntity> { 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(); @@ -86,12 +88,12 @@ public class MainBossEditPanel extends VariablePanelHandler<BossEntity> { 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 01fa50b..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 @@ -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<BossEntity> { 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(); @@ -51,7 +51,7 @@ public class SkillListEditorPanel extends VariablePanelHandler<BossEntity> { 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<BossEntity> { private void loadPage(Panel panel, int requestedPage, Map<String, Skill> currentSkills, List<String> 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,23 +103,23 @@ public class SkillListEditorPanel extends VariablePanelHandler<BossEntity> { replaceMap.put("{customMessage}", StringUtils.get().formatString(skill.getCustomMessage())); 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); + if (bossEntity.getSkills().getSkills().contains(name)) { + 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()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked()); return; } List<String> 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 07dd0b4..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 @@ -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<BossEntity> { 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(); @@ -45,7 +45,7 @@ public class SkillMainEditorPanel extends VariablePanelHandler<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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 10f82a7..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 @@ -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<BossEntity> { 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(); @@ -53,7 +53,7 @@ public class SpawnItemEditorPanel extends VariablePanelHandler<BossEntity> { 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<BossEntity> { 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,27 +110,28 @@ public class SpawnItemEditorPanel extends VariablePanelHandler<BossEntity> { 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<String, String> replaceMap = new HashMap<>(); 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 -> { - 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 fcaf4b3..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 @@ -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<BossEntity private BossesFileManager bossesFileManager; - public StatisticMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public StatisticMainEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossesFileManager = plugin.getBossesFileManager(); @@ -51,8 +49,8 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler<BossEntity Double health = entityStatsElement.getMainStats().getHealth(); PanelBuilderCounter counter = panelBuilder.getPanelBuilderCounter(); - if(health == null) health = 0.0; - if(displayName == null) displayName = "N/A"; + if (health == null) health = 0.0; + if (displayName == null) displayName = "N/A"; replaceMap.put("{name}", BossAPI.getBossEntityName(bossEntity)); replaceMap.put("{health}", NumberUtils.get().formatDouble(health)); @@ -87,7 +85,7 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler<BossEntity private ClickAction getDisplayNameAction(BossEntity bossEntity, EntityStatsElement entityStatsElement) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -103,7 +101,7 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler<BossEntity private ClickAction getHealthAction(BossEntity bossEntity, EntityStatsElement entityStatsElement) { return event -> { - if(!bossEntity.isEditing()) { + if (!bossEntity.isEditing()) { Message.Boss_Edit_CannotBeModified.msg(event.getWhoClicked()); return; } @@ -111,24 +109,24 @@ public class StatisticMainEditorPanel extends SubVariablePanelHandler<BossEntity ClickType clickType = event.getClick(); double healthToModifyBy = 0.0; - if(clickType == ClickType.LEFT) { + if (clickType == ClickType.LEFT) { healthToModifyBy = 1.0; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { healthToModifyBy = 0.1; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { healthToModifyBy = -1.0; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { healthToModifyBy = -0.1; } - String modifyValue = healthToModifyBy > 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 9ed6364..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 @@ -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.managers.BossPanelManager; import com.songoda.epicbosses.managers.files.BossesFileManager; import com.songoda.epicbosses.managers.files.ItemsFileManager; import com.songoda.epicbosses.utils.Message; -import com.songoda.epicbosses.utils.ServerUtils; import com.songoda.epicbosses.utils.panel.Panel; import com.songoda.epicbosses.utils.panel.base.handlers.VariablePanelHandler; import com.songoda.epicbosses.utils.panel.builder.PanelBuilder; @@ -28,7 +27,7 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> { 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(); @@ -59,8 +58,8 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> { 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; } @@ -85,7 +84,7 @@ public class TargetingEditorPanel extends VariablePanelHandler<BossEntity> { 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 e0327c3..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 @@ -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<BossEntity> { 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; @@ -50,7 +50,7 @@ public class OnDeathCommandEditor extends VariablePanelHandler<BossEntity> { 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<BossEntity> { private void loadPage(Panel panel, int page, Map<String, List<String>> currentCommands, List<String> 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<String> commands = currentCommands.get(name); @@ -97,19 +98,19 @@ public class OnDeathCommandEditor extends VariablePanelHandler<BossEntity> { 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); + 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.getConfig().getString("Display.Boss.Commands.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List<String> presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List<String> presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List<String> 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<BossEntity> { 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 35addcd..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 @@ -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<BossEntity> { 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; @@ -50,7 +50,7 @@ public class OnSpawnCommandEditor extends VariablePanelHandler<BossEntity> { 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<BossEntity> { private void loadPage(Panel panel, int page, Map<String, List<String>> currentCommands, List<String> 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<String> commands = currentCommands.get(name); @@ -97,19 +98,19 @@ public class OnSpawnCommandEditor extends VariablePanelHandler<BossEntity> { 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); + 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.getConfig().getString("Display.Boss.Commands.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List<String> presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List<String> presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List<String> 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<BossEntity> { 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 4285d7b..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 @@ -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); } @@ -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 f30add3..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 @@ -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); } @@ -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 be7e73a..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 @@ -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); } @@ -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 7558ff4..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 @@ -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); } @@ -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/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..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 @@ -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<BossEntity> { 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(); @@ -50,10 +50,10 @@ public class DeathTextEditorPanel extends VariablePanelHandler<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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/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<BossEntity> { - 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..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 @@ -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<BossEntity> { 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(); @@ -46,8 +46,8 @@ public class SpawnTextEditorPanel extends VariablePanelHandler<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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 77d9b78..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 @@ -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<BossEntity> { 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(); @@ -52,9 +52,9 @@ public class TauntTextEditorPanel extends VariablePanelHandler<BossEntity> { List<String> 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<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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<BossEntity> { 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/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<DropTable> { - 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..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 @@ -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; @@ -66,11 +63,11 @@ public class MainDropTableEditorPanel extends VariablePanelHandler<DropTable> { 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 060ffe2..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 @@ -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<SubVariable> extends SubVariablePanelHandler<DropTable, SubVariable> implements IDropTableNewRewardEditor<SubVariable> { 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(); @@ -45,7 +45,7 @@ public abstract class DropTableNewRewardEditorPanel<SubVariable> 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<SubVariable> extends SubVari private void loadPage(Panel panel, int page, DropTable dropTable, SubVariable subVariable, List<String> filteredKeys, Map<String, ItemStackHolder> 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<SubVariable> extends SubVari List<String> 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 6047dbf..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 @@ -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<SubVariable> 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(); @@ -69,26 +69,26 @@ public abstract class DropTableRewardMainEditorPanel<SubVariable> 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<String, Double> 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 51fb954..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 @@ -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<SubVariable> extends SubVariablePanelHandler<DropTable, SubVariable> implements IDropTableRewardsListEditor<SubVariable> { 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; @@ -47,7 +47,7 @@ public abstract class DropTableRewardsListEditorPanel<SubVariable> 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<SubVariable> extends SubVa private void loadPage(Panel panel, int page, DropTable dropTable, SubVariable subVariable, Map<String, Double> rewardMap, List<String> 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<String, String> 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,10 +104,10 @@ public abstract class DropTableRewardsListEditorPanel<SubVariable> 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.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<DropTableElement> { - 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<DropTableElement> { - 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<DropTableElement> { - 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..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 @@ -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<DropTable, DropTableElement> { - 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; @@ -48,11 +48,11 @@ public class DropDropTableMainEditorPanel extends SubVariablePanelHandler<DropTa Boolean randomDrops = dropTableElement.getRandomDrops(); Integer maxDrops = dropTableElement.getDropMaxDrops(); - if(randomDrops == null) randomDrops = false; - if(maxDrops == null) maxDrops = -1; + if (randomDrops == null) randomDrops = false; + if (maxDrops == null) maxDrops = -1; replaceMap.put("{name}", BossAPI.getDropTableName(dropTable)); - replaceMap.put("{randomDrops}", StringUtils.get().formatString(""+randomDrops)); + replaceMap.put("{randomDrops}", StringUtils.get().formatString("" + randomDrops)); replaceMap.put("{maxDrops}", NumberUtils.get().formatDouble(maxDrops)); panelBuilder.addReplaceData(replaceMap); @@ -78,7 +78,7 @@ public class DropDropTableMainEditorPanel extends SubVariablePanelHandler<DropTa return event -> { 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<DropTa 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; } - String modifyValue = amountToModifyBy > 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 e9eafeb..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 @@ -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<DropTable, GiveRewardEditHandler> { - 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; @@ -54,13 +53,13 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable, replaceMap.put("{name}", BossAPI.getDropTableName(dropTable)); replaceMap.put("{position}", giveRewardEditHandler.getDropSection()); - replaceMap.put("{randomDrops}", ""+randomDrops); + replaceMap.put("{randomDrops}", "" + randomDrops); replaceMap.put("{maxDrops}", NumberUtils.get().formatDouble(maxDrops)); replaceMap.put("{drops}", NumberUtils.get().formatDouble(itemDrops)); replaceMap.put("{requiredPercentage}", NumberUtils.get().formatDouble(requiredPercentage)); replaceMap.put("{commands}", NumberUtils.get().formatDouble(commandDrops)); replaceMap.put("{maxCommands}", NumberUtils.get().formatDouble(maxCommands)); - replaceMap.put("{randomCommands}", ""+randomCommands); + replaceMap.put("{randomCommands}", "" + randomCommands); panelBuilder.addReplaceData(replaceMap); PanelBuilderCounter counter = panelBuilder.getPanelBuilderCounter(); @@ -96,26 +95,26 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable, ClickType clickType = event.getClick(); double 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; } - String modifyValue = amountToModifyBy > 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; } @@ -132,22 +131,22 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable, 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; } - String modifyValue = amountToModifyBy > 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; } @@ -164,22 +163,22 @@ public class GiveRewardMainEditPanel extends SubVariablePanelHandler<DropTable, 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; } - String modifyValue = amountToModifyBy > 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 feb4cde..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 @@ -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<DropTable, GiveTableElement> { 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; @@ -51,7 +51,7 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler<DropTab int maxPage = panel.getMaxPage(keys); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - 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<DropTab private void loadPage(Panel panel, int page, DropTable dropTable, GiveTableElement giveTableElement, List<String> keys, Map<String, Map<String, GiveTableSubElement>> 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<String, GiveTableSubElement> innerRewards = rewards.get(position); @@ -99,13 +100,13 @@ public class GiveRewardPositionListPanel extends SubVariablePanelHandler<DropTab replaceMap.put("{position}", NumberUtils.get().formatDouble(Integer.valueOf(position))); replaceMap.put("{dropAmount}", NumberUtils.get().formatDouble(dropAmount)); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.DropTable.GivePositionList.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.DropTable.GivePositionList.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.DropTable.GivePositionList.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.DropTable.GivePositionList.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> { 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<DropTab Map<String, Map<String, GiveTableSubElement>> rewards = giveTableElement.getGiveRewards(); List<String> 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 1609ea3..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 @@ -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<DropTable, GiveTableElement, String> { 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; @@ -77,7 +77,7 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler<DropT int maxPage = panel.getMaxPage(keys); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - 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<DropT NumberUtils numberUtils = NumberUtils.get(); 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 rewardSectionPosition = keys.get(slot); GiveTableSubElement giveTableSubElement = rewards.get(rewardSectionPosition); @@ -112,18 +113,18 @@ public class GiveRewardRewardsListPanel extends SubSubVariablePanelHandler<DropT replaceMap.put("{percentage}", numberUtils.formatDouble(requiredPercentage)); replaceMap.put("{items}", numberUtils.formatDouble(itemDrops)); replaceMap.put("{maxDrops}", numberUtils.formatDouble(maxDrops)); - replaceMap.put("{randomDrops}", ""+randomDrops); + replaceMap.put("{randomDrops}", "" + randomDrops); replaceMap.put("{commands}", numberUtils.formatDouble(commandDrops)); replaceMap.put("{maxCommands}", numberUtils.formatDouble(maxCommands)); - replaceMap.put("{randomCommands}", ""+randomCommands); + replaceMap.put("{randomCommands}", "" + randomCommands); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.DropTable.GiveRewardsList.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.DropTable.GiveRewardsList.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.DropTable.GiveRewardsList.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.DropTable.GiveRewardsList.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> { 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<DropT Map<String, GiveTableSubElement> rewards = rewardSections.get(key); List<String> 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 a487a99..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 @@ -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<DropTable private DropTableFileManager dropTableFileManager; private CommandsFileManager commandsFileManager; private ItemStackConverter itemStackConverter; - private CustomBosses plugin; + private EpicBosses plugin; - public GiveCommandNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveCommandNewRewardPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.commandsFileManager = plugin.getBossCommandFileManager(); @@ -57,7 +57,7 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler<DropTable 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, giveRewardEditHandler, filteredKeys, commands); return true; @@ -82,8 +82,9 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler<DropTable private void loadPage(Panel panel, int page, DropTable dropTable, GiveRewardEditHandler giveRewardEditHandler, List<String> filteredKeys, Map<String, List<String>> 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<String> innerCommands = commands.get(name); @@ -94,15 +95,15 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler<DropTable replaceMap.put("{name}", name); - 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<String> presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List<String> presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List<String> 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<DropTable } - private List<String> getCurrentKeys(GiveRewardEditHandler giveRewardEditHandler) { return new ArrayList<>(giveRewardEditHandler.getGiveTableSubElement().getCommands().keySet()); } @@ -136,7 +136,7 @@ public class GiveCommandNewRewardPanel extends SubVariablePanelHandler<DropTable List<String> 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 85b154d..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 @@ -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<DropTable, GiveRewardEditHandler> { 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; @@ -47,7 +47,7 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler<DropTabl 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, giveRewardEditHandler, rewardMap, keyList); return true; @@ -68,7 +68,7 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler<DropTabl Panel panel = panelBuilder.getPanel() .setParentPanelHandler(this.bossPanelManager.getGiveRewardMainEditMenu(), dropTable, giveRewardEditHandler); - ServerUtils.get().runTaskAsync(() ->{ + 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<DropTabl private void loadPage(Panel panel, int page, DropTable dropTable, GiveRewardEditHandler giveRewardEditHandler, Map<String, Double> rewardMap, List<String> 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<String, String> 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)); @@ -98,8 +99,8 @@ public class GiveCommandRewardListPanel extends SubVariablePanelHandler<DropTabl ItemStackHolder itemStackHolder = BossAPI.getStoredItemStack("DefaultTextMenuItem"); ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(itemStackHolder); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.DropTable.CommandRewardList.name"), replaceMap); - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.DropTable.CommandRewardList.lore"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.DropTable.CommandRewardList.name"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.DropTable.CommandRewardList.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> 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..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 @@ -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<D private DropTableFileManager dropTableFileManager; - public GiveCommandRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public GiveCommandRewardMainEditPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.dropTableFileManager = plugin.getDropTableFileManager(); @@ -72,26 +72,26 @@ public class GiveCommandRewardMainEditPanel extends SubSubVariablePanelHandler<D 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<String, Double> 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/give/drops/GiveDropNewRewardPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropNewRewardPanel.java index 0cdc56b..9f4eb18 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropNewRewardPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/droptables/types/give/drops/GiveDropNewRewardPanel.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; @@ -24,7 +24,7 @@ import java.util.Map; */ public class GiveDropNewRewardPanel extends DropTableNewRewardEditorPanel<GiveRewardEditHandler> { - 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<GiveRewardEditHandler> { - 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<GiveRewardEditHandler> { - 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<SprayTableElement> { - 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<SprayTableElement> { - 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<SprayTableElement> { - 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..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 @@ -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<DropTable, SprayTableElement> { - 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; @@ -49,12 +49,12 @@ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler<DropT Integer maxDrops = sprayTableElement.getSprayMaxDrops(); Integer maxDistance = sprayTableElement.getSprayMaxDistance(); - if(randomSprayDrops == null) randomSprayDrops = false; - if(maxDrops == null) maxDrops = -1; - if(maxDistance == null) maxDistance = 100; + if (randomSprayDrops == null) randomSprayDrops = false; + if (maxDrops == null) maxDrops = -1; + if (maxDistance == null) maxDistance = 100; replaceMap.put("{name}", BossAPI.getDropTableName(dropTable)); - replaceMap.put("{randomDrops}", StringUtils.get().formatString(""+randomSprayDrops)); + replaceMap.put("{randomDrops}", StringUtils.get().formatString("" + randomSprayDrops)); replaceMap.put("{maxDrops}", NumberUtils.get().formatDouble(maxDrops)); replaceMap.put("{maxDistance}", NumberUtils.get().formatDouble(maxDistance)); panelBuilder.addReplaceData(replaceMap); @@ -83,7 +83,7 @@ public class SprayDropTableMainEditorPanel extends SubVariablePanelHandler<DropT return event -> { 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<DropT 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; } - String modifyValue = amountToModifyBy > 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<DropT 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; } - String modifyValue = amountToModifyBy > 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 a569bb5..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 @@ -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; @@ -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,27 +127,28 @@ 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<String, String> replaceMap = new HashMap<>(); 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 -> { - 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 a79e2c5..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 @@ -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<T> extends VariablePanelHandler<T> { 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; @@ -58,7 +57,7 @@ public abstract class ListCommandListEditor<T> extends VariablePanelHandler<T> { 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; @@ -95,8 +94,9 @@ public abstract class ListCommandListEditor<T> extends VariablePanelHandler<T> { List<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<String> messages = currentMessages.get(name); @@ -107,19 +107,19 @@ public abstract class ListCommandListEditor<T> extends VariablePanelHandler<T> { replaceMap.put("{name}", name); - if(current.contains(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Commands.selectedName"), replaceMap); + if (current.contains(name)) { + 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<String> presetLore = this.plugin.getConfig().getStringList("Display.Boss.Commands.lore"); + List<String> presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Commands.lore"); List<String> 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<String> 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 c8026ec..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 @@ -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<T> extends VariablePanelHandler<T> { 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; @@ -58,7 +57,7 @@ public abstract class ListMessageListEditor<T> extends VariablePanelHandler<T> { 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; @@ -95,8 +94,9 @@ public abstract class ListMessageListEditor<T> extends VariablePanelHandler<T> { List<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<String> messages = currentMessages.get(name); @@ -107,19 +107,19 @@ public abstract class ListMessageListEditor<T> extends VariablePanelHandler<T> { replaceMap.put("{name}", name); - if(current.contains(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Text.selectedName"), replaceMap); + if (current.contains(name)) { + 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<String> presetLore = this.plugin.getConfig().getStringList("Display.Boss.Text.lore"); + List<String> presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Text.lore"); List<String> 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<String> 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 0ae91c8..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 @@ -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<T> extends VariablePanelHandler<T> 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; @@ -57,7 +57,7 @@ public abstract class SingleMessageListEditor<T> extends VariablePanelHandler<T> 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<T> extends VariablePanelHandler<T> 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<String> messages = currentMessages.get(name); @@ -105,19 +106,19 @@ public abstract class SingleMessageListEditor<T> extends VariablePanelHandler<T> replaceMap.put("{name}", name); - if(current != null && current.equalsIgnoreCase(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Boss.Text.selectedName"), replaceMap); + if (current != null && current.equalsIgnoreCase(name)) { + 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<String> presetLore = this.plugin.getConfig().getStringList("Display.Boss.Text.lore"); + List<String> presetLore = this.plugin.getDisplay().getStringList("Display.Boss.Text.lore"); List<String> 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<String> 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 c07da9a..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 @@ -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<Skill> { 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(); @@ -50,11 +51,11 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> { 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); @@ -92,13 +93,13 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> { 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); } }; @@ -120,7 +121,7 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> { 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 { @@ -146,24 +147,24 @@ public class MainSkillEditorPanel extends VariablePanelHandler<Skill> { 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/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<Skill> { 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..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 @@ -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<Skill> { - 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; @@ -44,7 +44,7 @@ public class CommandSkillEditorPanel extends VariablePanelHandler<Skill> { 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,24 +101,25 @@ public class CommandSkillEditorPanel extends VariablePanelHandler<Skill> { private void loadPage(Panel panel, int page, List<SubCommandSkillElement> 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<String, String> replaceMap = new HashMap<>(); Double chance = subCommandSkillElement.getChance(); List<String> 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)); 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..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 @@ -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<Skill> { 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; @@ -47,7 +47,7 @@ public class CustomSkillEditorPanel extends VariablePanelHandler<Skill> { 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<Skill> { 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<Skill> { 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<Skill> { 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> { 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 da0c009..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 @@ -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<Skill> { 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; @@ -50,7 +50,7 @@ public class GroupSkillEditorPanel extends VariablePanelHandler<Skill> { 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<Skill> { List<String> 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<Skill> { 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,16 +112,16 @@ public class GroupSkillEditorPanel extends VariablePanelHandler<Skill> { replaceMap.put("{displayName}", displayName); replaceMap.put("{type}", type); - if(isCurrent) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Group.selectedName"), replaceMap); + if (isCurrent) { + 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) { + 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 e1b539e..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 @@ -1,7 +1,8 @@ package com.songoda.epicbosses.panel.skills.custom; import com.google.gson.JsonObject; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.core.compatibility.ServerVersion; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; @@ -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; @@ -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; @@ -43,9 +42,9 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> { 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; @@ -61,7 +60,7 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> { 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<Skill> { private void loadPage(Panel panel, int page, List<PotionEffectHolder> 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); @@ -110,7 +110,7 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> { 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; @@ -127,8 +127,8 @@ public class PotionSkillEditorPanel extends VariablePanelHandler<Skill> { 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..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 @@ -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<Skill, private CommandsFileManager commandsFileManager; private ItemStackConverter itemStackConverter; private BossSkillManager bossSkillManager; - private CustomBosses plugin; + private EpicBosses plugin; - public CommandListSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public CommandListSkillEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -56,7 +56,7 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler<Skill, 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, commands, currentCommands, entryList, skill, subCommandSkillElement); return true; @@ -88,8 +88,9 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler<Skill, private void loadPage(Panel panel, int page, List<String> commands, Map<String, List<String>> allCommands, List<String> 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<String> boundCommands = allCommands.get(name); @@ -100,19 +101,19 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler<Skill, replaceMap.put("{name}", name); - if(commands.contains(name)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.CommandList.selectedName"), replaceMap); + if (commands.contains(name)) { + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CommandList.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.CommandList.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CommandList.name"), replaceMap); } ItemMeta itemMeta = itemStack.getItemMeta(); - List<String> presetLore = this.plugin.getConfig().getStringList("Display.Skills.CommandList.lore"); + List<String> presetLore = this.plugin.getDisplay().getStringList("Display.Skills.CommandList.lore"); List<String> 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<String> 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<Skill, itemStack.setItemMeta(itemMeta); panel.setItem(realisticSlot, itemStack, e -> { - if(commands.contains(name)) { + if (commands.contains(name)) { commands.remove(name); } else { commands.add(name); @@ -140,8 +141,8 @@ public class CommandListSkillEditorPanel extends SubVariablePanelHandler<Skill, List<SubCommandSkillElement> subCommandSkillElements = commandSkillElement.getCommands(); List<SubCommandSkillElement> 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 8238b38..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 @@ -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<Skill, Sub private SkillsFileManager skillsFileManager; private BossSkillManager bossSkillManager; - public ModifyCommandEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public ModifyCommandEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossSkillManager = plugin.getBossSkillManager(); @@ -55,8 +55,8 @@ public class ModifyCommandEditorPanel extends SubVariablePanelHandler<Skill, Sub Double chance = subCommandSkillElement.getChance(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(commands == null) commands = new ArrayList<>(); - 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<Skill, Sub ClickType clickType = event.getClick(); double amountToModify; - if(clickType == ClickType.SHIFT_LEFT) { + if (clickType == ClickType.SHIFT_LEFT) { amountToModify = 0.1; - } else if(clickType == ClickType.RIGHT) { + } else if (clickType == ClickType.RIGHT) { amountToModify = -1.0; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { amountToModify = -0.1; } else { amountToModify = 1.0; } - String modifyValue = amountToModify > 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<Skill, Sub List<SubCommandSkillElement> subCommandSkillElements = commandSkillElement.getCommands(); List<SubCommandSkillElement> 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 32a7d29..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 @@ -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.managers.BossPanelManager; import com.songoda.epicbosses.managers.BossSkillManager; @@ -32,9 +32,9 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C private ItemStackConverter itemStackConverter; private BossSkillManager bossSkillManager; - private CustomBosses plugin; + private EpicBosses plugin; - public CustomSkillTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public CustomSkillTypeEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -65,7 +65,7 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C int maxPage = panel.getMaxPage(customSkillHandlers); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, skill, customSkillElement, customSkillHandlers); return true; @@ -83,35 +83,36 @@ public class CustomSkillTypeEditorPanel extends SubVariablePanelHandler<Skill, C String current = customSkillElement.getCustom().getType(); panel.loadPage(page, ((slot, realisticSlot) -> { - 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<String, String> 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.getConfig().getString("Display.Skills.CustomType.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CustomType.selectedName"), replaceMap); } else { itemStack = this.itemStackConverter.from(this.plugin.getItemStackManager().getItemStackHolder("DefaultCustomSkillTypeItem")); - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.CustomType.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CustomType.name"), replaceMap); } - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.CustomType.lore"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Skills.CustomType.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> { 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 1d7c452..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 @@ -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<Skill, CustomSkillElement> { - 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; @@ -46,7 +45,7 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler<Sk int maxPage = panel.getMaxPage(filteredList); panel.setOnPageChange((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, filteredList, skill, customSkillElement); return true; @@ -73,27 +72,28 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler<Sk String current = getCurrentSetting(customSkillElement); panel.loadPage(page, (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 { 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<String, String> 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)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Material.selectedName"), replaceMap); + if (current.equalsIgnoreCase(name)) { + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Material.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.Material.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.Material.name"), replaceMap); } panel.setItem(realisticSlot, itemStack, event -> { @@ -108,7 +108,7 @@ public abstract class MaterialTypeEditorPanel extends SubVariablePanelHandler<Sk List<Material> 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 8897c14..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 @@ -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<Skill, Cust private MinionsFileManager minionsFileManager; private ItemStackConverter itemStackConverter; private ItemsFileManager itemsFileManager; - private CustomBosses plugin; + private EpicBosses plugin; - public MinionSelectEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public MinionSelectEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.plugin = plugin; @@ -55,7 +54,7 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler<Skill, Cust 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, skill, customSkillElement); return true; @@ -83,8 +82,9 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler<Skill, Cust String current = customMinionSkillElement.getMinionToSpawn(); 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); MinionEntity minionEntity = currentEntities.get(name); @@ -93,16 +93,16 @@ public class MinionSelectEditorPanel extends SubVariablePanelHandler<Skill, Cust Map<String, String> 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)) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.MinionList.selectedName"), replaceMap); + if (current.equalsIgnoreCase(name)) { + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.MinionList.selectedName"), replaceMap); } else { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.MinionList.name"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.MinionList.name"), replaceMap); } - ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getConfig().getStringList("Display.Skills.MinionList.lore"), replaceMap); + ItemStackUtils.applyDisplayLore(itemStack, this.plugin.getDisplay().getStringList("Display.Skills.MinionList.lore"), replaceMap); panel.setItem(realisticSlot, itemStack, event -> { 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..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 @@ -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<Skill, CustomSkillElement> { 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; @@ -62,19 +62,19 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler<Skill, C String currentSkillName = customSkillElement.getCustom().getType(); CustomSkillHandler customSkillHandler = this.bossSkillManager.getSkills().stream().filter(cSH -> cSH.getSkillName().equalsIgnoreCase(currentSkillName)).findFirst().orElse(null); - if(customSkillHandler == null) { + if (customSkillHandler == null) { Debug.FAILED_TO_FIND_ASSIGNED_CUSTOMSKILLHANDLER.debug(currentSkillName); return; } List<ICustomSettingAction> 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<Skill, C private void loadPage(Panel panel, int page, List<ICustomSettingAction> 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,10 +106,10 @@ public class SpecialSettingsEditorPanel extends SubVariablePanelHandler<Skill, C replaceMap.put("{setting}", name); replaceMap.put("{currently}", currently); - if(displayStack == null || displayStack.getType() == Material.AIR) return; + if (displayStack == null || displayStack.getType() == Material.AIR) return; - ItemStackUtils.applyDisplayName(displayStack, this.plugin.getConfig().getString("Display.Skills.CustomSetting.name"), replaceMap); - ItemStackUtils.applyDisplayLore(displayStack, this.plugin.getConfig().getStringList("Display.Skills.CustomSetting.lore"), replaceMap); + ItemStackUtils.applyDisplayName(displayStack, this.plugin.getDisplay().getString("Display.Skills.CustomSetting.name"), replaceMap); + ItemStackUtils.applyDisplayLore(displayStack, this.plugin.getDisplay().getStringList("Display.Skills.CustomSetting.lore"), replaceMap); panel.setItem(realisticSlot, displayStack, clickAction); } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/CreatePotionEffectEditorPanel.java b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/CreatePotionEffectEditorPanel.java index 12d6d05..d9afdbb 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/CreatePotionEffectEditorPanel.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/panel/skills/custom/potions/CreatePotionEffectEditorPanel.java @@ -1,7 +1,7 @@ package com.songoda.epicbosses.panel.skills.custom.potions; 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; @@ -35,7 +35,7 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill private SkillsFileManager skillsFileManager; private BossSkillManager bossSkillManager; - public CreatePotionEffectEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, CustomBosses plugin) { + public CreatePotionEffectEditorPanel(BossPanelManager bossPanelManager, PanelBuilder panelBuilder, EpicBosses plugin) { super(bossPanelManager, panelBuilder); this.bossSkillManager = plugin.getBossSkillManager(); @@ -58,7 +58,7 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill String effect = potionEffectHolder.getType(); PanelBuilder panelBuilder = getPanelBuilder().cloneBuilder(); - if(effect == null || effect.isEmpty()) effect = "N/A"; + if (effect == null || effect.isEmpty()) effect = "N/A"; replaceMap.put("{duration}", NumberUtils.get().formatDouble(potionEffectHolder.getDuration())); replaceMap.put("{level}", NumberUtils.get().formatDouble(potionEffectHolder.getLevel())); @@ -89,20 +89,20 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill ClickType clickType = event.getClick(); int amountToModifyBy; - if(clickType == ClickType.RIGHT) { + if (clickType == ClickType.RIGHT) { amountToModifyBy = -1; - } else if(clickType == ClickType.SHIFT_RIGHT) { + } else if (clickType == ClickType.SHIFT_RIGHT) { amountToModifyBy = -10; - } else if(clickType == ClickType.SHIFT_LEFT) { + } else if (clickType == ClickType.SHIFT_LEFT) { amountToModifyBy = 10; - }else { + } else { amountToModifyBy = 1; } int currentAmount = potionEffectHolder.getDuration(); int totalAmount = amountToModifyBy + currentAmount; - if(totalAmount < 0) { + if (totalAmount < 0) { totalAmount = -1; } @@ -116,7 +116,7 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill ClickType clickType = event.getClick(); int amountToModifyBy; - if(clickType.name().contains("RIGHT")) { + if (clickType.name().contains("RIGHT")) { amountToModifyBy = -1; } else { amountToModifyBy = 1; @@ -125,11 +125,11 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill int currentAmount = potionEffectHolder.getLevel(); int totalAmount = amountToModifyBy + currentAmount; - if(totalAmount <= 0) { + if (totalAmount <= 0) { totalAmount = 1; } - if(totalAmount > 255) { + if (totalAmount > 255) { totalAmount = 255; } @@ -144,11 +144,11 @@ public class CreatePotionEffectEditorPanel extends SubVariablePanelHandler<Skill Integer level = potionEffectHolder.getLevel(); String type = potionEffectHolder.getType(); - if(duration != null && level != null && type != null && !type.isEmpty()) { + if (duration != null && level != null && type != null && !type.isEmpty()) { PotionSkillElement potionSkillElement = this.bossSkillManager.getPotionSkillElement(skill); PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByName(type); - if(potionEffectFinder != null) { + if (potionEffectFinder != null) { List<PotionEffectHolder> currentList = potionSkillElement.getPotions(); currentList.add(potionEffectHolder); 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 bde0f74..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,16 +1,18 @@ package com.songoda.epicbosses.panel.skills.custom.potions; -import com.songoda.epicbosses.CustomBosses; +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.*; +import com.songoda.epicbosses.utils.PotionEffectFinder; +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; 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; @@ -33,9 +35,9 @@ import java.util.stream.Collectors; public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill, PotionEffectHolder> { 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; @@ -47,7 +49,7 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill, int maxPage = panel.getMaxPage(list); panel.setOnPageChange(((player, currentPage, requestedPage) -> { - if(requestedPage < 0 || requestedPage > maxPage) return false; + if (requestedPage < 0 || requestedPage > maxPage) return false; loadPage(panel, requestedPage, list, skill, potionEffectHolder); return true; @@ -74,14 +76,15 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill, String type = potionEffectHolder.getType(); ServerUtils.get().runTaskAsync(() -> 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; @@ -98,23 +101,23 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill, replaceMap.put("{effect}", StringUtils.get().formatString(potionEffectType.getName())); - if(type != null && !type.isEmpty()) { + if (type != null && !type.isEmpty()) { PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByName(type); if (potionEffectFinder != null) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.CreatePotion.selectedName"), replaceMap); + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CreatePotion.selectedName"), replaceMap); found = true; } } - if(!found) { - ItemStackUtils.applyDisplayName(itemStack, this.plugin.getConfig().getString("Display.Skills.CreatePotion.name"), replaceMap); + if (!found) { + ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CreatePotion.name"), replaceMap); } panel.setItem(realisticSlot, itemStack, e -> { 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/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..594405d 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 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<SkillMode> getSkillModes() { List<SkillMode> 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 15a24ab..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 @@ -1,29 +1,30 @@ package com.songoda.epicbosses.skills.custom; -import com.songoda.epicbosses.CustomBosses; +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.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.*; +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; 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 +32,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; @@ -46,18 +46,17 @@ import java.util.*; 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<Location, CageLocationData> cageLocationDataMap = new HashMap<>(); - @Getter private static final List<UUID> playersInCage = new ArrayList<>(); + private static final Map<Location, CageLocationData> cageLocationDataMap = new HashMap<>(); + private static final List<UUID> 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 +65,14 @@ public class Cage extends CustomSkillHandler { this.insideTypeEditor = getInsideTypeEditor(); } + public static Map<Location, CageLocationData> getCageLocationDataMap() { + return Cage.cageLocationDataMap; + } + + public static List<UUID> getPlayersInCage() { + return Cage.playersInCage; + } + @Override public boolean doesUseMultiplier() { return false; @@ -79,8 +86,8 @@ public class Cage extends CustomSkillHandler { @Override public List<ICustomSettingAction> getOtherSkillDataActions(Skill skill, CustomSkillElement customSkillElement) { List<ICustomSettingAction> 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)); @@ -98,7 +105,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); @@ -126,17 +133,17 @@ public class Cage extends CustomSkillHandler { private void restoreBlocks(Queue<BlockState> 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 (versionHandler.getVersion().isHigherThanOrEqualTo(Versions.v1_13_R1)) { + if (oldState != null) { + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) { location.getBlock().setBlockData(oldState.getBlockData()); } else { if (setBlockDataMethod == null) { @@ -158,7 +165,7 @@ public class Cage extends CustomSkillHandler { getCageLocationDataMap().remove(location); } else { - cageLocationData.setAmountOfCages(amountOfCages-1); + cageLocationData.setAmountOfCages(amountOfCages - 1); getCageLocationDataMap().put(location, cageLocationData); } }); @@ -175,22 +182,23 @@ public class Cage extends CustomSkillHandler { private void setBlocks(Queue<BlockState> 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); }); } @@ -212,7 +220,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; @@ -223,7 +231,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 a14996e..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 @@ -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; @@ -49,11 +49,11 @@ public class Disarm extends CustomSkillHandler { switch (itemSlot) { case 0: - if(livingEntity instanceof HumanEntity) { + if (livingEntity instanceof HumanEntity) { HumanEntity humanEntity = (HumanEntity) livingEntity; - itemStack = CustomBosses.get().getVersionHandler().getItemInHand(humanEntity); - CustomBosses.get().getVersionHandler().setItemInHand(humanEntity, replacementItemStack); + itemStack = humanEntity.getItemInHand(); + humanEntity.setItemInHand(replacementItemStack); break; } case 1: @@ -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 cdf399b..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 @@ -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 @@ -38,11 +37,11 @@ public class Fireball extends CustomSkillHandler { public void castSkill(Skill skill, CustomSkillElement customSkillElement, ActiveBossHolder activeBossHolder, List<LivingEntity> 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<LivingEntity> 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<LivingEntity> 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/Minions.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/Minions.java index 4694479..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,6 +1,7 @@ package com.songoda.epicbosses.skills.custom; -import com.songoda.epicbosses.CustomBosses; +import com.songoda.core.compatibility.CompatibleMaterial; +import com.songoda.epicbosses.EpicBosses; import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.managers.BossSkillManager; @@ -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,11 +30,9 @@ import java.util.List; */ public class Minions extends CustomSkillHandler { - private static final VersionHandler versionHandler = new VersionHandler(); + private EpicBosses plugin; - private CustomBosses plugin; - - public Minions(CustomBosses plugin) { + public Minions(EpicBosses plugin) { this.plugin = plugin; } @@ -54,7 +51,7 @@ public class Minions extends CustomSkillHandler { List<ICustomSettingAction> 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/skills/custom/cage/CageLocationData.java b/plugin-modules/Core/src/com/songoda/epicbosses/skills/custom/cage/CageLocationData.java index 1ea3856..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 @@ -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,9 @@ import org.bukkit.block.BlockState; */ public class CageLocationData { - @Getter @Setter private BlockState oldBlockState; - @Getter @Setter private int amountOfCages = 0; - - @Getter private final Location location; + private final Location location; + private BlockState oldBlockState; + private int amountOfCages = 0; public CageLocationData(Location location, int amountOfCages) { this(location); @@ -27,4 +24,23 @@ public class CageLocationData { this.location = location; } + public BlockState getOldBlockState() { + return this.oldBlockState; + } + + 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 1b60ec5..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 @@ -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<String, Queue<BlockState>> mapOfCages = new HashMap<>(), mapOfRestoreCages = new HashMap<>(); - @Getter private final UUID uuid; + private final Map<String, Queue<BlockState>> mapOfCages = new HashMap<>(), mapOfRestoreCages = new HashMap<>(); + private final UUID uuid; public CagePlayerData(UUID uuid) { this.uuid = uuid; @@ -35,8 +33,8 @@ public class CagePlayerData { World world = playerLocation.getWorld(); Queue<Location> 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); @@ -55,7 +53,7 @@ public class CagePlayerData { World world = playerLocation.getWorld(); Queue<Location> 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); @@ -68,8 +66,8 @@ public class CagePlayerData { World world = playerLocation.getWorld(); Queue<Location> 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); @@ -85,10 +83,10 @@ public class CagePlayerData { Queue<BlockState> 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()); @@ -98,4 +96,15 @@ public class CagePlayerData { return blockStateQueue; } + public Map<String, Queue<BlockState>> getMapOfCages() { + return this.mapOfCages; + } + + public Map<String, Queue<BlockState>> 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..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 @@ -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 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 9ea4263..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 @@ -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 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 e59c35e..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 @@ -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<String> commands; + @Expose + private Double chance; + @Expose + private List<String> commands; public SubCommandSkillElement(String name, Double chance, List<String> 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 void setChance(Double chance) { + this.chance = chance; + } + + public List<String> getCommands() { + return this.commands; + } + + public void setCommands(List<String> 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..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 @@ -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; @@ -24,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); } @@ -32,11 +33,30 @@ public class SubCustomSkillElement { } public CustomMinionSkillElement getCustomMinionSkillData() { - if(getType().equalsIgnoreCase("MINIONS")) { + if (getType().equalsIgnoreCase("MINIONS")) { return BossesGson.get().fromJson(this.otherSkillData, CustomMinionSkillElement.class); } return null; } + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public Double getMultiplier() { + return this.multiplier; + } + + 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..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 @@ -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<CommandSkillElement> { - @Expose @Getter @Setter private List<SubCommandSkillElement> commands; + @Expose + private List<SubCommandSkillElement> commands; public CommandSkillElement(List<SubCommandSkillElement> commandSkillElements) { this.commands = commandSkillElements; @@ -32,7 +31,7 @@ public class CommandSkillElement implements ISkillHandler<CommandSkillElement> { List<SubCommandSkillElement> commandSkillElements = getCommands(); ServerUtils serverUtils = ServerUtils.get(); - if(commandSkillElements.isEmpty()) { + if (commandSkillElements.isEmpty()) { Debug.SKILL_COMMANDS_ARE_EMPTY.debug(); return; } @@ -42,13 +41,21 @@ public class CommandSkillElement implements ISkillHandler<CommandSkillElement> { Double chance = commandSkillEle.getChance(); List<String> 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); }) ); } + + public List<SubCommandSkillElement> getCommands() { + return this.commands; + } + + public void setCommands(List<SubCommandSkillElement> 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..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 @@ -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<GroupSkillElement> { - @Expose @Getter @Setter private List<String> groupedSkills; + @Expose + private List<String> groupedSkills; public GroupSkillElement(List<String> groupedSkills) { this.groupedSkills = groupedSkills; @@ -30,14 +29,14 @@ public class GroupSkillElement implements ISkillHandler<GroupSkillElement> { @Override public void castSkill(Skill skill, GroupSkillElement groupSkillElement, ActiveBossHolder activeBossHolder, List<LivingEntity> nearbyEntities) { List<String> currentGroupedSkills = getGroupedSkills(); - CustomBosses plugin = CustomBosses.get(); + EpicBosses plugin = EpicBosses.getInstance(); SkillsFileManager skillsFileManager = plugin.getSkillsFileManager(); BossSkillManager bossSkillManager = plugin.getBossSkillManager(); currentGroupedSkills.forEach(string -> { Skill innerSkill = skillsFileManager.getSkill(string); - if(innerSkill == null) { + if (innerSkill == null) { Debug.SKILL_NOT_FOUND.debug(); return; } @@ -45,4 +44,12 @@ public class GroupSkillElement implements ISkillHandler<GroupSkillElement> { bossSkillManager.handleSkill(null, skill, nearbyEntities, activeBossHolder, false, true); }); } + + public List<String> getGroupedSkills() { + return this.groupedSkills; + } + + public void setGroupedSkills(List<String> 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..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 @@ -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<PotionSkillElement> { - @Expose @Getter @Setter private List<PotionEffectHolder> potions; + @Expose + private List<PotionEffectHolder> potions; private PotionEffectConverter potionEffectConverter; @@ -35,11 +34,11 @@ public class PotionSkillElement implements ISkillHandler<PotionSkillElement> { public void castSkill(Skill skill, PotionSkillElement customSkillElement, ActiveBossHolder activeBossHolder, List<LivingEntity> nearbyEntities) { List<PotionEffectHolder> 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; } @@ -56,4 +55,12 @@ public class PotionSkillElement implements ISkillHandler<PotionSkillElement> { nearbyEntities.forEach(nearby -> potionEffects.forEach(nearby::addPotionEffect)); } + + public List<PotionEffectHolder> getPotions() { + return this.potions; + } + + public void setPotions(List<PotionEffectHolder> 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..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,9 +1,9 @@ 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 lombok.Getter; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.entity.Creature; @@ -22,8 +22,8 @@ import java.util.UUID; */ public abstract class TargetHandler<Holder extends IActiveHolder> 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; @@ -34,54 +34,60 @@ public abstract class TargetHandler<Holder extends IActiveHolder> 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; } 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<LivingEntity> nearbyEntities = new ArrayList<>(); - List<Entity> nearbyBossEntities = boss.getNearbyEntities(radius, radius, radius); + List<LivingEntity> nearbyEntities = new ArrayList<>(); + List<Entity> 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; + 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) { 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); } }); } + public BossTargetManager getBossTargetManager() { + return this.bossTargetManager; + } + + public Holder getHolder() { + return this.holder; + } } 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<T extends IActiveHolder> 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<T extends IActiveHolder> extends Targ @Override public LivingEntity selectTarget(List<LivingEntity> 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 038011c..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 @@ -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 @@ -27,7 +30,7 @@ public class TopDamagerTargetHandler<T extends IActiveHolder> 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/Debug.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Debug.java index 414fd9e..65a917d 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; @@ -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(CustomBosses 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..464a794 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<String> names = new ArrayList<>(); - @Getter private Enchantment enchantment; - @Getter private String fancyName; + private List<String> names = new ArrayList<>(); + private Enchantment enchantment; + private String fancyName; EnchantFinder(String fancyName, Enchantment enchantment, String... names) { this.fancyName = fancyName; @@ -58,11 +57,11 @@ public enum EnchantFinder { } public static EnchantFinder getByName(String name) { - for(EnchantFinder enchantFinder : values()) { + for (EnchantFinder enchantFinder : values()) { List<String> names = enchantFinder.getNames(); - for(String s : names) { - if(s.equalsIgnoreCase(name)) return enchantFinder; + for (String s : names) { + if (s.equalsIgnoreCase(name)) return enchantFinder; } } @@ -70,16 +69,28 @@ 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; } + + public List<String> 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 4b19437..4be5b41 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java @@ -1,11 +1,12 @@ 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; +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; @@ -69,6 +70,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"), @@ -77,10 +83,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<String> names = new ArrayList<>(); - @Getter private EntityType entityType; - @Getter private String fancyName; + private ICustomEntityHandler customEntityHandler; + private List<String> names = new ArrayList<>(); + private EntityType entityType; + private String fancyName; EntityFinder(String fancyName, ICustomEntityHandler customEntityHandler, String... names) { this.fancyName = fancyName; @@ -102,13 +108,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 { @@ -118,20 +134,33 @@ 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()); } } - 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; } + public List<String> 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/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 <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) { List<Map.Entry<K, V>> list = new ArrayList<>(map.entrySet()); Map<K, V> 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 f0c5973..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,71 +64,20 @@ 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( "&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."), 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 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."), 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."); @@ -247,10 +176,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 +190,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 +208,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 +249,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 351a3fc..36b5b06 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; @@ -17,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<String> messages) { - for(String s : messages) { + for (String s : messages) { player.sendMessage(StringUtils.get().translateColor(s)); } } @@ -34,19 +37,15 @@ public class MessageUtils { public void sendMessage(Location center, int radius, List<String> 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> 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/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..c4c0b79 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<String> names = new ArrayList<>(); - @Getter private PotionEffectType potionEffectType; - @Getter private String fancyName; + private List<String> names = new ArrayList<>(); + private PotionEffectType potionEffectType; + private String fancyName; PotionEffectFinder(String fancyName, PotionEffectType potionEffectType, String... names) { this.fancyName = fancyName; @@ -59,11 +57,11 @@ public enum PotionEffectFinder { } public static PotionEffectFinder getByName(String name) { - for(PotionEffectFinder potionEffectFinder : values()) { + for (PotionEffectFinder potionEffectFinder : values()) { List<String> names = potionEffectFinder.getNames(); - for(String s : names) { - if(s.equalsIgnoreCase(name)) return potionEffectFinder; + for (String s : names) { + if (s.equalsIgnoreCase(name)) return potionEffectFinder; } } @@ -71,13 +69,25 @@ 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; } + + public List<String> 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..6294fbb 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; /** @@ -15,6 +13,10 @@ public class RandomUtils { private Random random = new Random(); + public static RandomUtils get() { + return INSTANCE; + } + public boolean preformRandomAction() { int rand = getRandomNumber(2); @@ -43,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 85e229d..3a23c6e 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; @@ -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)); } @@ -42,7 +46,7 @@ public class ServerUtils { } public void logDebug(String log) { - if (CustomBosses.get().isDebug()) { + if (EpicBosses.getInstance().isDebug()) { log("&d[EpicBosses] Debug - &7" + 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 10bfe99..ef13281 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 @@ -16,6 +19,10 @@ public class StringUtils { private static StringUtils INSTANCE = new StringUtils(); + public static StringUtils get() { + return INSTANCE; + } + public List<String> splitString(String input, int splitSize) { List<String> messages = new ArrayList<>(); int index = 0; @@ -44,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(","); @@ -61,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) { @@ -77,14 +84,14 @@ public class StringUtils { Queue<T> 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(", "); @@ -95,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(" "); } } @@ -124,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/Versions.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java deleted file mode 100644 index 48af03c..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/Versions.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.songoda.epicbosses.utils; - -import lombok.Getter; - -/** - * @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"); - - @Getter 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; - } - -} 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<PotionEffectType> { 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 deleted file mode 100644 index 50f093e..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/command/CommandService.java +++ /dev/null @@ -1,118 +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<T extends CommandSender> extends BukkitCommand { - - private static CommandMap _commandMap = null; - - private String permission, noPermissionMsg; - private String command, description; - private Class<T> parameterClass; - private String[] aliases; - - public CommandService(Class<? extends CommandService> 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<T>) 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<String> 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<String> 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 192eff8..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<T extends CommandSender> extends CommandService<T> implements ISubCommandHandler { - - private List<SubCommand> subCommands = new ArrayList<>(); - - public SubCommandService(Class<? extends CommandService> 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 7761ae8..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 a30a93b..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 cf568ef..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 78085ad..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 cd66ef3..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 889755f..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(); - -} 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..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 @@ -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; /** @@ -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/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<Economy> 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/CatHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/CatHandler.java index ef57fc0..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 @@ -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 new file mode 100644 index 0000000..82ead55 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DolphinHandler.java @@ -0,0 +1,19 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.core.compatibility.ServerVersion; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class DolphinHandler implements ICustomEntityHandler { + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + 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.DOLPHIN); + } +} 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 new file mode 100644 index 0000000..985812b --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/DrownedHandler.java @@ -0,0 +1,19 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.core.compatibility.ServerVersion; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class DrownedHandler implements ICustomEntityHandler { + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + 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.DROWNED); + } +} 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..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 @@ -1,10 +1,10 @@ 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.*; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; /** * @author Charles Cullen @@ -13,13 +13,10 @@ import org.bukkit.entity.*; */ public class ElderGuardianHandler 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."); - } 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..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 @@ -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 EndermiteHandler 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.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..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 @@ -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 new file mode 100644 index 0000000..b642fbe --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FishHandler.java @@ -0,0 +1,39 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.core.compatibility.ServerVersion; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class FishHandler implements ICustomEntityHandler { + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + if (ServerVersion.isServerVersionBelow(ServerVersion.V1_13)) + 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/FoxHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/FoxHandler.java index b55c410..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 @@ -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 FoxHandler 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."); - } 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 529b1af..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 @@ -1,10 +1,11 @@ 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.*; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Rabbit; /** * @author Charles Cullen @@ -13,13 +14,10 @@ import org.bukkit.entity.*; */ 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/MagmaCubeHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/MagmaCubeHandler.java index 752b757..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; @@ -19,7 +18,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/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..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 @@ -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 PandaHandler 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."); - } 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..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 @@ -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)) { + 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 new file mode 100644 index 0000000..3a97245 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PhantomHandler.java @@ -0,0 +1,28 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.core.compatibility.ServerVersion; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Phantom; + +public class PhantomHandler implements ICustomEntityHandler { + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + 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(":")) { + 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/PillagerHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/PillagerHandler.java index 4ed62ad..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 @@ -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 PillagerHandler 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."); - } 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..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 @@ -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 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..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 @@ -1,19 +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 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..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 @@ -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 ShulkerHandler implements ICustomEntityHandler { - private VersionHandler versionHandler = new VersionHandler(); - @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..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 @@ -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,17 +14,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 new file mode 100644 index 0000000..24ec2c7 --- /dev/null +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/entity/handlers/TurtleHandler.java @@ -0,0 +1,18 @@ +package com.songoda.epicbosses.utils.entity.handlers; + +import com.songoda.core.compatibility.ServerVersion; +import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; + +public class TurtleHandler implements ICustomEntityHandler { + + @Override + public LivingEntity getBaseEntity(String entityType, Location spawnLocation) { + 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..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 @@ -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 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/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/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..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 @@ -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,11 +14,9 @@ import org.bukkit.entity.Skeleton; */ public class WitherSkeletonHandler 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.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 fe5fe33..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,18 +1,8 @@ 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 +14,7 @@ public abstract class FileHandler<T> implements IFileHandler<T> { 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; @@ -34,22 +24,18 @@ public abstract class FileHandler<T> implements IFileHandler<T> { @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); } } + public File getFile() { + return this.file; + } } 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/YmlFileHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/file/YmlFileHandler.java index b861e65..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 @@ -1,15 +1,9 @@ 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; import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; /** * @author Charles Cullen @@ -21,7 +15,7 @@ public class YmlFileHandler implements IFileHandler<FileConfiguration> { 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; @@ -31,18 +25,10 @@ public class YmlFileHandler implements IFileHandler<FileConfiguration> { @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); @@ -59,4 +45,7 @@ public class YmlFileHandler implements IFileHandler<FileConfiguration> { FileUtils.get().saveFile(this.file, config); } + public File getFile() { + return this.file; + } } 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..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; @@ -41,44 +42,44 @@ public class ItemStackConverter implements IReplaceableConverter<ItemStackHolder String type, name = null, skullOwner = null; List<String> 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,35 +99,32 @@ public class ItemStackConverter implements IReplaceableConverter<ItemStackHolder public ItemStack from(ItemStackHolder itemStackHolder, Map<String, String> 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); + CompatibleMaterial cMaterial = CompatibleMaterial.getMaterial(itemStackHolder.getType()); + Material material = cMaterial.getMaterial(); - if(material == null) return itemStack; + if (material == null) return itemStack; itemStack.setType(material); Integer amount = itemStackHolder.getAmount(); - Short durability = itemStackHolder.getDurability(), spawnerId = itemStackHolder.getSpawnerId(); + Short durability = (short) cMaterial.getData(), spawnerId = itemStackHolder.getSpawnerId(); + String name = itemStackHolder.getName(), skullOwner = itemStackHolder.getSkullOwner(); List<String> lore = itemStackHolder.getLore(), enchants = itemStackHolder.getEnchants(); - if(type.contains(":")) { - durability = Short.valueOf(type.split(":")[1]); - } + if (durability != -1) 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 +133,7 @@ public class ItemStackConverter implements IReplaceableConverter<ItemStackHolder //----------- // SET LORE //----------- - if(lore != null) { + if (lore != null) { List<String> replacedLore = new ArrayList<>(lore); replacedLore.replaceAll(s -> s.replace('&', '§')); @@ -147,12 +145,12 @@ public class ItemStackConverter implements IReplaceableConverter<ItemStackHolder //---------------------------------------------- // SET OWNER, SPAWNER ID, OR UPDATE ITEM META //---------------------------------------------- - if(skullOwner != null) { + if (skullOwner != null) { SkullMeta skullMeta = (SkullMeta) itemMeta; skullMeta.setOwner(skullOwner); itemStack.setItemMeta(skullMeta); - } else if(spawnerId != null) { + } else if (spawnerId != null) { BlockStateMeta blockStateMeta = (BlockStateMeta) itemMeta; BlockState blockState = blockStateMeta.getBlockState(); CreatureSpawner creatureSpawner = (CreatureSpawner) blockState; @@ -165,7 +163,7 @@ public class ItemStackConverter implements IReplaceableConverter<ItemStackHolder } } - if(amount != null && amount > 1) { + if (amount != null && amount > 1) { itemStack.setAmount(amount); } @@ -173,10 +171,10 @@ public class ItemStackConverter implements IReplaceableConverter<ItemStackHolder } private String replaceString(String input, Map<String, String> 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 f0f64b4..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 @@ -1,8 +1,10 @@ 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; +import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import java.util.List; @@ -17,11 +19,16 @@ public class ItemStackHolderConverter implements IConverter<ItemStackHolder, Con @Override public ItemStackHolder to(ConfigurationSection configurationSection) { - if(configurationSection == null) return null; + if (configurationSection == null) return null; Integer amount = (Integer) configurationSection.get("amount", null); - String type = configurationSection.getString("type", null); + CompatibleMaterial material = CompatibleMaterial.getMaterial(configurationSection.getString("type", null)); + + String type = material.getMaterial().name(); + Short durability = (Short) configurationSection.get("durability", null); + if (material.getData() != -1) durability = (short) material.getData(); + String name = configurationSection.getString("name", null); List<String> lore = (List<String>) configurationSection.getList("lore", null); List<String> enchants = (List<String>) 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 57d83ef..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 @@ -1,12 +1,12 @@ 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; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -25,7 +25,6 @@ import java.util.*; */ public class ItemStackUtils { - private static final VersionHandler versionHandler = new VersionHandler(); private static final Map<EntityType, Material> spawnableEntityMaterials; private static final Map<EntityType, Short> spawnableEntityIds; @@ -33,7 +32,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 +47,7 @@ public class ItemStackUtils { } public static List<EntityType> 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 +58,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<String,String> replaceMap) { + public static ItemStack createItemStack(ItemStack itemStack, Map<String, String> replaceMap) { return createItemStack(itemStack, replaceMap, null); } - public static ItemStack createItemStack(ItemStack itemStack, Map<String,String> replaceMap, Map<String,Object> compoundData) { + public static ItemStack createItemStack(ItemStack itemStack, Map<String, String> replaceMap, Map<String, Object> compoundData) { ItemStack cloneStack = itemStack.clone(); ItemMeta itemMeta = cloneStack.getItemMeta(); boolean hasName = cloneStack.getItemMeta().hasDisplayName(); @@ -78,21 +77,21 @@ public class ItemStackUtils { String name = ""; List<String> 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 +103,7 @@ public class ItemStackUtils { cloneStack.setItemMeta(itemMeta); - if(compoundData == null || compoundData.isEmpty()) return cloneStack; + if (compoundData == null || compoundData.isEmpty()) return cloneStack; return cloneStack; } @@ -114,11 +113,16 @@ public class ItemStackUtils { } public static ItemStack createItemStack(ConfigurationSection configurationSection, int amount, Map<String, String> replacedMap) { - String type = configurationSection.getString("type"); + + CompatibleMaterial material = CompatibleMaterial.getMaterial(configurationSection.getString("type")); + + String type = material.getMaterial().name(); String name = configurationSection.getString("name"); List<String> lore = configurationSection.getStringList("lore"); List<String> 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<Enchantment, Integer> map = new HashMap<>(); List<String> newLore = new ArrayList<>(); @@ -126,14 +130,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 +149,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 +174,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 +186,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 +201,29 @@ 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")) { - short dura = itemStack.getType().getMaxDurability(); - dura -= (short) durability - 1; + if (durability != null) + itemStack.setDurability(durability); - 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 +231,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 +241,13 @@ public class ItemStackUtils { public static void applyDisplayName(ItemStack itemStack, String name, Map<String, String> 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 +262,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 +281,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 +293,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 +321,16 @@ public class ItemStackUtils { public static void giveItems(Player player, List<ItemStack> 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 +344,18 @@ public class ItemStackUtils { public static void takeItems(Player player, Map<ItemStack, Integer> 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 +372,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(); } @@ -384,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<String> lore = (List<String>) configurationSection.getList("lore", null); List<String> enchants = (List<String>) configurationSection.getList("enchants", null); @@ -397,25 +401,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..c902694 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,7 +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; import java.util.HashMap; @@ -9,7 +7,6 @@ import java.util.Map; public class MaterialUtils { - private static final VersionHandler versionHandler = new VersionHandler(); private static Map<Integer, Material> materialIdMap; static { @@ -18,7 +15,8 @@ public class MaterialUtils { for (Material material : Material.values()) { try { materialIdMap.put(material.getId(), material); - } catch (Exception ignored) { } + } catch (Exception ignored) { + } } } @@ -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/itemstack/converters/EnchantConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/converters/EnchantConverter.java index d630207..4845063 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/converters/EnchantConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/itemstack/converters/EnchantConverter.java @@ -20,12 +20,12 @@ public class EnchantConverter implements IConverter<List<String>, Map<Enchantmen public List<String> to(Map<Enchantment, Integer> enchantmentIntegerMap) { List<String> enchants = new ArrayList<>(); - for(Map.Entry<Enchantment, Integer> entry : enchantmentIntegerMap.entrySet()) { + for (Map.Entry<Enchantment, Integer> 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<List<String>, Map<Enchantmen public Map<Enchantment, Integer> from(List<String> strings) { Map<Enchantment, Integer> 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<String, Material> { @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/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<String> lore; - @Expose @Getter private List<String> 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<String> lore; + @Expose + private List<String> enchants; + @Expose + private String skullOwner; + @Expose + private Short spawnerId; public ItemStackHolder(Integer amount, String type, Short durability, String name, List<String> lore, List<String> 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<String> getLore() { + return this.lore; + } + + public List<String> 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..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 @@ -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<Panel> { // //-------------------------------------------------- - @Getter private static final ItemStackConverter ITEM_STACK_CONVERTER = new ItemStackConverter(); - @Getter private static final List<Panel> PANELS = new ArrayList<>(); + private static final ItemStackConverter ITEM_STACK_CONVERTER = new ItemStackConverter(); + private static final List<Panel> PANELS = new ArrayList<>(); private static JavaPlugin PLUGIN; @@ -57,16 +54,17 @@ public class Panel implements Listener, ICloneable<Panel> { private final Map<UUID, Integer> currentPageContainer = new HashMap<>(); private final List<UUID> 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) -> {}; + private PanelCloseAction panelClose = (p) -> { + }; //-------------------------------------------------- // @@ -78,12 +76,12 @@ public class Panel implements Listener, ICloneable<Panel> { * 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"); } @@ -97,7 +95,7 @@ public class Panel implements Listener, ICloneable<Panel> { * 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); @@ -106,10 +104,10 @@ public class Panel implements Listener, ICloneable<Panel> { /** * 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); @@ -125,41 +123,39 @@ public class Panel implements Listener, ICloneable<Panel> { PANELS.add(this); } + public static ItemStackConverter getITEM_STACK_CONVERTER() { + return Panel.ITEM_STACK_CONVERTER; + } + + public static List<Panel> getPANELS() { + return Panel.PANELS; + } + //-------------------------------------------------- // // P A N E L L I S T E N E R S // //-------------------------------------------------- + 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); } //-------------------------------------------------- @@ -168,11 +164,25 @@ public class Panel implements Listener, ICloneable<Panel> { // //-------------------------------------------------- + @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. */ @@ -213,7 +223,7 @@ public class Panel implements Listener, ICloneable<Panel> { * @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; } @@ -223,8 +233,8 @@ public class Panel implements Listener, ICloneable<Panel> { * 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. */ @@ -234,18 +244,6 @@ public class Panel implements Listener, ICloneable<Panel> { 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. * @@ -283,41 +281,6 @@ public class Panel implements Listener, ICloneable<Panel> { 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(); } @@ -331,7 +294,7 @@ public class Panel implements Listener, ICloneable<Panel> { * @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; @@ -344,14 +307,14 @@ public class Panel implements Listener, ICloneable<Panel> { * 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; @@ -375,7 +338,7 @@ public class Panel implements Listener, ICloneable<Panel> { * @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; @@ -389,11 +352,11 @@ public class Panel implements Listener, ICloneable<Panel> { * 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 <T> Panel setParentPanelHandler(IVariablePanelHandler<T> variablePanelHandler, T variable) { - if(!this.panelBuilderSettings.isBackButton()) return this; + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -407,12 +370,12 @@ public class Panel implements Listener, ICloneable<Panel> { * 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 <T, Y> Panel setParentPanelHandler(ISubVariablePanelHandler<T, Y> variablePanelHandler, T variable, Y subVariable) { - if(!this.panelBuilderSettings.isBackButton()) return this; + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -420,8 +383,8 @@ public class Panel implements Listener, ICloneable<Panel> { return this; } - public <T, Y, Z> Panel setParentPanelHandler(ISubSubVariablePanelHandler<T,Y,Z> panelHandler, T variable, Y subVariable, Z subSubVariable) { - if(!this.panelBuilderSettings.isBackButton()) return this; + public <T, Y, Z> Panel setParentPanelHandler(ISubSubVariablePanelHandler<T, Y, Z> panelHandler, T variable, Y subVariable, Z subSubVariable) { + if (!this.panelBuilderSettings.isBackButton()) return this; int slot = this.panelBuilderSettings.getBackButtonSlot() - 1; @@ -436,7 +399,7 @@ public class Panel implements Listener, ICloneable<Panel> { * @return the current panel */ public Panel setExitButton() { - if(!this.panelBuilderSettings.isExitButton()) return this; + if (!this.panelBuilderSettings.isExitButton()) return this; int slot = this.panelBuilderSettings.getExitButtonSlot(); @@ -444,17 +407,10 @@ public class Panel implements Listener, ICloneable<Panel> { 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. - * + * <p> * ** ONLY USE THIS IF YOU KNOW WHAT YOU'RE DOING ** */ public void destroy() { @@ -466,7 +422,7 @@ public class Panel implements Listener, ICloneable<Panel> { this.openedUsers.forEach(uuid -> { Player player = Bukkit.getPlayer(uuid); - if(player == null) return; + if (player == null) return; player.closeInventory(); }); @@ -486,10 +442,10 @@ public class Panel implements Listener, ICloneable<Panel> { 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); } @@ -516,10 +472,10 @@ public class Panel implements Listener, ICloneable<Panel> { 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); } } @@ -527,9 +483,10 @@ public class Panel implements Listener, ICloneable<Panel> { 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 // //-------------------------------------------------- @@ -537,15 +494,15 @@ public class Panel implements Listener, ICloneable<Panel> { * 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); } } @@ -567,52 +524,46 @@ public class Panel implements Listener, ICloneable<Panel> { * @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. @@ -620,30 +571,121 @@ public class Panel implements Listener, ICloneable<Panel> { 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; + /** + * 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; + } + + public PanelBuilderCounter getPanelBuilderCounter() { + return this.panelBuilderCounter; + } + + public Sound getClickSound() { + 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; + } + + 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/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/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..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 @@ -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<String, String> replaceMap = new HashMap<>(); + private final Map<String, String> replaceMap = new HashMap<>(); private final Set<Integer> defaultSlots = new HashSet<>(); private final ConfigurationSection configurationSection; private final PanelBuilderSettings panelBuilderSettings; - @Getter private PanelBuilderCounter panelBuilderCounter; + private PanelBuilderCounter panelBuilderCounter; private String title; private Inventory inventory; @@ -43,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) { @@ -52,7 +51,7 @@ public class PanelBuilder { } public PanelBuilder addReplaceData(Map<String, String> replaceMap) { - if(replaceMap != null) this.replaceMap.putAll(replaceMap); + if (replaceMap != null) this.replaceMap.putAll(replaceMap); return this; } @@ -81,10 +80,10 @@ public class PanelBuilder { Map<String, ClickAction> 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))); } }); @@ -93,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<String, Set<Integer>> slotsWith = this.panelBuilderCounter.getSlotsWithCounter(); Map<String, Map<Integer, Object>> 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<Integer> current = slotsWith.getOrDefault(identifier, new HashSet<>()); @@ -120,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<Integer, Object> current = specialSlotsWith.get(identifier); current.put(slot, innerSection.get(identifier)); @@ -129,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)); } @@ -142,8 +143,8 @@ public class PanelBuilder { } private String replace(String input) { - for(Map.Entry<String, String> entry : replaceMap.entrySet()) { - if(input.contains(entry.getKey())) { + for (Map.Entry<String, String> entry : replaceMap.entrySet()) { + if (input.contains(entry.getKey())) { input = input.replace(entry.getKey(), entry.getValue()); } } @@ -151,10 +152,18 @@ 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)); } return input; } + + public Map<String, String> 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..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 @@ -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,20 +15,20 @@ import java.util.Set; */ public class PanelBuilderCounter { - @Getter private final Map<String, Map<Integer, Object>> specialValuesCounter = new HashMap<>(); - @Getter private final Map<String, Set<Integer>> slotsWithCounter = new HashMap<>(); - @Getter private final Map<String, ClickAction> clickActions = new HashMap<>(); - @Getter private final Map<Integer, String> buttonCounters = new HashMap<>(); - @Getter private final Map<String, ItemStack> itemStacks = new HashMap<>(); - @Getter private final Map<Integer, Integer> pageData = new HashMap<>(); + private final Map<String, Map<Integer, Object>> specialValuesCounter = new HashMap<>(); + private final Map<String, Set<Integer>> slotsWithCounter = new HashMap<>(); + private final Map<String, ClickAction> clickActions = new HashMap<>(); + private final Map<Integer, String> buttonCounters = new HashMap<>(); + private final Map<String, ItemStack> itemStacks = new HashMap<>(); + private final Map<Integer, Integer> pageData = new HashMap<>(); public boolean isButtonAtSlot(int slot) { for (Set<Integer> integers : this.slotsWithCounter.values()) { - if(integers.contains(slot)) return true; + if (integers.contains(slot)) return true; } - for(Map<Integer, Object> map : this.specialValuesCounter.values()) { - if(map.containsKey(slot)) return true; + for (Map<Integer, Object> map : this.specialValuesCounter.values()) { + if (map.containsKey(slot)) return true; } return false; @@ -102,4 +101,27 @@ public class PanelBuilderCounter { return clone; } + public Map<String, Map<Integer, Object>> getSpecialValuesCounter() { + return this.specialValuesCounter; + } + + public Map<String, Set<Integer>> getSlotsWithCounter() { + return this.slotsWithCounter; + } + + public Map<String, ClickAction> getClickActions() { + return this.clickActions; + } + + public Map<Integer, String> getButtonCounters() { + return this.buttonCounters; + } + + public Map<String, ItemStack> getItemStacks() { + return this.itemStacks; + } + + public Map<Integer, Integer> 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..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 @@ -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(); @@ -22,12 +21,39 @@ 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")); } + 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/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<PotionEffectHolder, Pot int duration = potionEffect.getDuration(); int level = potionEffect.getAmplifier(); - return new PotionEffectHolder(this.potionEffectTypeConverter.to(potionEffectType), level+1, duration/20); + return new PotionEffectHolder(this.potionEffectTypeConverter.to(potionEffectType), level + 1, duration / 20); } @Override @@ -35,13 +35,13 @@ public class PotionEffectConverter implements IConverter<PotionEffectHolder, Pot Integer level = potionHolder.getLevel(); PotionEffectType potionEffectTypeConverted = this.potionEffectTypeConverter.from(potionEffectType); - if(duration == null) duration = 5; - if(level == null) level = 1; + if (duration == null) duration = 5; + if (level == null) level = 1; - if(duration < 1) duration = (Integer.MAX_VALUE / 20); + if (duration < 1) duration = (Integer.MAX_VALUE / 20); - if(potionEffectTypeConverted == null) return null; - if(potionEffectType != null) return new PotionEffect(potionEffectTypeConverted, duration*20, level-1); + if (potionEffectTypeConverted == null) return null; + if (potionEffectType != null) return new PotionEffect(potionEffectTypeConverted, duration * 20, level - 1); return null; } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/converters/PotionEffectTypeConverter.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/converters/PotionEffectTypeConverter.java index 6107fb3..7e983ac 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/converters/PotionEffectTypeConverter.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/potion/converters/PotionEffectTypeConverter.java @@ -15,18 +15,18 @@ public class PotionEffectTypeConverter implements IConverter<String, PotionEffec public String to(PotionEffectType potionEffectType) { PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByEffect(potionEffectType); - if(potionEffectFinder == null) return null; + if (potionEffectFinder == null) return null; return potionEffectFinder.getFancyName(); } @Override public PotionEffectType from(String s) { - if(s == null) return null; + if (s == null) return null; PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByName(s); - if(potionEffectFinder == null) return null; + if (potionEffectFinder == null) return null; return potionEffectFinder.getPotionEffectType(); } 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..d243450 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 void setType(String type) { + this.type = type; + } + + public Integer getLevel() { + return this.level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public Integer getDuration() { + return this.duration; + } + + public void setDuration(Integer duration) { + this.duration = duration; + } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/target/TargetHandler.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/target/TargetHandler.java index f15ff20..ca8ed01 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/target/TargetHandler.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/target/TargetHandler.java @@ -32,12 +32,11 @@ public abstract class TargetHandler implements ITargetHandler { ServerUtils.get().runLaterAsync(100L, () -> { 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 - * + * <p> * 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/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 dcf0ce0..0000000 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/version/VersionHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -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; - -/** - * @author Charles Cullen - * @version 1.0.0 - * @since 27-Jun-18 - */ -public class VersionHandler { - - @Getter 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); - } - - public ItemStack getItemInHand(HumanEntity humanEntity) { - if(this.version.isLessThanOrEqualTo(Versions.v1_8_R3)) { - return humanEntity.getItemInHand(); - } else { - return humanEntity.getInventory().getItemInMainHand(); - } - } - - public void setItemInHand(HumanEntity humanEntity, ItemStack itemStack) { - if(this.version.isLessThanOrEqualTo(Versions.v1_8_R3)) { - humanEntity.setItemInHand(itemStack); - } else { - humanEntity.getInventory().setItemInMainHand(itemStack); - } - } - -} 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 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>EpicBosses</artifactId> 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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>EpicBosses</artifactId> - <groupId>com.songoda.epicbosses</groupId> - <version>maven-version-number</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>WorldGuardHelper</artifactId> - - <dependencies> - <dependency> - <groupId>org.spigotmc</groupId> - <artifactId>spigot</artifactId> - <version>1.14.4</version> - <scope>provided</scope> - </dependency> - </dependencies> -</project> \ 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<String> getRegionNames(Location location); - - boolean isMobSpawningAllowed(Location location); - -} diff --git a/pom.xml b/pom.xml index f5c7dff..c4c506e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -14,27 +14,18 @@ <module>api-modules/FactionsOne</module> <module>api-modules/FactionsUUID</module> <module>api-modules/LegacyFactions</module> - <module>api-modules/WorldGuard</module> - <module>api-modules/WorldGuard-Legacy</module> <module>plugin-modules/Core</module> <module>plugin-modules/FactionHelper</module> - <module>plugin-modules/WorldGuardHelper</module> </modules> <properties> <plugin.version>maven-version-number</plugin.version> <plugin.name>EpicBosses</plugin.name> - <plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main> + <plugin.main>com.songoda.epicbosses.EpicBosses</plugin.main> <plugin.author>AMinecraftDev</plugin.author> </properties> <dependencies> - <dependency> - <groupId>net.milkbowl</groupId> - <artifactId>vault</artifactId> - <version>1.7.1</version> - <scope>provided</scope> - </dependency> <dependency> <groupId>com.wasteofplastic</groupId> <artifactId>askyblock</artifactId> @@ -47,18 +38,6 @@ <version>1.16.22</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>org.bstats</groupId> - <artifactId>bstats-bukkit</artifactId> - <version>1.2</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>com.gmail.filoghost.holographicdisplays</groupId> - <artifactId>holographicdisplays-api</artifactId> - <version>2.3.2</version> - <scope>provided</scope> - </dependency> <dependency> <groupId>me.clip</groupId> <artifactId>placeholderapi</artifactId> @@ -72,10 +51,6 @@ <id>private-repo</id> <url>http://repo.songoda.com/artifactory/private/</url> </repository> - <repository> - <id>bstats-repo</id> - <url>http://repo.bstats.org/content/repositories/releases/</url> - </repository> </repositories> <build> @@ -138,21 +113,6 @@ <artifactId>LegacyFactions</artifactId> <version>${project.version}</version> </artifactItem> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>WorldGuardHelper</artifactId> - <version>${project.version}</version> - </artifactItem> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>WorldGuard</artifactId> - <version>${project.version}</version> - </artifactItem> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>WorldGuard-Legacy</artifactId> - <version>${project.version}</version> - </artifactItem> <artifactItem> <groupId>${project.groupId}</groupId> <artifactId>Core</artifactId>