mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-02-08 07:01:23 +01:00
Formatting clean up.
This commit is contained in:
parent
22d58040f2
commit
5b8c5f47e0
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -56,14 +56,14 @@ public class BossAPI {
|
||||
* 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(EpicBosses plugin) {
|
||||
if(PLUGIN != null) {
|
||||
if (PLUGIN != null) {
|
||||
Debug.ATTEMPTED_TO_UPDATE_PLUGIN.debug();
|
||||
return;
|
||||
}
|
||||
@ -78,29 +78,30 @@ public class BossAPI {
|
||||
* using the BossAPI#createBaseBossEntity
|
||||
* method or by manually creating a BossEntity.
|
||||
*
|
||||
* @param name - Name for the boss section.
|
||||
* @param name - Name for the boss section.
|
||||
* @param bossEntity - The boss section.
|
||||
* @return false if it failed, true if it saved successfully.
|
||||
*/
|
||||
public static boolean registerBossEntity(String name, BossEntity bossEntity) {
|
||||
if(name == null || bossEntity == null) return false;
|
||||
if (name == null || bossEntity == null) return false;
|
||||
|
||||
PLUGIN.getBossEntityContainer().saveData(name, bossEntity);
|
||||
PLUGIN.getBossesFileManager().save();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to register a Minion Entity into
|
||||
* the plugin after it has been created
|
||||
* using the BossAPI#createBaseMinionEntity
|
||||
* method or by manually creating a MinionEntity.
|
||||
*
|
||||
* @param name - Name for the minion section.
|
||||
* @param name - Name for the minion section.
|
||||
* @param minionEntity - The minion section.
|
||||
* @return false if it failed, true if it saved successfully.
|
||||
*/
|
||||
public static boolean registerMinionEntity(String name, MinionEntity minionEntity) {
|
||||
if(name == null || minionEntity == null) return false;
|
||||
if (name == null || minionEntity == null) return false;
|
||||
|
||||
PLUGIN.getMinionEntityContainer().saveData(name, minionEntity);
|
||||
PLUGIN.getMinionsFileManager().save();
|
||||
@ -144,8 +145,8 @@ public class BossAPI {
|
||||
* @return name of the boss from the BossContainer or null if not found.
|
||||
*/
|
||||
public static String getBossEntityName(BossEntity bossEntity) {
|
||||
for(Map.Entry<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();
|
||||
}
|
||||
}
|
||||
@ -172,8 +173,8 @@ public class BossAPI {
|
||||
* @return name of the skill from the SkillsFileManager or null if not found.
|
||||
*/
|
||||
public static String getSkillName(Skill skill) {
|
||||
for(Map.Entry<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;
|
||||
@ -187,8 +188,8 @@ public class BossAPI {
|
||||
* @return name of the skill from the SkillsFileManager or null if not found.
|
||||
*/
|
||||
public static String getAutoSpawnName(AutoSpawn autoSpawn) {
|
||||
for(Map.Entry<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;
|
||||
@ -202,8 +203,8 @@ public class BossAPI {
|
||||
* @return name of the dropTable from the DropTableFileManager or null if not found.
|
||||
*/
|
||||
public static String getDropTableName(DropTable dropTable) {
|
||||
for(Map.Entry<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;
|
||||
@ -217,8 +218,8 @@ public class BossAPI {
|
||||
* @return name of the minion from the MinionContainer or null if not found.
|
||||
*/
|
||||
public static String getMinionEntityName(MinionEntity minionEntity) {
|
||||
for(Map.Entry<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();
|
||||
}
|
||||
}
|
||||
@ -227,15 +228,15 @@ public class BossAPI {
|
||||
}
|
||||
|
||||
public static JsonObject createNewDropTableRewards(String type) {
|
||||
if(type.equalsIgnoreCase("SPRAY")) {
|
||||
if (type.equalsIgnoreCase("SPRAY")) {
|
||||
SprayTableElement sprayTableElement = new SprayTableElement(new HashMap<>(), false, 15, 15);
|
||||
|
||||
return convertObjectToJsonObject(sprayTableElement);
|
||||
} else if(type.equalsIgnoreCase("DROP")) {
|
||||
} else if (type.equalsIgnoreCase("DROP")) {
|
||||
DropTableElement dropTableElement = new DropTableElement(new HashMap<>(), false, 15);
|
||||
|
||||
return convertObjectToJsonObject(dropTableElement);
|
||||
} else if(type.equalsIgnoreCase("GIVE")) {
|
||||
} else if (type.equalsIgnoreCase("GIVE")) {
|
||||
GiveTableElement giveTableElement = new GiveTableElement(new HashMap<>());
|
||||
|
||||
return convertObjectToJsonObject(giveTableElement);
|
||||
@ -248,19 +249,19 @@ public class BossAPI {
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
String jsonString;
|
||||
|
||||
if(type.equalsIgnoreCase("COMMAND")) {
|
||||
if (type.equalsIgnoreCase("COMMAND")) {
|
||||
CommandSkillElement commandSkillElement = new CommandSkillElement(new ArrayList<>());
|
||||
|
||||
jsonString = BossesGson.get().toJson(commandSkillElement);
|
||||
} else if(type.equalsIgnoreCase("POTION")) {
|
||||
} else if (type.equalsIgnoreCase("POTION")) {
|
||||
PotionSkillElement potionSkillElement = new PotionSkillElement(new ArrayList<>());
|
||||
|
||||
jsonString = BossesGson.get().toJson(potionSkillElement);
|
||||
} else if(type.equalsIgnoreCase("CUSTOM")) {
|
||||
} else if (type.equalsIgnoreCase("CUSTOM")) {
|
||||
CustomSkillElement customSkillElement = new CustomSkillElement(new SubCustomSkillElement("", 0.0, null));
|
||||
|
||||
jsonString = BossesGson.get().toJson(customSkillElement);
|
||||
} else if(type.equalsIgnoreCase("GROUP")) {
|
||||
} else if (type.equalsIgnoreCase("GROUP")) {
|
||||
GroupSkillElement groupSkillElement = new GroupSkillElement(new ArrayList<>());
|
||||
|
||||
jsonString = BossesGson.get().toJson(groupSkillElement);
|
||||
@ -295,7 +296,7 @@ public class BossAPI {
|
||||
* @return an instance of the drop table if successful
|
||||
*/
|
||||
public static Skill createBaseSkill(String name, String type, String mode) {
|
||||
if(PLUGIN.getSkillsFileManager().getSkill(name) != null) {
|
||||
if (PLUGIN.getSkillsFileManager().getSkill(name) != null) {
|
||||
Debug.SKILL_NAME_EXISTS.debug(name);
|
||||
return null;
|
||||
}
|
||||
@ -310,12 +311,12 @@ public class BossAPI {
|
||||
* Used to create a new base drop table
|
||||
* with the specified arguments.
|
||||
*
|
||||
* @param name - name of the drop table.
|
||||
* @param name - name of the drop table.
|
||||
* @param dropType - drop table type.
|
||||
* @return an instance of the drop table if successful
|
||||
*/
|
||||
public static DropTable createBaseDropTable(String name, String dropType) {
|
||||
if(PLUGIN.getDropTableFileManager().getDropTable(name) != null) {
|
||||
if (PLUGIN.getDropTableFileManager().getDropTable(name) != null) {
|
||||
Debug.DROPTABLE_NAME_EXISTS.debug(name);
|
||||
return null;
|
||||
}
|
||||
@ -323,15 +324,15 @@ public class BossAPI {
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
String jsonString;
|
||||
|
||||
if(dropType.equalsIgnoreCase("SPRAY")) {
|
||||
if (dropType.equalsIgnoreCase("SPRAY")) {
|
||||
SprayTableElement sprayTableElement = new SprayTableElement(new HashMap<>(), false, 100, 10);
|
||||
|
||||
jsonString = BossesGson.get().toJson(sprayTableElement);
|
||||
} else if(dropType.equalsIgnoreCase("GIVE")) {
|
||||
} else if (dropType.equalsIgnoreCase("GIVE")) {
|
||||
GiveTableElement giveTableElement = new GiveTableElement(new HashMap<>());
|
||||
|
||||
jsonString = BossesGson.get().toJson(giveTableElement);
|
||||
} else if(dropType.equalsIgnoreCase("DROP")) {
|
||||
} else if (dropType.equalsIgnoreCase("DROP")) {
|
||||
DropTableElement dropTableElement = new DropTableElement(new HashMap<>(), false, 10);
|
||||
|
||||
jsonString = BossesGson.get().toJson(dropTableElement);
|
||||
@ -353,7 +354,7 @@ public class BossAPI {
|
||||
* elements are filled in editing can be disabled
|
||||
* and the boss can be spawned.
|
||||
*
|
||||
* @param name - boss name
|
||||
* @param name - boss name
|
||||
* @param entityTypeInput - entity type
|
||||
* @return null if something went wrong, or the BossEntity that was created.
|
||||
*/
|
||||
@ -361,7 +362,7 @@ public class BossAPI {
|
||||
String input = entityTypeInput.split(":")[0];
|
||||
EntityFinder entityFinder = EntityFinder.get(input);
|
||||
|
||||
if(PLUGIN.getBossEntityContainer().exists(name)) {
|
||||
if (PLUGIN.getBossEntityContainer().exists(name)) {
|
||||
Debug.BOSS_NAME_EXISTS.debug(name);
|
||||
return null;
|
||||
}
|
||||
@ -399,7 +400,7 @@ public class BossAPI {
|
||||
* elements are filled in editing can be disabled
|
||||
* and the minion can be spawned in skills.
|
||||
*
|
||||
* @param name - minion name
|
||||
* @param name - minion name
|
||||
* @param entityTypeInput - entity type
|
||||
* @return null if something went wrong, or the MinionEntity that was created.
|
||||
*/
|
||||
@ -407,7 +408,7 @@ public class BossAPI {
|
||||
String input = entityTypeInput.split(":")[0];
|
||||
EntityFinder entityFinder = EntityFinder.get(input);
|
||||
|
||||
if(PLUGIN.getMinionEntityContainer().exists(name)) {
|
||||
if (PLUGIN.getMinionEntityContainer().exists(name)) {
|
||||
Debug.MINION_NAME_EXISTS.debug(name);
|
||||
return null;
|
||||
}
|
||||
@ -420,7 +421,7 @@ public class BossAPI {
|
||||
|
||||
entityStatsElements.add(entityStatsElement);
|
||||
|
||||
MinionEntity minionEntity = new MinionEntity(true,entityStatsElements);
|
||||
MinionEntity minionEntity = new MinionEntity(true, entityStatsElements);
|
||||
boolean result = PLUGIN.getMinionEntityContainer().saveData(name, minionEntity);
|
||||
|
||||
if (!result) {
|
||||
@ -441,7 +442,7 @@ public class BossAPI {
|
||||
* @return an instance of the auto spawn if successful
|
||||
*/
|
||||
public static AutoSpawn createBaseAutoSpawn(String name) {
|
||||
if(PLUGIN.getAutoSpawnFileManager().getAutoSpawn(name) != null) {
|
||||
if (PLUGIN.getAutoSpawnFileManager().getAutoSpawn(name) != null) {
|
||||
Debug.AUTOSPAWN_NAME_EXISTS.debug(name);
|
||||
return null;
|
||||
}
|
||||
@ -461,13 +462,13 @@ public class BossAPI {
|
||||
* specified bossEntity.
|
||||
*
|
||||
* @param bossEntity - targetted BossEntity
|
||||
* @param location - Location to spawn the boss.
|
||||
* @param player - Player who spawned the boss.
|
||||
* @param itemStack - The itemstack used to spawn the boss.
|
||||
* @param location - Location to spawn the boss.
|
||||
* @param player - Player who spawned the boss.
|
||||
* @param itemStack - The itemstack used to spawn the boss.
|
||||
* @return ActiveBossHolder class with stored information
|
||||
*/
|
||||
public static ActiveBossHolder spawnNewBoss(BossEntity bossEntity, Location location, Player player, ItemStack itemStack, boolean customSpawnMessage) {
|
||||
if(bossEntity.isEditing()) {
|
||||
if (bossEntity.isEditing()) {
|
||||
Debug.ATTEMPTED_TO_SPAWN_WHILE_DISABLED.debug();
|
||||
return null;
|
||||
}
|
||||
@ -476,7 +477,7 @@ public class BossAPI {
|
||||
|
||||
ActiveBossHolder activeBossHolder = PLUGIN.getBossEntityManager().createActiveBossHolder(bossEntity, location, name, player);
|
||||
|
||||
if(activeBossHolder == null) {
|
||||
if (activeBossHolder == null) {
|
||||
Debug.FAILED_TO_CREATE_ACTIVE_BOSS_HOLDER.debug();
|
||||
return null;
|
||||
}
|
||||
@ -485,7 +486,7 @@ public class BossAPI {
|
||||
|
||||
PreBossSpawnEvent preBossSpawnEvent;
|
||||
|
||||
if(player != null && itemStack != null) {
|
||||
if (player != null && itemStack != null) {
|
||||
preBossSpawnEvent = new PreBossSpawnItemEvent(activeBossHolder, player, itemStack);
|
||||
} else {
|
||||
preBossSpawnEvent = new PreBossSpawnEvent(activeBossHolder);
|
||||
@ -502,13 +503,13 @@ public class BossAPI {
|
||||
* bossEntity, under the activebossholder.
|
||||
*
|
||||
* @param activeBossHolder - targeted active boss
|
||||
* @param skill - the skill from the skills.json
|
||||
* @param skill - the skill from the skills.json
|
||||
*/
|
||||
public static void spawnNewMinion(ActiveBossHolder activeBossHolder, Skill skill) {
|
||||
if(skill.getType().equalsIgnoreCase("CUSTOM")) {
|
||||
if (skill.getType().equalsIgnoreCase("CUSTOM")) {
|
||||
CustomSkillElement customSkillElement = PLUGIN.getBossSkillManager().getCustomSkillElement(skill);
|
||||
|
||||
if(customSkillElement.getCustom().getType().equalsIgnoreCase("MINIONS")) {
|
||||
if (customSkillElement.getCustom().getType().equalsIgnoreCase("MINIONS")) {
|
||||
CustomMinionSkillElement customMinionSkillElement = customSkillElement.getCustom().getCustomMinionSkillData();
|
||||
|
||||
PLUGIN.getBossEntityManager().spawnMinionsOnBossHolder(activeBossHolder, skill, customMinionSkillElement);
|
||||
|
@ -24,12 +24,12 @@ public class BossCmd extends SubCommandService<CommandSender> {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(args.length == 0) {
|
||||
if (args.length == 0) {
|
||||
Bukkit.dispatchCommand(sender, "boss help");
|
||||
return;
|
||||
}
|
||||
|
||||
if(handleSubCommand(sender, args)) return;
|
||||
if (handleSubCommand(sender, args)) return;
|
||||
|
||||
Bukkit.dispatchCommand(sender, "boss help");
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class BossCreateCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.create.hasPermission(sender)) {
|
||||
if (!Permission.create.hasPermission(sender)) {
|
||||
Message.Boss_Create_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -47,21 +47,21 @@ public class BossCreateCmd extends SubCommand {
|
||||
String name = args[1];
|
||||
String entityTypeInput = args[2];
|
||||
|
||||
if(this.bossEntityContainer.exists(name)) {
|
||||
if (this.bossEntityContainer.exists(name)) {
|
||||
Message.Boss_Create_NameAlreadyExists.msg(sender, name);
|
||||
return;
|
||||
}
|
||||
|
||||
EntityFinder entityFinder = EntityFinder.get(entityTypeInput);
|
||||
|
||||
if(entityFinder == null) {
|
||||
if (entityFinder == null) {
|
||||
Message.Boss_Create_EntityTypeNotFound.msg(sender, entityTypeInput);
|
||||
return;
|
||||
}
|
||||
|
||||
BossEntity bossEntity = BossAPI.createBaseBossEntity(name, entityTypeInput);
|
||||
|
||||
if(bossEntity == null) {
|
||||
if (bossEntity == null) {
|
||||
Message.Boss_Create_SomethingWentWrong.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ public class BossDebugCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.debug.hasPermission(sender)) {
|
||||
if (!Permission.debug.hasPermission(sender)) {
|
||||
Message.Boss_Debug_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -37,7 +37,7 @@ public class BossDebugCmd extends SubCommand {
|
||||
Player player = (Player) sender;
|
||||
String toggled;
|
||||
|
||||
if(this.debugManager.isToggled(player.getUniqueId())) {
|
||||
if (this.debugManager.isToggled(player.getUniqueId())) {
|
||||
this.debugManager.togglePlayerOff(player.getUniqueId());
|
||||
toggled = "Off";
|
||||
} else {
|
||||
|
@ -24,12 +24,12 @@ public class BossDropTableCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_DropTable_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -28,19 +28,19 @@ public class BossEditCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_Edit_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
switch(args.length) {
|
||||
switch (args.length) {
|
||||
default:
|
||||
case 1:
|
||||
this.bossPanelManager.getBosses().openFor(player);
|
||||
@ -48,7 +48,7 @@ public class BossEditCmd extends SubCommand {
|
||||
case 2:
|
||||
String input = args[1];
|
||||
|
||||
if(!this.bossEntityContainer.exists(input)) {
|
||||
if (!this.bossEntityContainer.exists(input)) {
|
||||
Message.Boss_Edit_DoesntExist.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -31,22 +31,22 @@ public class BossGiveEggCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.give.hasPermission(sender)) {
|
||||
if (!Permission.give.hasPermission(sender)) {
|
||||
Message.Boss_GiveEgg_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 3) {
|
||||
if (args.length < 3) {
|
||||
Message.Boss_GiveEgg_InvalidArgs.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
int amount = 1;
|
||||
|
||||
if(args.length == 4) {
|
||||
if (args.length == 4) {
|
||||
String amountInput = args[3];
|
||||
|
||||
if(NumberUtils.get().isInt(amountInput)) {
|
||||
if (NumberUtils.get().isInt(amountInput)) {
|
||||
amount = Integer.valueOf(amountInput);
|
||||
} else {
|
||||
Message.General_NotNumber.msg(sender);
|
||||
@ -57,7 +57,7 @@ public class BossGiveEggCmd extends SubCommand {
|
||||
String playerInput = args[2];
|
||||
Player player = Bukkit.getPlayer(playerInput);
|
||||
|
||||
if(player == null) {
|
||||
if (player == null) {
|
||||
Message.General_NotOnline.msg(sender, playerInput);
|
||||
return;
|
||||
}
|
||||
@ -65,14 +65,14 @@ public class BossGiveEggCmd extends SubCommand {
|
||||
String bossInput = args[1];
|
||||
BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput);
|
||||
|
||||
if(bossEntity == null) {
|
||||
if (bossEntity == null) {
|
||||
Message.Boss_GiveEgg_InvalidBoss.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity);
|
||||
|
||||
if(spawnItem == null) {
|
||||
if (spawnItem == null) {
|
||||
Message.Boss_GiveEgg_NotSet.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ public class BossHelpCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(Permission.admin.hasPermission(sender) || Permission.help.hasPermission(sender)) {
|
||||
if (Permission.admin.hasPermission(sender) || Permission.help.hasPermission(sender)) {
|
||||
int pageNumber = 0;
|
||||
|
||||
if(args.length > 1) {
|
||||
if (args.length > 1) {
|
||||
Integer newNumber = NumberUtils.get().getInteger(args[1]);
|
||||
|
||||
if(newNumber != null) pageNumber = newNumber;
|
||||
if (newNumber != null) pageNumber = newNumber;
|
||||
}
|
||||
|
||||
switch (pageNumber) {
|
||||
|
@ -27,12 +27,12 @@ public class BossInfoCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_Info_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length != 2) {
|
||||
if (args.length != 2) {
|
||||
Message.Boss_Info_InvalidArgs.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class BossInfoCmd extends SubCommand {
|
||||
String input = args[1];
|
||||
BossEntity bossEntity = this.bossesFileManager.getBossEntity(input);
|
||||
|
||||
if(bossEntity == null) {
|
||||
if (bossEntity == null) {
|
||||
Message.Boss_Info_CouldntFindBoss.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ public class BossItemsCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_Items_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -25,19 +25,19 @@ public class BossKillAllCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_KillAll_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
World world = null;
|
||||
|
||||
if(args.length == 2) {
|
||||
if (args.length == 2) {
|
||||
String worldArgs = args[1];
|
||||
|
||||
world = Bukkit.getWorld(worldArgs);
|
||||
|
||||
if(world == null) {
|
||||
if (world == null) {
|
||||
Message.Boss_KillAll_WorldNotFound.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -45,7 +45,7 @@ public class BossKillAllCmd extends SubCommand {
|
||||
|
||||
int amount = this.bossEntityManager.killAllHolders(world);
|
||||
|
||||
if(args.length == 2) Message.Boss_KillAll_KilledWorld.msg(sender, amount, world.getName());
|
||||
if (args.length == 2) Message.Boss_KillAll_KilledWorld.msg(sender, amount, world.getName());
|
||||
else Message.Boss_KillAll_KilledAll.msg(sender, amount);
|
||||
}
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ public class BossListCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_List_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ public class BossMenuCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_Menu_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -29,12 +29,12 @@ public class BossNearbyCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.nearby.hasPermission(sender)) {
|
||||
if (!Permission.nearby.hasPermission(sender)) {
|
||||
Message.Boss_Nearby_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -45,12 +45,12 @@ public class BossNearbyCmd extends SubCommand {
|
||||
double maxRadius = this.plugin.getConfig().getDouble("Limits.maxNearbyRadius", 500.0);
|
||||
String nearbyFormat = this.plugin.getConfig().getString("Settings.nearbyFormat", "{name} ({distance}m)");
|
||||
|
||||
if(args.length == 2) {
|
||||
if (args.length == 2) {
|
||||
Integer newNumber = NumberUtils.get().getInteger(args[1]);
|
||||
|
||||
if(newNumber != null) radius = newNumber;
|
||||
if (newNumber != null) radius = newNumber;
|
||||
|
||||
if(radius > maxRadius) {
|
||||
if (radius > maxRadius) {
|
||||
Message.Boss_Nearby_MaxRadius.msg(player, maxRadius);
|
||||
return;
|
||||
}
|
||||
@ -59,7 +59,7 @@ public class BossNearbyCmd extends SubCommand {
|
||||
Map<ActiveBossHolder, Double> nearbyBosses = this.plugin.getBossEntityManager().getActiveBossHoldersWithinRadius(radius, location);
|
||||
Map<ActiveBossHolder, Double> sortedMap = MapUtils.get().sortByValue(nearbyBosses);
|
||||
|
||||
if(sortedMap.isEmpty()) {
|
||||
if (sortedMap.isEmpty()) {
|
||||
Message.Boss_Nearby_NoneNearby.msg(player);
|
||||
return;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||
* @author Charles Cullen
|
||||
* @version 1.0.0
|
||||
* @since 19-Nov-18
|
||||
*
|
||||
* <p>
|
||||
* boss new droptable [name] [type]
|
||||
* boss new skill [name] [type] [mode]
|
||||
* boss new command [name] [commands]
|
||||
@ -53,7 +53,7 @@ public class BossNewCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_New_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -61,17 +61,17 @@ public class BossNewCmd extends SubCommand {
|
||||
//--------------------
|
||||
// A U T O S P A W N
|
||||
//--------------------
|
||||
if(args.length == 3 && args[1].equalsIgnoreCase("autospawn")) {
|
||||
if (args.length == 3 && args[1].equalsIgnoreCase("autospawn")) {
|
||||
String nameInput = args[2];
|
||||
|
||||
if(this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) {
|
||||
if (this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) {
|
||||
Message.Boss_New_AlreadyExists.msg(sender, "AutoSpawn");
|
||||
return;
|
||||
}
|
||||
|
||||
AutoSpawn autoSpawn = BossAPI.createBaseAutoSpawn(nameInput);
|
||||
|
||||
if(autoSpawn == null) {
|
||||
if (autoSpawn == null) {
|
||||
Message.Boss_New_SomethingWentWrong.msg(sender, "AutoSpawn");
|
||||
} else {
|
||||
Message.Boss_New_AutoSpawn.msg(sender, nameInput);
|
||||
@ -84,10 +84,10 @@ public class BossNewCmd extends SubCommand {
|
||||
//-------------------
|
||||
// C O M M A N D
|
||||
//-------------------
|
||||
if(args.length >= 4 && args[1].equalsIgnoreCase("command")) {
|
||||
if (args.length >= 4 && args[1].equalsIgnoreCase("command")) {
|
||||
String nameInput = args[2];
|
||||
|
||||
if(this.commandsFileManager.getCommands(nameInput) != null) {
|
||||
if (this.commandsFileManager.getCommands(nameInput) != null) {
|
||||
Message.Boss_New_AlreadyExists.msg(sender, "Command");
|
||||
return;
|
||||
}
|
||||
@ -104,10 +104,10 @@ public class BossNewCmd extends SubCommand {
|
||||
//-------------------
|
||||
// M E S S A G E
|
||||
//-------------------
|
||||
if(args.length >= 4 && args[1].equalsIgnoreCase("message")) {
|
||||
if (args.length >= 4 && args[1].equalsIgnoreCase("message")) {
|
||||
String nameInput = args[2];
|
||||
|
||||
if(this.commandsFileManager.getCommands(nameInput) != null) {
|
||||
if (this.commandsFileManager.getCommands(nameInput) != null) {
|
||||
Message.Boss_New_AlreadyExists.msg(sender, "Message");
|
||||
return;
|
||||
}
|
||||
@ -124,31 +124,31 @@ public class BossNewCmd extends SubCommand {
|
||||
//----------------------
|
||||
// D R O P T A B L E
|
||||
//----------------------
|
||||
if(args.length == 4 && args[1].equalsIgnoreCase("droptable")) {
|
||||
if (args.length == 4 && args[1].equalsIgnoreCase("droptable")) {
|
||||
String nameInput = args[2];
|
||||
String typeInput = args[3];
|
||||
boolean validType = false;
|
||||
|
||||
if(this.dropTableFileManager.getDropTable(nameInput) != null) {
|
||||
if (this.dropTableFileManager.getDropTable(nameInput) != null) {
|
||||
Message.Boss_New_AlreadyExists.msg(sender, "DropTable");
|
||||
return;
|
||||
}
|
||||
|
||||
for(String s : this.bossDropTableManager.getValidDropTableTypes()) {
|
||||
if(s.equalsIgnoreCase(typeInput)) {
|
||||
for (String s : this.bossDropTableManager.getValidDropTableTypes()) {
|
||||
if (s.equalsIgnoreCase(typeInput)) {
|
||||
validType = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!validType) {
|
||||
if (!validType) {
|
||||
Message.Boss_New_InvalidDropTableType.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
DropTable dropTable = BossAPI.createBaseDropTable(nameInput, typeInput);
|
||||
|
||||
if(dropTable == null) {
|
||||
if (dropTable == null) {
|
||||
Message.Boss_New_SomethingWentWrong.msg(sender, "DropTable");
|
||||
} else {
|
||||
Message.Boss_New_DropTable.msg(sender, nameInput, typeInput);
|
||||
@ -160,45 +160,45 @@ public class BossNewCmd extends SubCommand {
|
||||
//-------------------
|
||||
// S K I L L
|
||||
//-------------------
|
||||
if(args.length == 5 && args[1].equalsIgnoreCase("skill")) {
|
||||
if (args.length == 5 && args[1].equalsIgnoreCase("skill")) {
|
||||
String nameInput = args[2];
|
||||
String typeInput = args[3];
|
||||
String modeInput = args[4];
|
||||
boolean validType = false, validMode = false;
|
||||
List<SkillMode> skillModes = SkillMode.getSkillModes();
|
||||
|
||||
if(this.skillsFileManager.getSkill(nameInput) != null) {
|
||||
if (this.skillsFileManager.getSkill(nameInput) != null) {
|
||||
Message.Boss_New_AlreadyExists.msg(sender, "Skill");
|
||||
return;
|
||||
}
|
||||
|
||||
for(String s : this.bossSkillManager.getValidSkillTypes()) {
|
||||
if(s.equalsIgnoreCase(typeInput)) {
|
||||
for (String s : this.bossSkillManager.getValidSkillTypes()) {
|
||||
if (s.equalsIgnoreCase(typeInput)) {
|
||||
validType = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(SkillMode skillMode : skillModes) {
|
||||
if(skillMode.name().equalsIgnoreCase(modeInput)) {
|
||||
for (SkillMode skillMode : skillModes) {
|
||||
if (skillMode.name().equalsIgnoreCase(modeInput)) {
|
||||
validMode = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!validType) {
|
||||
if (!validType) {
|
||||
Message.Boss_New_InvalidSkillType.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!validMode) {
|
||||
if (!validMode) {
|
||||
Message.Boss_New_InvalidSkillMode.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
Skill skill = BossAPI.createBaseSkill(nameInput, typeInput, modeInput);
|
||||
|
||||
if(skill == null) {
|
||||
if (skill == null) {
|
||||
Message.Boss_New_SomethingWentWrong.msg(sender, "Skill");
|
||||
} else {
|
||||
Message.Boss_New_Skill.msg(sender, nameInput, typeInput);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.songoda.epicbosses.commands.boss;
|
||||
|
||||
import com.songoda.epicbosses.EpicBosses;
|
||||
import com.songoda.epicbosses.managers.BossEntityManager;
|
||||
import com.songoda.epicbosses.utils.IReloadable;
|
||||
import com.songoda.epicbosses.utils.Message;
|
||||
@ -28,7 +27,7 @@ public class BossReloadCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.reload.hasPermission(sender)) {
|
||||
if (!Permission.reload.hasPermission(sender)) {
|
||||
Message.Boss_Reload_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -24,17 +24,17 @@ public class BossShopCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.shop.hasPermission(sender)) {
|
||||
if (!Permission.shop.hasPermission(sender)) {
|
||||
Message.Boss_Shop_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this.plugin.getConfig().getBoolean("Toggles.bossShop", true)) {
|
||||
if (!this.plugin.getConfig().getBoolean("Toggles.bossShop", true)) {
|
||||
Message.Boss_Shop_Disabled.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ public class BossSkillsCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_Skills_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.General_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -28,29 +28,29 @@ public class BossSpawnCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.admin.hasPermission(sender)) {
|
||||
if (!Permission.admin.hasPermission(sender)) {
|
||||
Message.Boss_Spawn_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 2) {
|
||||
if (args.length < 2) {
|
||||
Message.Boss_Spawn_InvalidArgs.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
Location spawnLocation;
|
||||
|
||||
if(args.length == 3) {
|
||||
if (args.length == 3) {
|
||||
Location input = StringUtils.get().fromStringToLocation(args[2]);
|
||||
|
||||
if(input == null) {
|
||||
if (input == null) {
|
||||
Message.Boss_Spawn_InvalidLocation.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
spawnLocation = input;
|
||||
} else {
|
||||
if(!(sender instanceof Player)) {
|
||||
if (!(sender instanceof Player)) {
|
||||
Message.Boss_Spawn_MustBePlayer.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -61,7 +61,7 @@ public class BossSpawnCmd extends SubCommand {
|
||||
String bossInput = args[1];
|
||||
BossEntity bossEntity = this.bossesFileManager.getBossEntity(bossInput);
|
||||
|
||||
if(bossEntity == null) {
|
||||
if (bossEntity == null) {
|
||||
Message.Boss_Spawn_InvalidBoss.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -31,12 +31,12 @@ public class BossTimeCmd extends SubCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!Permission.time.hasPermission(sender)) {
|
||||
if (!Permission.time.hasPermission(sender)) {
|
||||
Message.Boss_Time_NoPermission.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length != 2) {
|
||||
if (args.length != 2) {
|
||||
Message.Boss_Time_InvalidArgs.msg(sender);
|
||||
return;
|
||||
}
|
||||
@ -45,7 +45,7 @@ public class BossTimeCmd extends SubCommand {
|
||||
boolean exists = this.autoSpawnManager.exists(section);
|
||||
List<String> currentActive = this.autoSpawnManager.getIntervalAutoSpawns();
|
||||
|
||||
if(!exists) {
|
||||
if (!exists) {
|
||||
Message.Boss_Time_DoesntExist.msg(sender, StringUtils.get().appendList(currentActive));
|
||||
return;
|
||||
}
|
||||
@ -54,7 +54,7 @@ public class BossTimeCmd extends SubCommand {
|
||||
ActiveIntervalAutoSpawnHolder activeIntervalAutoSpawnHolder = (ActiveIntervalAutoSpawnHolder) activeAutoSpawnHolder;
|
||||
long remainingMs = activeIntervalAutoSpawnHolder.getRemainingMs();
|
||||
|
||||
if(remainingMs == 0 && activeIntervalAutoSpawnHolder.isSpawnAfterLastBossIsKilled()) {
|
||||
if (remainingMs == 0 && activeIntervalAutoSpawnHolder.isSpawnAfterLastBossIsKilled()) {
|
||||
Message.Boss_Time_CurrentlyActive.msg(sender);
|
||||
return;
|
||||
}
|
||||
|
@ -13,13 +13,6 @@ import java.util.List;
|
||||
*/
|
||||
public class BossEntity {
|
||||
|
||||
@Expose
|
||||
private String spawnItem, targeting;
|
||||
@Expose
|
||||
private boolean editing, buyable;
|
||||
@Expose
|
||||
private Double price;
|
||||
|
||||
@Expose
|
||||
private final List<EntityStatsElement> entityStats;
|
||||
@Expose
|
||||
@ -30,6 +23,12 @@ public class BossEntity {
|
||||
private final SkillsElement skills;
|
||||
@Expose
|
||||
private final DropsElement drops;
|
||||
@Expose
|
||||
private String spawnItem, targeting;
|
||||
@Expose
|
||||
private boolean editing, buyable;
|
||||
@Expose
|
||||
private Double price;
|
||||
|
||||
public BossEntity(boolean editing, String spawnItem, String targeting, boolean buyable, Double price, List<EntityStatsElement> entityStats, SkillsElement skills, DropsElement drops, MessagesElement messages, CommandsElement commands) {
|
||||
this.editing = editing;
|
||||
@ -45,11 +44,11 @@ public class BossEntity {
|
||||
}
|
||||
|
||||
public String getEditingValue() {
|
||||
return this.editing? "Enabled" : "Disabled";
|
||||
return this.editing ? "Enabled" : "Disabled";
|
||||
}
|
||||
|
||||
public String getTargetingValue() {
|
||||
if(getTargeting() == null || getTargeting().isEmpty() || getTargeting().equalsIgnoreCase("")) {
|
||||
if (getTargeting() == null || getTargeting().isEmpty() || getTargeting().equalsIgnoreCase("")) {
|
||||
return "N/A";
|
||||
} else {
|
||||
return getTargeting();
|
||||
@ -59,24 +58,24 @@ public class BossEntity {
|
||||
public List<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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -85,15 +84,15 @@ public class BossEntity {
|
||||
}
|
||||
|
||||
public boolean isCompleteEnoughToSpawn() {
|
||||
if(this.entityStats == null) return false;
|
||||
if (this.entityStats == null) return false;
|
||||
|
||||
EntityStatsElement entityStatsElement = this.entityStats.get(0);
|
||||
|
||||
if(entityStatsElement == null) return false;
|
||||
if (entityStatsElement == null) return false;
|
||||
|
||||
MainStatsElement mainStatsElement = entityStatsElement.getMainStats();
|
||||
|
||||
if(mainStatsElement == null) return false;
|
||||
if (mainStatsElement == null) return false;
|
||||
|
||||
Integer position = mainStatsElement.getPosition();
|
||||
String entityType = mainStatsElement.getEntityType();
|
||||
@ -110,22 +109,42 @@ public class BossEntity {
|
||||
return this.spawnItem;
|
||||
}
|
||||
|
||||
public void setSpawnItem(String spawnItem) {
|
||||
this.spawnItem = spawnItem;
|
||||
}
|
||||
|
||||
public String getTargeting() {
|
||||
return this.targeting;
|
||||
}
|
||||
|
||||
public void setTargeting(String targeting) {
|
||||
this.targeting = targeting;
|
||||
}
|
||||
|
||||
public boolean isEditing() {
|
||||
return this.editing;
|
||||
}
|
||||
|
||||
public void setEditing(boolean editing) {
|
||||
this.editing = editing;
|
||||
}
|
||||
|
||||
public boolean isBuyable() {
|
||||
return this.buyable;
|
||||
}
|
||||
|
||||
public void setBuyable(boolean buyable) {
|
||||
this.buyable = buyable;
|
||||
}
|
||||
|
||||
public Double getPrice() {
|
||||
return this.price;
|
||||
}
|
||||
|
||||
public void setPrice(Double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public List<EntityStatsElement> getEntityStats() {
|
||||
return this.entityStats;
|
||||
}
|
||||
@ -145,24 +164,4 @@ public class BossEntity {
|
||||
public DropsElement getDrops() {
|
||||
return this.drops;
|
||||
}
|
||||
|
||||
public void setSpawnItem(String spawnItem) {
|
||||
this.spawnItem = spawnItem;
|
||||
}
|
||||
|
||||
public void setTargeting(String targeting) {
|
||||
this.targeting = targeting;
|
||||
}
|
||||
|
||||
public void setEditing(boolean editing) {
|
||||
this.editing = editing;
|
||||
}
|
||||
|
||||
public void setBuyable(boolean buyable) {
|
||||
this.buyable = buyable;
|
||||
}
|
||||
|
||||
public void setPrice(Double price) {
|
||||
this.price = price;
|
||||
}
|
||||
}
|
||||
|
@ -33,14 +33,14 @@ public class MinionEntity {
|
||||
return this.targeting;
|
||||
}
|
||||
|
||||
public boolean isEditing() {
|
||||
return this.editing;
|
||||
}
|
||||
|
||||
public void setTargeting(String targeting) {
|
||||
this.targeting = targeting;
|
||||
}
|
||||
|
||||
public boolean isEditing() {
|
||||
return this.editing;
|
||||
}
|
||||
|
||||
public void setEditing(boolean editing) {
|
||||
this.editing = editing;
|
||||
}
|
||||
|
@ -21,14 +21,14 @@ public class CommandsElement {
|
||||
return this.onSpawn;
|
||||
}
|
||||
|
||||
public String getOnDeath() {
|
||||
return this.onDeath;
|
||||
}
|
||||
|
||||
public void setOnSpawn(String onSpawn) {
|
||||
this.onSpawn = onSpawn;
|
||||
}
|
||||
|
||||
public String getOnDeath() {
|
||||
return this.onDeath;
|
||||
}
|
||||
|
||||
public void setOnDeath(String onDeath) {
|
||||
this.onDeath = onDeath;
|
||||
}
|
||||
|
@ -24,22 +24,22 @@ public class DropsElement {
|
||||
return this.naturalDrops;
|
||||
}
|
||||
|
||||
public Boolean getDropExp() {
|
||||
return this.dropExp;
|
||||
}
|
||||
|
||||
public String getDropTable() {
|
||||
return this.dropTable;
|
||||
}
|
||||
|
||||
public void setNaturalDrops(Boolean naturalDrops) {
|
||||
this.naturalDrops = naturalDrops;
|
||||
}
|
||||
|
||||
public Boolean getDropExp() {
|
||||
return this.dropExp;
|
||||
}
|
||||
|
||||
public void setDropExp(Boolean dropExp) {
|
||||
this.dropExp = dropExp;
|
||||
}
|
||||
|
||||
public String getDropTable() {
|
||||
return this.dropTable;
|
||||
}
|
||||
|
||||
public void setDropTable(String dropTable) {
|
||||
this.dropTable = dropTable;
|
||||
}
|
||||
|
@ -32,30 +32,30 @@ public class EntityStatsElement {
|
||||
return this.mainStats;
|
||||
}
|
||||
|
||||
public EquipmentElement getEquipment() {
|
||||
return this.equipment;
|
||||
}
|
||||
|
||||
public HandsElement getHands() {
|
||||
return this.hands;
|
||||
}
|
||||
|
||||
public List<PotionEffectHolder> getPotions() {
|
||||
return this.potions;
|
||||
}
|
||||
|
||||
public void setMainStats(MainStatsElement mainStats) {
|
||||
this.mainStats = mainStats;
|
||||
}
|
||||
|
||||
public EquipmentElement getEquipment() {
|
||||
return this.equipment;
|
||||
}
|
||||
|
||||
public void setEquipment(EquipmentElement equipment) {
|
||||
this.equipment = equipment;
|
||||
}
|
||||
|
||||
public HandsElement getHands() {
|
||||
return this.hands;
|
||||
}
|
||||
|
||||
public void setHands(HandsElement hands) {
|
||||
this.hands = hands;
|
||||
}
|
||||
|
||||
public List<PotionEffectHolder> getPotions() {
|
||||
return this.potions;
|
||||
}
|
||||
|
||||
public void setPotions(List<PotionEffectHolder> potions) {
|
||||
this.potions = potions;
|
||||
}
|
||||
|
@ -23,30 +23,30 @@ public class EquipmentElement {
|
||||
return this.helmet;
|
||||
}
|
||||
|
||||
public String getChestplate() {
|
||||
return this.chestplate;
|
||||
}
|
||||
|
||||
public String getLeggings() {
|
||||
return this.leggings;
|
||||
}
|
||||
|
||||
public String getBoots() {
|
||||
return this.boots;
|
||||
}
|
||||
|
||||
public void setHelmet(String helmet) {
|
||||
this.helmet = helmet;
|
||||
}
|
||||
|
||||
public String getChestplate() {
|
||||
return this.chestplate;
|
||||
}
|
||||
|
||||
public void setChestplate(String chestplate) {
|
||||
this.chestplate = chestplate;
|
||||
}
|
||||
|
||||
public String getLeggings() {
|
||||
return this.leggings;
|
||||
}
|
||||
|
||||
public void setLeggings(String leggings) {
|
||||
this.leggings = leggings;
|
||||
}
|
||||
|
||||
public String getBoots() {
|
||||
return this.boots;
|
||||
}
|
||||
|
||||
public void setBoots(String boots) {
|
||||
this.boots = boots;
|
||||
}
|
||||
|
@ -21,14 +21,14 @@ public class HandsElement {
|
||||
return this.mainHand;
|
||||
}
|
||||
|
||||
public String getOffHand() {
|
||||
return this.offHand;
|
||||
}
|
||||
|
||||
public void setMainHand(String mainHand) {
|
||||
this.mainHand = mainHand;
|
||||
}
|
||||
|
||||
public String getOffHand() {
|
||||
return this.offHand;
|
||||
}
|
||||
|
||||
public void setOffHand(String offHand) {
|
||||
this.offHand = offHand;
|
||||
}
|
||||
|
@ -29,30 +29,30 @@ public class MainStatsElement {
|
||||
return this.position;
|
||||
}
|
||||
|
||||
public String getEntityType() {
|
||||
return this.entityType;
|
||||
}
|
||||
|
||||
public Double getHealth() {
|
||||
return this.health;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public void setPosition(Integer position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getEntityType() {
|
||||
return this.entityType;
|
||||
}
|
||||
|
||||
public void setEntityType(String entityType) {
|
||||
this.entityType = entityType;
|
||||
}
|
||||
|
||||
public Double getHealth() {
|
||||
return this.health;
|
||||
}
|
||||
|
||||
public void setHealth(Double health) {
|
||||
this.health = health;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
@ -26,22 +26,22 @@ public class MessagesElement {
|
||||
return this.onSpawn;
|
||||
}
|
||||
|
||||
public OnDeathMessageElement getOnDeath() {
|
||||
return this.onDeath;
|
||||
}
|
||||
|
||||
public TauntElement getTaunts() {
|
||||
return this.taunts;
|
||||
}
|
||||
|
||||
public void setOnSpawn(OnSpawnMessageElement onSpawn) {
|
||||
this.onSpawn = onSpawn;
|
||||
}
|
||||
|
||||
public OnDeathMessageElement getOnDeath() {
|
||||
return this.onDeath;
|
||||
}
|
||||
|
||||
public void setOnDeath(OnDeathMessageElement onDeath) {
|
||||
this.onDeath = onDeath;
|
||||
}
|
||||
|
||||
public TauntElement getTaunts() {
|
||||
return this.taunts;
|
||||
}
|
||||
|
||||
public void setTaunts(TauntElement taunts) {
|
||||
this.taunts = taunts;
|
||||
}
|
||||
|
@ -25,30 +25,30 @@ public class OnDeathMessageElement {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public String getPositionMessage() {
|
||||
return this.positionMessage;
|
||||
}
|
||||
|
||||
public Integer getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
public Integer getOnlyShow() {
|
||||
return this.onlyShow;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getPositionMessage() {
|
||||
return this.positionMessage;
|
||||
}
|
||||
|
||||
public void setPositionMessage(String positionMessage) {
|
||||
this.positionMessage = positionMessage;
|
||||
}
|
||||
|
||||
public Integer getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
public void setRadius(Integer radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public Integer getOnlyShow() {
|
||||
return this.onlyShow;
|
||||
}
|
||||
|
||||
public void setOnlyShow(Integer onlyShow) {
|
||||
this.onlyShow = onlyShow;
|
||||
}
|
||||
|
@ -23,14 +23,14 @@ public class OnSpawnMessageElement {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public Integer getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
public void setRadius(Integer radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
@ -28,22 +28,22 @@ public class SkillsElement {
|
||||
return this.overallChance;
|
||||
}
|
||||
|
||||
public String getMasterMessage() {
|
||||
return this.masterMessage;
|
||||
}
|
||||
|
||||
public List<String> getSkills() {
|
||||
return this.skills;
|
||||
}
|
||||
|
||||
public void setOverallChance(Double overallChance) {
|
||||
this.overallChance = overallChance;
|
||||
}
|
||||
|
||||
public String getMasterMessage() {
|
||||
return this.masterMessage;
|
||||
}
|
||||
|
||||
public void setMasterMessage(String masterMessage) {
|
||||
this.masterMessage = masterMessage;
|
||||
}
|
||||
|
||||
public List<String> getSkills() {
|
||||
return this.skills;
|
||||
}
|
||||
|
||||
public void setSkills(List<String> skills) {
|
||||
this.skills = skills;
|
||||
}
|
||||
|
@ -26,22 +26,22 @@ public class TauntElement {
|
||||
return this.delay;
|
||||
}
|
||||
|
||||
public Integer getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
public List<String> getTaunts() {
|
||||
return this.taunts;
|
||||
}
|
||||
|
||||
public void setDelay(Integer delay) {
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
public Integer getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
public void setRadius(Integer radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public List<String> getTaunts() {
|
||||
return this.taunts;
|
||||
}
|
||||
|
||||
public void setTaunts(List<String> taunts) {
|
||||
this.taunts = taunts;
|
||||
}
|
||||
|
@ -27,12 +27,12 @@ public class BossDamageEvent extends Event {
|
||||
this.damage = damageAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -21,12 +21,12 @@ public class BossDeathEvent extends Event {
|
||||
this.autoSpawn = autoSpawn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -25,12 +25,12 @@ public class BossSkillEvent extends Event {
|
||||
this.skill = skill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -21,12 +21,12 @@ public class BossSpawnEvent extends Event {
|
||||
this.autoSpawn = autoSpawn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -25,12 +25,12 @@ public class PreBossDeathEvent extends Event {
|
||||
this.killer = killer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -23,12 +23,12 @@ public class PreBossSkillEvent extends Event {
|
||||
this.damagingEntity = damagingEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -19,12 +19,12 @@ public class PreBossSpawnEvent extends Event {
|
||||
this.activeBossHolder = activeBossHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -24,12 +24,12 @@ public class PreBossSpawnItemEvent extends PreBossSpawnEvent {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -44,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);
|
||||
@ -63,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();
|
||||
|
@ -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();
|
||||
|
@ -44,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);
|
||||
@ -63,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();
|
||||
|
@ -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();
|
||||
|
@ -54,18 +54,18 @@ public class BossShopPriceHandler implements IHandler {
|
||||
Player player = event.getPlayer();
|
||||
UUID uuid = player.getUniqueId();
|
||||
|
||||
if(!uuid.equals(getPlayer().getUniqueId())) return;
|
||||
if(isHandled()) return;
|
||||
if (!uuid.equals(getPlayer().getUniqueId())) return;
|
||||
if (isHandled()) return;
|
||||
|
||||
String input = event.getMessage();
|
||||
|
||||
if(input.equalsIgnoreCase("-")) {
|
||||
if (input.equalsIgnoreCase("-")) {
|
||||
input = null;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
if(NumberUtils.get().isDouble(input)) {
|
||||
if (NumberUtils.get().isDouble(input)) {
|
||||
double amount = NumberUtils.get().getDouble(input);
|
||||
getBossEntity().setPrice(amount);
|
||||
getBossesFileManager().save();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -134,22 +134,22 @@ public class ActiveBossHolder implements IActiveHolder {
|
||||
return this.targetHandler;
|
||||
}
|
||||
|
||||
public boolean isDead() {
|
||||
return this.isDead;
|
||||
}
|
||||
|
||||
public boolean isCustomSpawnMessage() {
|
||||
return this.customSpawnMessage;
|
||||
}
|
||||
|
||||
public void setTargetHandler(TargetHandler<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;
|
||||
}
|
||||
|
@ -17,13 +17,12 @@ import java.util.UUID;
|
||||
*/
|
||||
public class ActiveMinionHolder implements IActiveHolder {
|
||||
|
||||
private TargetHandler<ActiveMinionHolder> targetHandler = null;
|
||||
|
||||
private Map<Integer, UUID> livingEntityMap = new HashMap<>();
|
||||
private ActiveBossHolder activeBossHolder;
|
||||
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;
|
||||
@ -39,7 +38,7 @@ public class ActiveMinionHolder implements IActiveHolder {
|
||||
|
||||
@Override
|
||||
public void setLivingEntity(int position, LivingEntity livingEntity) {
|
||||
if(this.livingEntityMap.containsKey(position)) {
|
||||
if (this.livingEntityMap.containsKey(position)) {
|
||||
LivingEntity target = (LivingEntity) ServerUtils.get().getEntity(this.livingEntityMap.get(position));
|
||||
if (target != null)
|
||||
target.remove();
|
||||
@ -69,11 +68,11 @@ public class ActiveMinionHolder implements IActiveHolder {
|
||||
|
||||
@Override
|
||||
public boolean isDead() {
|
||||
if(this.livingEntityMap.isEmpty()) return true;
|
||||
if (this.livingEntityMap.isEmpty()) return true;
|
||||
|
||||
for(UUID uuid : this.livingEntityMap.values()) {
|
||||
for (UUID uuid : this.livingEntityMap.values()) {
|
||||
LivingEntity livingEntity = (LivingEntity) ServerUtils.get().getEntity(uuid);
|
||||
if(livingEntity == null || livingEntity.isDead()) return true;
|
||||
if (livingEntity == null || livingEntity.isDead()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -88,6 +87,10 @@ public class ActiveMinionHolder implements IActiveHolder {
|
||||
return this.targetHandler;
|
||||
}
|
||||
|
||||
public void setTargetHandler(TargetHandler<ActiveMinionHolder> targetHandler) {
|
||||
this.targetHandler = targetHandler;
|
||||
}
|
||||
|
||||
public Map<Integer, UUID> getLivingEntityMap() {
|
||||
return this.livingEntityMap;
|
||||
}
|
||||
@ -107,8 +110,4 @@ public class ActiveMinionHolder implements IActiveHolder {
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setTargetHandler(TargetHandler<ActiveMinionHolder> targetHandler) {
|
||||
this.targetHandler = targetHandler;
|
||||
}
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
|
||||
@Override
|
||||
public boolean canSpawn() {
|
||||
if(getAutoSpawn().isEditing()) {
|
||||
if (getAutoSpawn().isEditing()) {
|
||||
ServerUtils.get().logDebug("AutoSpawn failed to spawn due to editing enabled.");
|
||||
return false;
|
||||
}
|
||||
if(!getAutoSpawn().getType().equalsIgnoreCase("INTERVAL")) {
|
||||
if (!getAutoSpawn().getType().equalsIgnoreCase("INTERVAL")) {
|
||||
ServerUtils.get().logDebug("AutoSpawn failed to spawn due to interval type not set.");
|
||||
return false;
|
||||
}
|
||||
@ -50,22 +50,22 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
Location location = this.intervalSpawnElement.getSpawnLocation();
|
||||
boolean spawnIfChunkNotLoaded = ObjectUtils.getValue(getAutoSpawn().getAutoSpawnSettings().getSpawnWhenChunkIsntLoaded(), false);
|
||||
|
||||
if(location == null) {
|
||||
if (location == null) {
|
||||
ServerUtils.get().logDebug("AutoSpawn failed to spawn due to location is null.");
|
||||
return false;
|
||||
}
|
||||
if(!spawnIfChunkNotLoaded && !location.getChunk().isLoaded()) {
|
||||
if (!spawnIfChunkNotLoaded && !location.getChunk().isLoaded()) {
|
||||
ServerUtils.get().logDebug("AutoSpawn failed to spawn due to spawnIfChunkNotLoaded was false and chunk wasn't loaded.");
|
||||
return false;
|
||||
}
|
||||
if(isSpawnAfterLastBossIsKilled() && !getActiveBossHolders().isEmpty()) {
|
||||
if (isSpawnAfterLastBossIsKilled() && !getActiveBossHolders().isEmpty()) {
|
||||
ServerUtils.get().logDebug("AutoSpawn failed due to spawnAfterLastBossKilled is true and activeBossHolders is not empty.");
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean returnStatement = currentActiveAmount < maxAmount;
|
||||
|
||||
if(!returnStatement) {
|
||||
if (!returnStatement) {
|
||||
ServerUtils.get().logDebug("AutoSpawn failed to spawn due to currentActiveAmount is greater then maxAmount of bosses.");
|
||||
}
|
||||
|
||||
@ -79,11 +79,11 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
public void restartInterval() {
|
||||
stopInterval();
|
||||
|
||||
if(getAutoSpawn().isEditing()) return;
|
||||
if (getAutoSpawn().isEditing()) return;
|
||||
|
||||
Integer delay = this.intervalSpawnElement.getSpawnRate();
|
||||
|
||||
if(delay == null) {
|
||||
if (delay == null) {
|
||||
Debug.AUTOSPAWN_INTERVALNOTREAL.debug("null", BossAPI.getAutoSpawnName(getAutoSpawn()));
|
||||
return;
|
||||
}
|
||||
@ -96,7 +96,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
this.intervalTask = ServerUtils.get().runTimer(delayTick, delayTick, () -> {
|
||||
boolean canSpawn = canSpawn();
|
||||
|
||||
if(!canSpawn) {
|
||||
if (!canSpawn) {
|
||||
ServerUtils.get().logDebug("--- Failed to AutoSpawn. ---");
|
||||
updateNextCompleteTime();
|
||||
return;
|
||||
@ -104,7 +104,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
|
||||
ServerUtils.get().logDebug("AutoSpawn Spawn Attempt: " + this.intervalSpawnElement.attemptSpawn(this));
|
||||
|
||||
if(isSpawnAfterLastBossIsKilled()) {
|
||||
if (isSpawnAfterLastBossIsKilled()) {
|
||||
cancelCurrentInterval();
|
||||
return;
|
||||
}
|
||||
@ -129,7 +129,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
public long getRemainingMs() {
|
||||
long currentMs = System.currentTimeMillis();
|
||||
|
||||
if(currentMs > this.nextCompletedTime) return 0;
|
||||
if (currentMs > this.nextCompletedTime) return 0;
|
||||
|
||||
return this.nextCompletedTime - currentMs;
|
||||
}
|
||||
@ -139,10 +139,10 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
boolean spawnAfterLastBossIsKilled = ObjectUtils.getValue(this.intervalSpawnElement.getSpawnAfterLastBossIsKilled(), false);
|
||||
ActiveBossHolder activeBossHolder = event.getActiveBossHolder();
|
||||
|
||||
if(getActiveBossHolders().contains(activeBossHolder)) {
|
||||
if (getActiveBossHolders().contains(activeBossHolder)) {
|
||||
getActiveBossHolders().remove(activeBossHolder);
|
||||
|
||||
if(spawnAfterLastBossIsKilled) {
|
||||
if (spawnAfterLastBossIsKilled) {
|
||||
restartInterval();
|
||||
updateNextCompleteTime();
|
||||
}
|
||||
@ -151,7 +151,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
}
|
||||
|
||||
private void cancelCurrentInterval() {
|
||||
if(this.intervalTask != null) ServerUtils.get().cancelTask(this.intervalTask);
|
||||
if (this.intervalTask != null) ServerUtils.get().cancelTask(this.intervalTask);
|
||||
|
||||
this.nextCompletedTime = 0;
|
||||
}
|
||||
@ -159,7 +159,7 @@ public class ActiveIntervalAutoSpawnHolder extends ActiveAutoSpawnHolder {
|
||||
private void updateNextCompleteTime() {
|
||||
Integer delay = this.intervalSpawnElement.getSpawnRate();
|
||||
|
||||
if(delay == null) {
|
||||
if (delay == null) {
|
||||
Debug.AUTOSPAWN_INTERVALNOTREAL.debug("null", BossAPI.getAutoSpawnName(getAutoSpawn()));
|
||||
return;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class AutoSpawnsPanel extends MainListPanelHandler {
|
||||
int maxPage = panel.getMaxPage(entryList);
|
||||
|
||||
panel.setOnPageChange(((player, currentPage, requestedPage) -> {
|
||||
if(requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
if (requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
|
||||
loadPage(panel, requestedPage, autoSpawnMap, entryList);
|
||||
return true;
|
||||
@ -58,31 +58,32 @@ public class AutoSpawnsPanel extends MainListPanelHandler {
|
||||
|
||||
private void loadPage(Panel panel, int requestedPage, Map<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 = 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);
|
||||
|
@ -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.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;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class CustomItemsPanel extends MainListPanelHandler {
|
||||
int maxPage = panel.getMaxPage(entryList);
|
||||
|
||||
panel.setOnPageChange(((player, currentPage, requestedPage) -> {
|
||||
if(requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
if (requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
|
||||
loadPage(panel, requestedPage, currentItemStacks, entryList);
|
||||
return true;
|
||||
@ -52,8 +52,9 @@ public class CustomItemsPanel extends MainListPanelHandler {
|
||||
|
||||
private void loadPage(Panel panel, int requestedPage, Map<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);
|
||||
@ -62,12 +63,12 @@ public class CustomItemsPanel extends MainListPanelHandler {
|
||||
panel.setItem(realisticSlot, itemStack.clone(), e -> {
|
||||
ClickType clickType = e.getClick();
|
||||
|
||||
if(clickType == ClickType.RIGHT || clickType == ClickType.SHIFT_RIGHT) {
|
||||
if (clickType == ClickType.RIGHT || clickType == ClickType.SHIFT_RIGHT) {
|
||||
int timesUsed = this.bossPanelManager.isItemStackUsed(name);
|
||||
|
||||
if(timesUsed > 0) {
|
||||
if (timesUsed > 0) {
|
||||
Message.Boss_Items_CannotBeRemoved.msg(e.getWhoClicked(), timesUsed);
|
||||
} else if(name.contains("Default")) {
|
||||
} else if (name.contains("Default")) {
|
||||
Message.Boss_Items_DefaultCannotBeRemoved.msg(e.getWhoClicked(), timesUsed);
|
||||
} else {
|
||||
this.itemsFileManager.removeItemStack(name);
|
||||
@ -77,9 +78,9 @@ public class CustomItemsPanel extends MainListPanelHandler {
|
||||
loadPage(panel, requestedPage, currentItemStacks, entryList);
|
||||
Message.Boss_Items_Removed.msg(e.getWhoClicked());
|
||||
}
|
||||
} else if(clickType == ClickType.LEFT || clickType == ClickType.SHIFT_LEFT) {
|
||||
} else if (clickType == ClickType.LEFT || clickType == ClickType.SHIFT_LEFT) {
|
||||
e.getWhoClicked().getInventory().addItem(itemStack.clone());
|
||||
} else if(clickType == ClickType.MIDDLE) {
|
||||
} else if (clickType == ClickType.MIDDLE) {
|
||||
String newName = UUID.randomUUID().toString();
|
||||
ItemStack newItemStack = itemStack.clone();
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class CustomSkillsPanel extends MainListPanelHandler {
|
||||
int maxPage = panel.getMaxPage(entryList);
|
||||
|
||||
panel.setOnPageChange(((player, currentPage, requestedPage) -> {
|
||||
if(requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
if (requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
|
||||
loadPage(panel, requestedPage, currentSkills, entryList);
|
||||
return true;
|
||||
@ -58,8 +58,9 @@ public class CustomSkillsPanel extends MainListPanelHandler {
|
||||
|
||||
private void loadPage(Panel panel, int requestedPage, Map<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);
|
||||
@ -72,10 +73,10 @@ public class CustomSkillsPanel extends MainListPanelHandler {
|
||||
Double radius = skill.getRadius();
|
||||
String type = skill.getType();
|
||||
|
||||
if(customMessage == null || customMessage.equals("")) customMessage = "N/A";
|
||||
if(radius == null) radius = 100.0;
|
||||
if(displayName == null || displayName.equals("")) displayName = "N/A";
|
||||
if(type == null || type.equals("")) type = "N/A";
|
||||
if (customMessage == null || customMessage.equals("")) customMessage = "N/A";
|
||||
if (radius == null) radius = 100.0;
|
||||
if (displayName == null || displayName.equals("")) displayName = "N/A";
|
||||
if (type == null || type.equals("")) type = "N/A";
|
||||
|
||||
replaceMap.put("{name}", name);
|
||||
replaceMap.put("{type}", type);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -43,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;
|
||||
@ -80,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);
|
||||
@ -90,7 +91,7 @@ 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) {
|
||||
@ -104,14 +105,14 @@ public class EntityTypeEditorPanel extends SubVariablePanelHandler<BossEntity, E
|
||||
}
|
||||
}
|
||||
|
||||
if(!found) {
|
||||
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();
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class ShopPanel extends PanelHandler {
|
||||
int maxPage = panel.getMaxPage(filteredMap);
|
||||
|
||||
panel.setOnPageChange(((player, currentPage, requestedPage) -> {
|
||||
if(requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
if (requestedPage < 0 || requestedPage > maxPage) return false;
|
||||
|
||||
loadPage(panel, requestedPage, entryList, filteredMap);
|
||||
return true;
|
||||
@ -69,15 +69,16 @@ public class ShopPanel extends PanelHandler {
|
||||
|
||||
private void loadPage(Panel panel, int page, List<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);
|
||||
}
|
||||
|
||||
@ -93,13 +94,13 @@ public class ShopPanel extends PanelHandler {
|
||||
ItemStack spawnItem = this.bossEntityManager.getSpawnItem(bossEntity);
|
||||
Player player = (Player) e.getWhoClicked();
|
||||
|
||||
if(spawnItem == null) {
|
||||
if (spawnItem == null) {
|
||||
Debug.FAILED_TO_GIVE_SPAWN_EGG.debug(e.getWhoClicked().getName(), name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(EconomyManager.hasBalance(player, price)) {
|
||||
if (EconomyManager.hasBalance(player, price)) {
|
||||
Message.Boss_Shop_NotEnoughBalance.msg(player, NumberUtils.get().formatDouble(price));
|
||||
return;
|
||||
}
|
||||
@ -116,7 +117,7 @@ public class ShopPanel extends PanelHandler {
|
||||
Map<String, BossEntity> newMap = new HashMap<>();
|
||||
|
||||
originalMap.forEach((s, bossEntity) -> {
|
||||
if(bossEntity.canBeBought()) {
|
||||
if (bossEntity.canBeBought()) {
|
||||
newMap.put(s, bossEntity);
|
||||
}
|
||||
});
|
||||
|
@ -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,7 +96,7 @@ 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.getDisplay().getString("Display.AutoSpawns.CustomSettings.name"), replaceMap);
|
||||
|
||||
@ -103,15 +104,15 @@ public class AutoSpawnCustomSettingsEditorPanel extends VariablePanelHandler<Aut
|
||||
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);
|
||||
|
@ -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 = ObjectUtils.getValue(autoSpawn.getEntities(), new ArrayList<>());
|
||||
|
||||
panel.loadPage(page, (slot, realisticSlot) -> {
|
||||
if(slot >= entryList.size()) {
|
||||
panel.setItem(realisticSlot, new ItemStack(Material.AIR), e->{});
|
||||
if (slot >= entryList.size()) {
|
||||
panel.setItem(realisticSlot, new ItemStack(Material.AIR), e -> {
|
||||
});
|
||||
} else {
|
||||
String name = entryList.get(slot);
|
||||
BossEntity bossEntity = currentEntities.get(name);
|
||||
@ -96,11 +97,11 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler<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)) {
|
||||
if (current.contains(name)) {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.AutoSpawns.Entities.selectedName"), replaceMap);
|
||||
} else {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.AutoSpawns.Entities.name"), replaceMap);
|
||||
@ -109,12 +110,12 @@ public class AutoSpawnEntitiesEditorPanel extends VariablePanelHandler<AutoSpawn
|
||||
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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -46,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();
|
||||
|
||||
@ -80,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;
|
||||
}
|
||||
@ -95,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);
|
||||
|
@ -75,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;
|
||||
}
|
||||
@ -113,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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
@ -131,7 +132,7 @@ public class DropsEditorPanel extends VariablePanelHandler<BossEntity> {
|
||||
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;
|
||||
}
|
||||
|
@ -45,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);
|
||||
|
||||
@ -81,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;
|
||||
}
|
||||
@ -95,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;
|
||||
}
|
||||
|
@ -88,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);
|
||||
}
|
||||
|
||||
|
@ -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,7 +103,7 @@ 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)) {
|
||||
if (bossEntity.getSkills().getSkills().contains(name)) {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Skills.selectedName"), replaceMap);
|
||||
} else {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Skills.name"), replaceMap);
|
||||
@ -111,14 +112,14 @@ public class SkillListEditorPanel extends VariablePanelHandler<BossEntity> {
|
||||
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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,18 +110,19 @@ 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));
|
||||
@ -130,7 +131,7 @@ public class SpawnItemEditorPanel extends VariablePanelHandler<BossEntity> {
|
||||
}
|
||||
|
||||
panel.setItem(realisticSlot, itemStack, e -> {
|
||||
if(!bossEntity.isEditing()) {
|
||||
if (!bossEntity.isEditing()) {
|
||||
Message.Boss_Edit_CannotBeModified.msg(e.getWhoClicked());
|
||||
return;
|
||||
}
|
||||
|
@ -49,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));
|
||||
@ -85,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;
|
||||
}
|
||||
@ -101,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;
|
||||
}
|
||||
@ -109,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;
|
||||
}
|
||||
|
||||
|
@ -58,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;
|
||||
}
|
||||
@ -84,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());
|
||||
}
|
||||
|
||||
|
@ -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,7 +98,7 @@ public class OnDeathCommandEditor extends VariablePanelHandler<BossEntity> {
|
||||
|
||||
replaceMap.put("{name}", name);
|
||||
|
||||
if(bossEntity.getCommands().getOnDeath() != null && bossEntity.getCommands().getOnDeath().equalsIgnoreCase(name)) {
|
||||
if (bossEntity.getCommands().getOnDeath() != null && bossEntity.getCommands().getOnDeath().equalsIgnoreCase(name)) {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap);
|
||||
} else {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap);
|
||||
@ -107,9 +108,9 @@ public class OnDeathCommandEditor extends VariablePanelHandler<BossEntity> {
|
||||
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;
|
||||
}
|
||||
|
@ -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,7 +98,7 @@ public class OnSpawnCommandEditor extends VariablePanelHandler<BossEntity> {
|
||||
|
||||
replaceMap.put("{name}", name);
|
||||
|
||||
if(bossEntity.getCommands().getOnSpawn() != null && bossEntity.getCommands().getOnSpawn().equalsIgnoreCase(name)) {
|
||||
if (bossEntity.getCommands().getOnSpawn() != null && bossEntity.getCommands().getOnSpawn().equalsIgnoreCase(name)) {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.selectedName"), replaceMap);
|
||||
} else {
|
||||
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Boss.Commands.name"), replaceMap);
|
||||
@ -107,9 +108,9 @@ public class OnSpawnCommandEditor extends VariablePanelHandler<BossEntity> {
|
||||
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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -63,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);
|
||||
|
@ -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);
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user