diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 35a5a5e..46028eb 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -2,29 +2,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -34,12 +21,14 @@
-
+
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_massivecraft_FactionsOne_1_2_1.xml b/.idea/libraries/Maven__com_massivecraft_FactionsOne_1_2_1.xml
new file mode 100644
index 0000000..9f0eee9
--- /dev/null
+++ b/.idea/libraries/Maven__com_massivecraft_FactionsOne_1_2_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_massivecraft_factions_FactionsUUID_1_6_9_5_U0_1_21.xml b/.idea/libraries/Maven__com_massivecraft_factions_FactionsUUID_1_6_9_5_U0_1_21.xml
new file mode 100644
index 0000000..a1a7e36
--- /dev/null
+++ b/.idea/libraries/Maven__com_massivecraft_factions_FactionsUUID_1_6_9_5_U0_1_21.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_massivecraft_factions_Factions_2_9_1_SNAPSHOT.xml b/.idea/libraries/Maven__com_massivecraft_factions_Factions_2_9_1_SNAPSHOT.xml
new file mode 100644
index 0000000..c2dae64
--- /dev/null
+++ b/.idea/libraries/Maven__com_massivecraft_factions_Factions_2_9_1_SNAPSHOT.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_massivecraft_massivecore_MassiveCore_2_9_1_SNAPSHOT.xml b/.idea/libraries/Maven__com_massivecraft_massivecore_MassiveCore_2_9_1_SNAPSHOT.xml
new file mode 100644
index 0000000..78218b6
--- /dev/null
+++ b/.idea/libraries/Maven__com_massivecraft_massivecore_MassiveCore_2_9_1_SNAPSHOT.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__net_redstoneore_legacyfactions_LegacyFactions_1_4_7.xml b/.idea/libraries/Maven__net_redstoneore_legacyfactions_LegacyFactions_1_4_7.xml
new file mode 100644
index 0000000..b5382fb
--- /dev/null
+++ b/.idea/libraries/Maven__net_redstoneore_legacyfactions_LegacyFactions_1_4_7.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_bukkit_bukkit_1_8_6_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_bukkit_bukkit_1_8_6_R0_1_SNAPSHOT.xml
deleted file mode 100644
index af8dae5..0000000
--- a/.idea/libraries/Maven__org_bukkit_bukkit_1_8_6_R0_1_SNAPSHOT.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_bukkit_bukkit_1_9_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_bukkit_bukkit_1_9_R0_1_SNAPSHOT.xml
new file mode 100644
index 0000000..2fb4911
--- /dev/null
+++ b/.idea/libraries/Maven__org_bukkit_bukkit_1_9_R0_1_SNAPSHOT.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_yaml_snakeyaml_1_14.xml b/.idea/libraries/Maven__org_yaml_snakeyaml_1_15.xml
similarity index 69%
rename from .idea/libraries/Maven__org_yaml_snakeyaml_1_14.xml
rename to .idea/libraries/Maven__org_yaml_snakeyaml_1_15.xml
index d9fbe59..02d9152 100644
--- a/.idea/libraries/Maven__org_yaml_snakeyaml_1_14.xml
+++ b/.idea/libraries/Maven__org_yaml_snakeyaml_1_15.xml
@@ -1,13 +1,13 @@
-
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index f7f3aa9..9315cdf 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -3,9 +3,11 @@
+
+
diff --git a/api-modules/FactionsM/FactionsM.iml b/api-modules/FactionsM/FactionsM.iml
index b932985..64e53b7 100644
--- a/api-modules/FactionsM/FactionsM.iml
+++ b/api-modules/FactionsM/FactionsM.iml
@@ -1,13 +1,36 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-modules/FactionsM/pom.xml b/api-modules/FactionsM/pom.xml
index 1d565d5..db2ec1d 100644
--- a/api-modules/FactionsM/pom.xml
+++ b/api-modules/FactionsM/pom.xml
@@ -16,7 +16,7 @@
net.aminecraftdev.custombosses
- PluginAPI
+ FactionHelper3.0.0.0provided
@@ -36,8 +36,8 @@
clean package install
- /target
- ${project.artifactId}-${project.version}
+ target
+ ${project.artifactId}-${plugin.version}${basedir}/src/
@@ -66,5 +66,4 @@
-
\ No newline at end of file
diff --git a/api-modules/FactionsM/src/net/aminecraftdev/custombosses/innerapi/factions/FactionsM.java b/api-modules/FactionsM/src/net/aminecraftdev/custombosses/utils/factions/FactionsM.java
similarity index 93%
rename from api-modules/FactionsM/src/net/aminecraftdev/custombosses/innerapi/factions/FactionsM.java
rename to api-modules/FactionsM/src/net/aminecraftdev/custombosses/utils/factions/FactionsM.java
index 0d1f516..e63dde0 100644
--- a/api-modules/FactionsM/src/net/aminecraftdev/custombosses/innerapi/factions/FactionsM.java
+++ b/api-modules/FactionsM/src/net/aminecraftdev/custombosses/utils/factions/FactionsM.java
@@ -1,11 +1,11 @@
-package net.aminecraftdev.custombosses.innerapi.factions;
+package net.aminecraftdev.custombosses.utils.factions;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.entity.BoardColl;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.ps.PS;
-import net.aminecraftdev.custombosses.innerapi.dependencies.FactionBuilder;
+import net.aminecraftdev.custombosses.utils.IFactionHelper;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -15,7 +15,7 @@ import org.bukkit.entity.Player;
* @version 1.0.0
* @since 31-May-17
*/
-public class FactionsM implements FactionBuilder {
+public class FactionsM implements IFactionHelper {
@Override
public boolean isFriendly(Player a, Player b) {
diff --git a/api-modules/FactionsOne/FactionsOne.iml b/api-modules/FactionsOne/FactionsOne.iml
index b932985..8dcb6a4 100644
--- a/api-modules/FactionsOne/FactionsOne.iml
+++ b/api-modules/FactionsOne/FactionsOne.iml
@@ -1,13 +1,35 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-modules/FactionsOne/pom.xml b/api-modules/FactionsOne/pom.xml
index f89e0de..2032668 100644
--- a/api-modules/FactionsOne/pom.xml
+++ b/api-modules/FactionsOne/pom.xml
@@ -16,7 +16,7 @@
net.aminecraftdev.custombosses
- PluginAPI
+ FactionHelper3.0.0.0provided
@@ -30,8 +30,8 @@
clean package install
- /target
- ${project.artifactId}-${project.version}
+ target
+ ${project.artifactId}-${plugin.version}${basedir}/src/
@@ -60,5 +60,4 @@
-
\ No newline at end of file
diff --git a/api-modules/FactionsOne/src/net/aminecraftdev/custombosses/innerapi/factions/FactionsOne.java b/api-modules/FactionsOne/src/net/aminecraftdev/custombosses/utils/factions/FactionsOne.java
similarity index 93%
rename from api-modules/FactionsOne/src/net/aminecraftdev/custombosses/innerapi/factions/FactionsOne.java
rename to api-modules/FactionsOne/src/net/aminecraftdev/custombosses/utils/factions/FactionsOne.java
index 0846e9b..bce6ef9 100644
--- a/api-modules/FactionsOne/src/net/aminecraftdev/custombosses/innerapi/factions/FactionsOne.java
+++ b/api-modules/FactionsOne/src/net/aminecraftdev/custombosses/utils/factions/FactionsOne.java
@@ -1,11 +1,11 @@
-package net.aminecraftdev.custombosses.innerapi.factions;
+package net.aminecraftdev.custombosses.utils.factions;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.struct.Rel;
-import net.aminecraftdev.custombosses.innerapi.dependencies.FactionBuilder;
+import net.aminecraftdev.custombosses.utils.IFactionHelper;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -15,7 +15,7 @@ import org.bukkit.entity.Player;
* @version 1.0.0
* @since 31-May-17
*/
-public class FactionsOne implements FactionBuilder {
+public class FactionsOne implements IFactionHelper {
@Override
public boolean isFriendly(Player a, Player b) {
diff --git a/api-modules/FactionsUUID/FactionsUUID.iml b/api-modules/FactionsUUID/FactionsUUID.iml
index b932985..e7034c7 100644
--- a/api-modules/FactionsUUID/FactionsUUID.iml
+++ b/api-modules/FactionsUUID/FactionsUUID.iml
@@ -1,13 +1,35 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-modules/FactionsUUID/pom.xml b/api-modules/FactionsUUID/pom.xml
index c73b6a4..44d8139 100644
--- a/api-modules/FactionsUUID/pom.xml
+++ b/api-modules/FactionsUUID/pom.xml
@@ -16,22 +16,22 @@
net.aminecraftdev.custombosses
- PluginAPI
+ FactionHelper3.0.0.0provided
- com.massivecraft
+ com.massivecraft.factionsFactionsUUID
- 1.6.9.5-U0.1.20
+ 1.6.9.5-U0.1.21providedclean package install
- /target
- ${project.artifactId}-${project.version}
+ target
+ ${project.artifactId}-${plugin.version}${basedir}/src/
@@ -60,5 +60,4 @@
-
\ No newline at end of file
diff --git a/api-modules/FactionsUUID/src/net.aminecraftdev.custombosses.innerapi.factions/FactionsUUID.java b/api-modules/FactionsUUID/src/net/aminecraftdev/custombosses/utils/factions/FactionsUUID.java
similarity index 92%
rename from api-modules/FactionsUUID/src/net.aminecraftdev.custombosses.innerapi.factions/FactionsUUID.java
rename to api-modules/FactionsUUID/src/net/aminecraftdev/custombosses/utils/factions/FactionsUUID.java
index 43c3f3b..fae6ac9 100644
--- a/api-modules/FactionsUUID/src/net.aminecraftdev.custombosses.innerapi.factions/FactionsUUID.java
+++ b/api-modules/FactionsUUID/src/net/aminecraftdev/custombosses/utils/factions/FactionsUUID.java
@@ -1,11 +1,11 @@
-package net.aminecraftdev.custombosses.innerapi.factions;
+package net.aminecraftdev.custombosses.utils.factions;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.struct.Relation;
-import net.aminecraftdev.custombosses.innerapi.dependencies.FactionBuilder;
+import net.aminecraftdev.custombosses.utils.IFactionHelper;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -15,7 +15,7 @@ import org.bukkit.entity.Player;
* @version 1.0.0
* @since 31-May-17
*/
-public class FactionsUUID implements FactionBuilder {
+public class FactionsUUID implements IFactionHelper {
@Override
public boolean isFriendly(Player a, Player b) {
diff --git a/api-modules/LegacyFactions/LegacyFactions.iml b/api-modules/LegacyFactions/LegacyFactions.iml
new file mode 100644
index 0000000..cdcd4f1
--- /dev/null
+++ b/api-modules/LegacyFactions/LegacyFactions.iml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-modules/LegacyFactions/pom.xml b/api-modules/LegacyFactions/pom.xml
new file mode 100644
index 0000000..4105d7e
--- /dev/null
+++ b/api-modules/LegacyFactions/pom.xml
@@ -0,0 +1,63 @@
+
+
+
+ CustomBosses
+ net.aminecraftdev.custombosses
+ 3.0.0.0
+ ../../pom.xml
+
+ 4.0.0
+
+ LegacyFactions
+ jar
+
+
+
+ net.aminecraftdev.custombosses
+ FactionHelper
+ 3.0.0.0
+ provided
+
+
+ net.redstoneore.legacyfactions
+ LegacyFactions
+ 1.4.7
+ provided
+
+
+
+
+ clean package install
+ target
+ ${project.artifactId}-${plugin.version}
+ ${basedir}/src/
+
+
+ maven-compiler-plugin
+ 2.3.2
+
+
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 1.4
+
+ false
+
+
+
+ package
+
+ shade
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-modules/LegacyFactions/src/net/aminecraftdev/custombosses/utils/factions/LegacyFactions.java b/api-modules/LegacyFactions/src/net/aminecraftdev/custombosses/utils/factions/LegacyFactions.java
new file mode 100644
index 0000000..00a575c
--- /dev/null
+++ b/api-modules/LegacyFactions/src/net/aminecraftdev/custombosses/utils/factions/LegacyFactions.java
@@ -0,0 +1,59 @@
+package net.aminecraftdev.custombosses.utils.factions;
+
+import net.aminecraftdev.custombosses.utils.IFactionHelper;
+import net.redstoneore.legacyfactions.Relation;
+import net.redstoneore.legacyfactions.entity.Board;
+import net.redstoneore.legacyfactions.entity.FPlayerColl;
+import net.redstoneore.legacyfactions.entity.Faction;
+import net.redstoneore.legacyfactions.locality.Locality;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+
+/**
+ * @author AMinecraftDev
+ * @version 1.0.0
+ * @since 27-Oct-17
+ */
+public class LegacyFactions implements IFactionHelper {
+
+ @Override
+ public boolean isFriendly(Player a, Player b) {
+ Faction aFac = FPlayerColl.get(a).getFaction();
+ 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;
+ return false;
+ }
+
+ @Override
+ public boolean isFriendly(Player a, Location location) {
+ Faction aFac = FPlayerColl.get(a).getFaction();
+ 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;
+ return false;
+ }
+
+ @Override
+ public boolean isInWarzone(Location location) {
+ Faction faction = Board.get().getFactionAt(Locality.of(location));
+
+ return faction.isWarZone();
+ }
+
+ @Override
+ public boolean isInClaimedLand(Location location) {
+ Faction faction = Board.get().getFactionAt(Locality.of(location));
+
+ return !(faction.isWarZone() || faction.isWilderness() || faction.isSafeZone());
+ }
+}
diff --git a/api-modules/PluginAPI/PluginAPI.iml b/api-modules/PluginAPI/PluginAPI.iml
index b932985..8119ad2 100644
--- a/api-modules/PluginAPI/PluginAPI.iml
+++ b/api-modules/PluginAPI/PluginAPI.iml
@@ -1,13 +1,33 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api-modules/PluginAPI/pom.xml b/api-modules/PluginAPI/pom.xml
index e36ea33..d0f93f6 100644
--- a/api-modules/PluginAPI/pom.xml
+++ b/api-modules/PluginAPI/pom.xml
@@ -15,8 +15,8 @@
clean package install
- /target
- ${project.artifactId}-${project.version}
+ target
+ ${project.artifactId}-${plugin.version}${basedir}/src/
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/FileUtils.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/FileUtils.java
deleted file mode 100644
index a8e28dd..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/FileUtils.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi;
-
-import org.bukkit.configuration.file.FileConfiguration;
-import org.bukkit.configuration.file.YamlConfiguration;
-
-import java.io.File;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-public class FileUtils {
-
- public static final void saveFile(File file, FileConfiguration configuration) {
- try {
- configuration.save(file);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public static final FileConfiguration getConf(File file) {
- return YamlConfiguration.loadConfiguration(file);
- }
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/FireworkUtils.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/FireworkUtils.java
deleted file mode 100644
index 90b02a0..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/FireworkUtils.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi;
-
-import org.bukkit.Color;
-import org.bukkit.FireworkEffect;
-import org.bukkit.Location;
-import org.bukkit.configuration.ConfigurationSection;
-import org.bukkit.entity.Firework;
-import org.bukkit.entity.Player;
-import org.bukkit.inventory.meta.FireworkMeta;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-public class FireworkUtils {
-
- public static final Color getColour(String s) {
- if(s.equalsIgnoreCase("AQUA")) return Color.AQUA;
- if(s.equalsIgnoreCase("BLACK")) return Color.BLACK;
- if(s.equalsIgnoreCase("BLUE")) return Color.BLUE;
- if(s.equalsIgnoreCase("FUCHSIA")) return Color.FUCHSIA;
- if(s.equalsIgnoreCase("GRAY")) return Color.GRAY;
- if(s.equalsIgnoreCase("GREEN")) return Color.GREEN;
- if(s.equalsIgnoreCase("LIME")) return Color.LIME;
- if(s.equalsIgnoreCase("MAROON")) return Color.MAROON;
- if(s.equalsIgnoreCase("NAVY")) return Color.NAVY;
- if(s.equalsIgnoreCase("OLIVE")) return Color.OLIVE;
- if(s.equalsIgnoreCase("ORANGE")) return Color.ORANGE;
- if(s.equalsIgnoreCase("PURPLE")) return Color.PURPLE;
- if(s.equalsIgnoreCase("RED")) return Color.RED;
- if(s.equalsIgnoreCase("SILVER")) return Color.SILVER;
- if(s.equalsIgnoreCase("TEAL")) return Color.TEAL;
- if(s.equalsIgnoreCase("WHITE")) return Color.WHITE;
- if(s.equalsIgnoreCase("YELLOW")) return Color.YELLOW;
-
- return null;
- }
-
- public static final void spawnFirework(Location location, ConfigurationSection configurationSection) {
- Firework firework = (Firework) location.getWorld().spawn(location, Firework.class);
- String colour = configurationSection.getString("color").toUpperCase();
- Color fireworkColor = getColour(colour);
- int fireworkPower = configurationSection.getInt("power");
- boolean fireworkFlicker = configurationSection.getBoolean("flicker");
- boolean fireworkTrail = configurationSection.getBoolean("trail");
- FireworkEffect.Type fireworkType = FireworkEffect.Type.valueOf(configurationSection.getString("type").toUpperCase());
-
- FireworkMeta fireworkMeta = firework.getFireworkMeta();
-
- fireworkMeta.addEffect(FireworkEffect.builder()
- .flicker(fireworkFlicker)
- .trail(fireworkTrail)
- .with(fireworkType)
- .withColor(fireworkColor)
- .build());
-
- fireworkMeta.setPower(fireworkPower);
- firework.setFireworkMeta(fireworkMeta);
- }
-
- public static final void spawnFirework(Player player, ConfigurationSection configurationSection) {
- spawnFirework(player.getLocation(), configurationSection);
- }
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/NumberUtils.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/NumberUtils.java
deleted file mode 100644
index 4647142..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/NumberUtils.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi;
-
-import java.text.DecimalFormat;
-
-/**
- * Created by charl on 28-Apr-17.
- */
-public class NumberUtils {
-
- public static final String formatDouble(double d) {
- DecimalFormat format = new DecimalFormat("###,###,###,###,###.##");
-
- return format.format(d);
- }
-
- public static final String formatTime(int time) {
- int hours = time / 3600;
- int remainder = time % 3600;
- int minutes = remainder / 60;
- int seconds = remainder % 60;
- String disHour = (hours < 10 ? "0" : "") + hours;
- String disMinu = (minutes < 10 ? "0" : "") + minutes;
- String disSeco = (seconds < 10 ? "0" : "") + seconds;
- String formatted = "";
-
- if(hours != 0) formatted += disHour + " hours ";
- if(minutes != 0) formatted += disMinu + " minutes ";
- if(seconds != 0) formatted += disSeco + " seconds.";
-
- return formatted;
- }
-
- public static final boolean isStringInteger(String s) {
- try {
- Integer.valueOf(s);
- } catch (NumberFormatException e) {
- return false;
- }
-
- return true;
- }
-
- public static final boolean isStringDouble(String s) {
- try {
- Double.valueOf(s);
- } catch (NumberFormatException e) {
- return false;
- }
-
- return true;
- }
-
-}
\ No newline at end of file
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/PotionUtils.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/PotionUtils.java
deleted file mode 100644
index 34d2fa5..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/PotionUtils.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi;
-
-import org.bukkit.configuration.ConfigurationSection;
-import org.bukkit.potion.PotionEffect;
-import org.bukkit.potion.PotionEffectType;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-public class PotionUtils {
-
- public static final PotionEffect getPotionEffect(ConfigurationSection configurationSection) {
- if(configurationSection.contains("enabled") && !configurationSection.getBoolean("enabled")) return null;
-
- int level = configurationSection.getInt("level");
- int duration = configurationSection.getInt("duration");
- String type = configurationSection.getString("type");
-
- if(PotionEffectType.getByName(type) == null) {
- return null;
- }
-
- PotionEffectType potionEffectType = PotionEffectType.getByName(type);
-
- if(duration == -1) {
- duration = 100000;
- } else {
- duration *= 20;
- }
-
- level -= 1;
-
- return new PotionEffect(potionEffectType, duration, level);
- }
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/RandomUtils.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/RandomUtils.java
deleted file mode 100644
index 751b6bc..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/RandomUtils.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi;
-
-import java.util.Random;
-
-/**
- * Created by charl on 28-Apr-17.
- */
-public class RandomUtils {
-
- private static final Random RANDOM;
-
- static {
- RANDOM = new Random();
- }
-
- public static Random getRandom() {
- return RANDOM;
- }
-
- public static int getRandomInt(int input) {
- return RANDOM.nextInt(input);
- }
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/SoundUtils.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/SoundUtils.java
deleted file mode 100644
index 44cc7e7..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/SoundUtils.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi;
-
-import org.bukkit.Sound;
-import org.bukkit.configuration.ConfigurationSection;
-import org.bukkit.entity.Player;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-public class SoundUtils {
-
- public static final void playSound(ConfigurationSection configurationSection, Player player) {
- boolean enabled = configurationSection.getBoolean("enabled", true);
- String type = configurationSection.getString("type");
- int volume = configurationSection.getInt("volume");
- int pitch = configurationSection.getInt("pitch");
-
- if(!enabled) return;
-
- player.playSound(player.getLocation(), Sound.valueOf(type.toUpperCase()), (float) volume, (float) pitch);
- }
-
- public static final Sound getSound(ConfigurationSection configurationSection) {
- boolean enabled = configurationSection.getBoolean("enabled", true);
- String type = configurationSection.getString("type");
-
- if(!enabled) return null;
-
- return Sound.valueOf(type.toUpperCase());
- }
-
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/CommandUtils.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/CommandUtils.java
deleted file mode 100644
index e11eb17..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/CommandUtils.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command;
-
-import org.boostednetwork.factionscore.utils.NumberUtils;
-import org.bukkit.Bukkit;
-import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
-
-/**
- * Created by charl on 28-Apr-17.
- */
-public class CommandUtils {
-
- public static final Player strAsPlayer(String s) {
- if(Bukkit.getPlayer(s) == null) return null;
-
- return Bukkit.getPlayer(s);
- }
-
- public static final Integer strAsInteger(String s) {
- if(NumberUtils.isStringInteger(s)) return Integer.valueOf(s);
-
- return null;
- }
-
- public static final Double strAsDouble(String s) {
- if(NumberUtils.isStringDouble(s)) return Double.valueOf(s);
-
- return null;
- }
-
- public static final boolean isIntegerWithinItemStackSize(int i) {
- if(i > 64) return false;
- if(i < 1) return false;
-
- return true;
- }
-
- public static final boolean isCommandSenderPlayer(CommandSender commandSender) {
- if(!(commandSender instanceof Player)) return false;
-
- return true;
- }
-
-}
\ No newline at end of file
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/SubCommand.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/SubCommand.java
deleted file mode 100644
index c750d7f..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/SubCommand.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command;
-
-import org.bukkit.command.CommandSender;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-public abstract class SubCommand {
-
- private String subCommand;
-
- public SubCommand(String subCommand) {
- this.subCommand = subCommand;
- }
-
- public String getSubCommand() {
- return subCommand;
- }
-
- public abstract void execute(T sender, String[] args);
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/SubCommandBuilder.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/SubCommandBuilder.java
deleted file mode 100644
index 5051f1a..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/SubCommandBuilder.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command;
-
-import org.bukkit.command.CommandSender;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-public interface SubCommandBuilder {
-
- void register(SubCommand subCommand);
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/CommandRemover.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/CommandRemover.java
deleted file mode 100644
index 05b33e1..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/CommandRemover.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder;
-
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandMap;
-import org.bukkit.command.SimpleCommandMap;
-import org.bukkit.plugin.SimplePluginManager;
-import org.bukkit.plugin.java.JavaPlugin;
-
-import java.lang.reflect.Field;
-import java.util.Map;
-
-/**
- * Created by charl on 03-May-17.
- */
-public final class CommandRemover {
-
- private CommandMap map = new SimpleCommandMap(null);
-
- /**
- * Remove/un-register a command.
- */
- public CommandRemover(JavaPlugin plugin, String command) {
- if (plugin.getServer() != null && plugin.getServer().getPluginManager() instanceof SimplePluginManager) {
- final SimplePluginManager manager = (SimplePluginManager) plugin.getServer().getPluginManager();
- try {
- final Field field = SimplePluginManager.class.getDeclaredField("commandMap");
- field.setAccessible(true);
-
- map = (CommandMap) field.get(manager);
-
- final Field field2 = SimpleCommandMap.class.getDeclaredField("knownCommands");
- field2.setAccessible(true);
-
- @SuppressWarnings("unchecked")
- final Map knownCommands = (Map) field2.get(map);
-
- for (final Map.Entry entry : knownCommands.entrySet()) {
- if (entry.getKey().equals(command)) {
- entry.getValue().unregister(map);
- }
- }
-
- knownCommands.remove(command);
- } catch (IllegalArgumentException | NoSuchFieldException | IllegalAccessException | SecurityException e) {
- e.printStackTrace();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/CommandService.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/CommandService.java
deleted file mode 100644
index 5942151..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/CommandService.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder;
-
-import net.aminecraftdev.custombosses.innerapi.command.builder.attributes.*;
-import net.aminecraftdev.custombosses.innerapi.message.MessageUtils;
-import org.bukkit.Bukkit;
-import org.bukkit.command.CommandMap;
-import org.bukkit.command.CommandSender;
-import org.bukkit.command.defaults.BukkitCommand;
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-
-/**
- * Created by charl on 03-May-17.
- */
-public abstract class CommandService extends BukkitCommand {
-
- private static CommandMap _commandMap = null;
-
- private String _command, _description, _usage, _noPermMessage, _permission;
- private String[] _aliases;
-
- /**
- * Construct a new command.
- *
- * @param command The command label
- * @param description The command description
- * @param aliases Aliases of the command
- */
- public CommandService(String command, String description, String[] aliases) {
- super(command);
-
- _command = command;
- _description = description;
- _aliases = aliases;
- }
-
- /**
- * Construct a new command.
- *
- * @param command The command label
- * @param description The command description
- */
- public CommandService(String command, String description) {
- this(command, description, new String[]{});
- }
-
- /**
- * Construct a new command.
- *
- * @param cmd The command
- */
- public CommandService(Class extends CommandService> cmd) {
- this(cmd.getAnnotation(Name.class).value(), cmd.getAnnotation(Description.class).value());
-
- if(cmd.isAnnotationPresent(Alias.class))
- _aliases = cmd.getAnnotation(Alias.class).value();
-
- if(cmd.isAnnotationPresent(Permission.class))
- _permission = cmd.getAnnotation(Permission.class).value();
-
- if(cmd.isAnnotationPresent(Usage.class))
- _usage = cmd.getAnnotation(Usage.class).value();
-
- if(cmd.isAnnotationPresent(NoPermission.class))
- _noPermMessage = cmd.getAnnotation(NoPermission.class).value();
-
- register();
- }
-
- @Override
- public final boolean execute(CommandSender commandSender, String s, String[] args) {
- if(testPermission(commandSender)) return false;
-
- try {
- execute((T) commandSender, args);
- } catch (ClassCastException e) {
- commandSender.sendMessage(MessageUtils.translateString("&4You cannot use that command."));
- return false;
- }
- return true;
- }
-
- /**
- * This is fired when the command is executed.
- *
- * @param sender Sender of the command
- * @param args Command arguments
- */
- public abstract void execute(T sender, String[] args);
-
-
- /**
- * This method will register a command without the need of plugin.yml
- */
- private void register() {
- if (_commandMap != null) {
- setFields();
- _commandMap.register(_command, this);
- return;
- }
-
- try {
- Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap");
- field.setAccessible(true);
- _commandMap = (CommandMap) field.get(Bukkit.getServer());
-
- setFields();
-
- _commandMap.register(_command, this);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void setFields() {
- setDescription(_description);
-
- if(_aliases != null) setAliases(Arrays.asList(_aliases));
- if(_usage != null) setUsage(_usage);
- if(_permission != null) setPermission(_permission);
-
- if(_noPermMessage != null) {
- setPermissionMessage(MessageUtils.translateString(_noPermMessage));
- } else {
- setPermissionMessage(MessageUtils.translateString("&4You do not have for that command."));
- }
- }
-
- @Override
- public String getDescription() {
- return _description;
- }
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Alias.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Alias.java
deleted file mode 100644
index b9127d6..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Alias.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder.attributes;
-
-import java.lang.annotation.*;
-
-/**
- * Created by charl on 03-May-17.
- */
-@Documented
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Alias {
-
- String[] value();
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Description.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Description.java
deleted file mode 100644
index 59c4369..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Description.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder.attributes;
-
-import java.lang.annotation.*;
-
-/**
- * Created by charl on 03-May-17.
- */
-@Documented
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Description {
-
- String value();
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Name.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Name.java
deleted file mode 100644
index a304586..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Name.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder.attributes;
-
-import java.lang.annotation.*;
-
-/**
- * Created by LukeBingham on 03/04/2017.
- */
-@Documented
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Name {
-
- String value();
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/NoPermission.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/NoPermission.java
deleted file mode 100644
index 1736422..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/NoPermission.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder.attributes;
-
-import java.lang.annotation.*;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-@Documented
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface NoPermission {
-
- String value();
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Permission.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Permission.java
deleted file mode 100644
index 2aca448..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Permission.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder.attributes;
-
-import java.lang.annotation.*;
-
-/**
- * Created by charl on 11-May-17.
- */
-@Documented
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Permission {
-
- String value();
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Usage.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Usage.java
deleted file mode 100644
index fa15626..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/command/builder/attributes/Usage.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.command.builder.attributes;
-
-import java.lang.annotation.*;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-@Documented
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Usage {
-
- String value();
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/FactionBuilder.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/FactionBuilder.java
deleted file mode 100644
index 9163500..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/FactionBuilder.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.dependencies;
-
-import org.bukkit.Location;
-import org.bukkit.entity.Player;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 31-May-17
- */
-public interface FactionBuilder {
-
- /** Used to tell if 2 players are
- * friendly.
- *
- * @param a - The first player.
- * @param b - The second player.
- *
- */
-
- boolean isFriendly(Player a, Player b);
-
-
- /** Used to tell if a player is in friendly
- * land, in other words to tell if they are
- * in ally, truce or their own land. If not
- * returns false.
- *
- * @param a - The player.
- * @param location - The location we are checking.
- *
- */
-
- boolean isFriendly(Player a, Location location);
-
-
- /** Used to check if a location is in the warzone.
- * I used this in my CustomBosses plugin to check
- * if the player was inside a warzone when spawning
- * the boss.
- *
- * @param location - The location we are checking.
- *
- */
-
- boolean isInWarzone(Location location);
-
-
- /** Used to check if the location is claimed by a faction
- * other then Wilderness, Warzone or Safezone. If it is
- * another faction it will return true, otherwise if its
- * in Wilderness, Warzone or Safezone it will return false.
- *
- * @param location - The location that is being tested.
- *
- */
- boolean isInClaimedLand(Location location);
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/VaultHelper.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/VaultHelper.java
deleted file mode 100644
index bb05662..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/VaultHelper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.dependencies;
-
-import net.milkbowl.vault.chat.Chat;
-import net.milkbowl.vault.economy.Economy;
-import net.milkbowl.vault.permission.Permission;
-import org.bukkit.Bukkit;
-import org.bukkit.plugin.RegisteredServiceProvider;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 25-May-17
- */
-public class VaultHelper {
-
- private static Economy economy;
- private static Chat chat;
- private static Permission permission;
-
- public static final Economy getEconomy() {
- return economy;
- }
-
- public static final Chat getChat() {
- return chat;
- }
-
- public static final Permission getPermission() {
- return permission;
- }
-
- public static boolean setupVault() {
- if(!setupChat()) return false;
- if(!setupPermission()) return false;
- if(!setupEconomy()) return false;
- return true;
- }
-
- private static boolean setupChat() {
- if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
- return false;
- }
- RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Chat.class);
- if (rsp == null) {
- return false;
- }
- chat = rsp.getProvider();
- return chat != null;
- }
-
- private static boolean setupEconomy() {
- if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
- return false;
- }
- RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
- if (rsp == null) {
- return false;
- }
- economy = rsp.getProvider();
- return economy != null;
- }
-
- private static boolean setupPermission() {
- if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
- return false;
- }
- RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Permission.class);
- if (rsp == null) {
- return false;
- }
- permission = rsp.getProvider();
- return permission != null;
- }
-
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/WorldGuardHelper.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/WorldGuardHelper.java
deleted file mode 100644
index 5e6450f..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/dependencies/WorldGuardHelper.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.dependencies;
-
-import com.sk89q.worldguard.bukkit.WGBukkit;
-import com.sk89q.worldguard.protection.ApplicableRegionSet;
-import com.sk89q.worldguard.protection.flags.DefaultFlag;
-import com.sk89q.worldguard.protection.flags.StateFlag;
-import com.sk89q.worldguard.protection.regions.ProtectedRegion;
-import org.bukkit.Bukkit;
-import org.bukkit.Location;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 25-May-17
- */
-public class WorldGuardHelper {
-
- private static Boolean isLoaded = null;
-
- private static boolean isPluginLoaded() {
- return isLoaded != null? isLoaded : (isLoaded = Bukkit.getServer().getPluginManager().getPlugin("WorldEdit") != null
- && Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null);
- }
-
- public static boolean isPvPAllowed(Location loc) {
- if(isPluginLoaded()) {
- ApplicableRegionSet set = WGBukkit.getPlugin().getRegionManager(loc.getWorld()).getApplicableRegions(loc);
-
- if(set.queryState(null, DefaultFlag.PVP) == StateFlag.State.DENY) return false;
- }
-
- return true;
- }
-
- public static boolean isBreakAllowed(Location loc) {
- if(isPluginLoaded()) {
- ApplicableRegionSet set = WGBukkit.getPlugin().getRegionManager(loc.getWorld()).getApplicableRegions(loc);
-
- if(set.queryState(null, DefaultFlag.BLOCK_BREAK) == StateFlag.State.DENY) return false;
- }
-
- return true;
- }
-
- public static boolean allowsExplosions(Location loc) {
- if(isPluginLoaded()) {
- ApplicableRegionSet set = WGBukkit.getPlugin().getRegionManager(loc.getWorld()).getApplicableRegions(loc);
-
- if(set.queryState(null, DefaultFlag.OTHER_EXPLOSION) == StateFlag.State.DENY) return false;
- }
-
- return true;
- }
-
- public static List getRegionNames(Location loc) {
- if(isPluginLoaded()) {
- ApplicableRegionSet set = WGBukkit.getPlugin().getRegionManager(loc.getWorld()).getApplicableRegions(loc);
- LinkedList parentNames = new LinkedList();
- LinkedList regions = new LinkedList();
-
- for(ProtectedRegion region : set) {
- String id = region.getId();
-
- regions.add(id);
-
- ProtectedRegion parent = region.getParent();
-
- while(parent != null) {
- parentNames.add(parent.getId());
- parent = parent.getParent();
- }
- }
-
- for(String name : parentNames) {
- regions.remove(name);
- }
-
- return regions;
- }
-
- return null;
- }
-
- public static boolean isMobSpawningAllowed(Location loc) {
- if(isPluginLoaded()) {
- ApplicableRegionSet set = WGBukkit.getPlugin().getRegionManager(loc.getWorld()).getApplicableRegions(loc);
-
- if(set.queryState(null, DefaultFlag.MOB_SPAWNING) == StateFlag.State.DENY) return false;
- }
-
- return true;
- }
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/CloneableFactory.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/CloneableFactory.java
deleted file mode 100644
index d5a7ca8..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/CloneableFactory.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.factory;
-
-/**
- * Created by charl on 04-May-17.
- */
-public interface CloneableFactory {
-
- T clone();
-
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/Factory.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/Factory.java
deleted file mode 100644
index 47471b0..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/Factory.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.factory;
-
-/**
- * Created by charl on 04-May-17.
- */
-public abstract class Factory implements FactoryBuilder {
-
- protected T object;
-
- public abstract T build();
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/FactoryBuilder.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/FactoryBuilder.java
deleted file mode 100644
index 1ee9b68..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/FactoryBuilder.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package net.aminecraftdev.custombosses.innerapi.factory;
-
-/**
- * @author AMinecraftDev
- * @version 1.0.0
- * @since 29-May-17
- */
-public interface FactoryBuilder {
-
- T build();
-}
diff --git a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/NbtFactory.java b/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/NbtFactory.java
deleted file mode 100644
index 8fe7688..0000000
--- a/api-modules/PluginAPI/src/net/aminecraftdev/custombosses/innerapi/factory/NbtFactory.java
+++ /dev/null
@@ -1,997 +0,0 @@
-// The MIT License (MIT)
-//
-// Copyright (c) 2015 Kristian Stangeland
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
-// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
-// Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-package net.aminecraftdev.custombosses.innerapi.factory;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.BiMap;
-import com.google.common.collect.HashBiMap;
-import com.google.common.collect.Lists;
-import com.google.common.collect.MapMaker;
-import com.google.common.io.Closeables;
-import com.google.common.io.Files;
-import com.google.common.io.InputSupplier;
-import com.google.common.io.OutputSupplier;
-import com.google.common.primitives.Primitives;
-import org.bukkit.Bukkit;
-import org.bukkit.Material;
-import org.bukkit.Server;
-import org.bukkit.inventory.ItemStack;
-
-import java.io.*;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.*;
-import java.util.concurrent.ConcurrentMap;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-
-@SuppressWarnings("deprecation")
-public class NbtFactory {
- // Convert between NBT id and the equivalent class in java
- private static final BiMap> NBT_CLASS = HashBiMap.create();
- private static final BiMap NBT_ENUM = HashBiMap.create();
-
- /**
- * Whether or not to enable stream compression.
- * @author Kristian
- */
- public enum StreamOptions {
- NO_COMPRESSION,
- GZIP_COMPRESSION,
- }
-
- private enum NbtType {
- TAG_END(0, Void.class),
- TAG_BYTE(1, byte.class),
- TAG_SHORT(2, short.class),
- TAG_INT(3, int.class),
- TAG_LONG(4, long.class),
- TAG_FLOAT(5, float.class),
- TAG_DOUBLE(6, double.class),
- TAG_BYTE_ARRAY(7, byte[].class),
- TAG_INT_ARRAY(11, int[].class),
- TAG_STRING(8, String.class),
- TAG_LIST(9, List.class),
- TAG_COMPOUND(10, Map.class);
-
- // Unique NBT id
- public final int id;
-
- private NbtType(int id, Class> type) {
- this.id = id;
- NBT_CLASS.put(id, type);
- NBT_ENUM.put(id, this);
- }
-
- private String getFieldName() {
- if (this == TAG_COMPOUND)
- return "map";
- else if (this == TAG_LIST)
- return "list";
- else
- return "data";
- }
- }
-
- // The NBT base class
- private Class> BASE_CLASS;
- private Class> COMPOUND_CLASS;
- private Class> STREAM_TOOLS;
- private Class> READ_LIMITER_CLASS;
- private Method NBT_CREATE_TAG;
- private Method NBT_GET_TYPE;
- private Field NBT_LIST_TYPE;
- private final Field[] DATA_FIELD = new Field[12];
-
- // CraftItemStack
- private Class> CRAFT_STACK;
- private Field CRAFT_HANDLE;
- private Field STACK_TAG;
-
- // Loading/saving compounds
- private LoadCompoundMethod LOAD_COMPOUND;
- private Method SAVE_COMPOUND;
-
- // Shared instance
- private static NbtFactory INSTANCE;
-
- /**
- * Represents a root NBT compound.
- *
- * All changes to this map will be reflected in the underlying NBT compound. Values may only be one of the following:
- *
- *
Primitive types
- *
{@link String String}
- *
{@link NbtList}
- *
{@link NbtCompound}
- *
- *
- * See also:
- *
- *
{@link NbtFactory#createCompound()}
- *
{@link NbtFactory#fromCompound(Object)}
- *
- * @author Kristian
- */
- public final class NbtCompound extends ConvertedMap {
- private NbtCompound(Object handle) {
- super(handle, getDataMap(handle));
- }
-
- // Simplifiying access to each value
- public Byte getByte(String key, Byte defaultValue) {
- return containsKey(key) ? (Byte)get(key) : defaultValue;
- }
- public Short getShort(String key, Short defaultValue) {
- return containsKey(key) ? (Short)get(key) : defaultValue;
- }
- public Integer getInteger(String key, Integer defaultValue) {
- return containsKey(key) ? (Integer)get(key) : defaultValue;
- }
- public Long getLong(String key, Long defaultValue) {
- return containsKey(key) ? (Long)get(key) : defaultValue;
- }
- public Float getFloat(String key, Float defaultValue) {
- return containsKey(key) ? (Float)get(key) : defaultValue;
- }
- public Double getDouble(String key, Double defaultValue) {
- return containsKey(key) ? (Double)get(key) : defaultValue;
- }
- public String getString(String key, String defaultValue) {
- return containsKey(key) ? (String)get(key) : defaultValue;
- }
- public byte[] getByteArray(String key, byte[] defaultValue) {
- return containsKey(key) ? (byte[])get(key) : defaultValue;
- }
- public int[] getIntegerArray(String key, int[] defaultValue) {
- return containsKey(key) ? (int[])get(key) : defaultValue;
- }
-
- /**
- * Retrieve the list by the given name.
- * @param key - the name of the list.
- * @param createNew - whether or not to create a new list if its missing.
- * @return An existing list, a new list or NULL.
- */
- public NbtList getList(String key, boolean createNew) {
- NbtList list = (NbtList) get(key);
-
- if (list == null && createNew)
- put(key, list = createList());
- return list;
- }
-
- /**
- * Retrieve the map by the given name.
- * @param key - the name of the map.
- * @param createNew - whether or not to create a new map if its missing.
- * @return An existing map, a new map or NULL.
- */
- public NbtCompound getMap(String key, boolean createNew) {
- return getMap(Arrays.asList(key), createNew);
- }
- // Done
-
- /**
- * Set the value of an entry at a given location.
- *
- * Every element of the path (except the end) are assumed to be compounds, and will
- * be created if they are missing.
- * @param path - the path to the entry.
- * @param value - the new value of this entry.
- * @return This compound, for chaining.
- */
- public NbtCompound putPath(String path, Object value) {
- List entries = getPathElements(path);
- Map map = getMap(entries.subList(0, entries.size() - 1), true);
-
- map.put(entries.get(entries.size() - 1), value);
- return this;
- }
-
- /**
- * Retrieve the value of a given entry in the tree.
- *
- * Every element of the path (except the end) are assumed to be compounds. The
- * retrieval operation will be cancelled if any of them are missing.
- * @param path - path to the entry.
- * @return The value, or NULL if not found.
- */
- @SuppressWarnings("unchecked")
- public T getPath(String path) {
- List entries = getPathElements(path);
- NbtCompound map = getMap(entries.subList(0, entries.size() - 1), false);
-
- if (map != null) {
- return (T) map.get(entries.get(entries.size() - 1));
- }
- return null;
- }
-
- /**
- * Save the content of a NBT compound to a stream.
- *
- * Use {@link Files#newOutputStreamSupplier(File)} to provide a stream supplier to a file.
- * @param stream - the output stream.
- * @param option - whether or not to compress the output.
- * @throws IOException If anything went wrong.
- */
- public void saveTo(OutputSupplier extends OutputStream> stream, StreamOptions option) throws IOException {
- saveStream(this, stream, option);
- }
-
- /**
- * Retrieve a map from a given path.
- * @param path - path of compounds to look up.
- * @param createNew - whether or not to create new compounds on the way.
- * @return The map at this location.
- */
- private NbtCompound getMap(Iterable path, boolean createNew) {
- NbtCompound current = this;
-
- for (String entry : path) {
- NbtCompound child = (NbtCompound) current.get(entry);
-
- if (child == null) {
- if (!createNew)
- return null;
- current.put(entry, child = createCompound());
- }
- current = child;
- }
- return current;
- }
-
- /**
- * Split the path into separate elements.
- * @param path - the path to split.
- * @return The elements.
- */
- private List getPathElements(String path) {
- return Lists.newArrayList(Splitter.on(".").omitEmptyStrings().split(path));
- }
- }
-
- /**
- * Represents a root NBT list.
- * See also:
- *
- *
{@link NbtFactory#fromList(Object)}
- *
- * @author Kristian
- */
- public final class NbtList extends ConvertedList {
- private NbtList(Object handle) {
- super(handle, getDataList(handle));
- }
- }
-
- /**
- * Represents an object that provides a view of a native NMS class.
- * @author Kristian
- */
- public static interface Wrapper {
- /**
- * Retrieve the underlying native NBT tag.
- * @return The underlying NBT.
- */
- public Object getHandle();
- }
-
- /**
- * Retrieve or construct a shared NBT factory.
- * @return The factory.
- */
- private static NbtFactory get() {
- if (INSTANCE == null)
- INSTANCE = new NbtFactory();
- return INSTANCE;
- }
-
- /**
- * Construct an instance of the NBT factory by deducing the class of NBTBase.
- */
- private NbtFactory() {
- if (BASE_CLASS == null) {
- try {
- // Keep in mind that I do use hard-coded field names - but it's okay as long as we're dealing
- // with CraftBukkit or its derivatives. This does not work in MCPC+ however.
- ClassLoader loader = NbtFactory.class.getClassLoader();
-
- String packageName = getPackageName();
- Class> offlinePlayer = loader.loadClass(packageName + ".CraftOfflinePlayer");
-
- // Prepare NBT
- COMPOUND_CLASS = getMethod(0, Modifier.STATIC, offlinePlayer, "getData").getReturnType();
- BASE_CLASS = COMPOUND_CLASS.getSuperclass();
- NBT_GET_TYPE = getMethod(0, Modifier.STATIC, BASE_CLASS, "getTypeId");
- NBT_CREATE_TAG = getMethod(Modifier.STATIC, 0, BASE_CLASS, "createTag", byte.class);
-
- // Prepare CraftItemStack
- CRAFT_STACK = loader.loadClass(packageName + ".inventory.CraftItemStack");
- CRAFT_HANDLE = getField(null, CRAFT_STACK, "handle");
- STACK_TAG = getField(null, CRAFT_HANDLE.getType(), "tag");
-
- // Loading/saving
- String nmsPackage = BASE_CLASS.getPackage().getName();
- initializeNMS(loader, nmsPackage);
-
- LOAD_COMPOUND = READ_LIMITER_CLASS != null ?
- new LoadMethodSkinUpdate(STREAM_TOOLS, READ_LIMITER_CLASS) :
- new LoadMethodWorldUpdate(STREAM_TOOLS);
- SAVE_COMPOUND = getMethod(Modifier.STATIC, 0, STREAM_TOOLS, null, BASE_CLASS, DataOutput.class);
-
- } catch (ClassNotFoundException e) {
- throw new IllegalStateException("Unable to find offline player.", e);
- }
- }
- }
-
- private void initializeNMS(ClassLoader loader, String nmsPackage) {
- try {
- STREAM_TOOLS = loader.loadClass(nmsPackage + ".NBTCompressedStreamTools");
- READ_LIMITER_CLASS = loader.loadClass(nmsPackage + ".NBTReadLimiter");
- } catch (ClassNotFoundException e) {
- // Ignore - we will detect this later
- }
- }
-
- private String getPackageName() {
- Server server = Bukkit.getServer();
- String name = server != null ? server.getClass().getPackage().getName() : null;
-
- if (name != null && name.contains("craftbukkit")) {
- return name;
- } else {
- // Fallback
- return "org.bukkit.craftbukkit.v1_7_R3";
- }
- }
-
- @SuppressWarnings("unchecked")
- private Map getDataMap(Object handle) {
- return (Map) getFieldValue(
- getDataField(NbtType.TAG_COMPOUND, handle), handle);
- }
-
- @SuppressWarnings("unchecked")
- private List