diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml
index 42c9532..f9a8f94 100644
--- a/dependency-reduced-pom.xml
+++ b/dependency-reduced-pom.xml
@@ -5,7 +5,22 @@
themepark
3.1.0
+ clean package
+
+
+ true
+ src/main/resources
+
+
+ ThemePark v${project.version}
+
+ maven-compiler-plugin
+ 3.8.1
+
+ 11
+
+
maven-shade-plugin
3.2.0
diff --git a/pom.xml b/pom.xml
index 7121122..c6e7269 100644
--- a/pom.xml
+++ b/pom.xml
@@ -113,7 +113,23 @@
+ clean package
+ ThemePark v${project.version}
+
+
+ src/main/resources
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+ 11
+
+
org.apache.maven.plugins
maven-shade-plugin
diff --git a/src/main/java/nl/iobyte/themepark/api/menu/objects/MainMenu.java b/src/main/java/nl/iobyte/themepark/api/menu/objects/MainMenu.java
index bc5eab6..0aec19f 100644
--- a/src/main/java/nl/iobyte/themepark/api/menu/objects/MainMenu.java
+++ b/src/main/java/nl/iobyte/themepark/api/menu/objects/MainMenu.java
@@ -1,5 +1,6 @@
package nl.iobyte.themepark.api.menu.objects;
+import com.cryptomorin.xseries.XMaterial;
import nl.iobyte.menuapi.MenuAPI;
import nl.iobyte.menuapi.action.HandlerAction;
import nl.iobyte.menuapi.basic.Menu;
@@ -59,10 +60,14 @@ public class MainMenu {
if(name == null || name.equals(""))
name = " ";
- Material material = Material.getMaterial(manager.getString(StorageLocation.MENU, path+".material"));
+ XMaterial material = XMaterial.matchXMaterial(manager.getString(StorageLocation.MENU, path+".material")).orElse(null);
if(material == null)
continue;
+ Material m = material.parseMaterial();
+ if(m == null)
+ continue;
+
int amount = manager.getInt(StorageLocation.MENU, path+".amount");
if(amount < 1)
amount = 1;
@@ -71,7 +76,7 @@ public class MainMenu {
if(data < 0)
continue;
- builder = new ItemBuilder(material, amount, data);
+ builder = new ItemBuilder(m, amount, data);
builder.setName(name);
String lore = manager.getString(StorageLocation.MENU, path+".lore");
diff --git a/src/main/java/nl/iobyte/themepark/api/menu/objects/actions/TPAction.java b/src/main/java/nl/iobyte/themepark/api/menu/objects/actions/TPAction.java
index b1f535e..8eba02a 100644
--- a/src/main/java/nl/iobyte/themepark/api/menu/objects/actions/TPAction.java
+++ b/src/main/java/nl/iobyte/themepark/api/menu/objects/actions/TPAction.java
@@ -1,7 +1,9 @@
package nl.iobyte.themepark.api.menu.objects.actions;
import nl.iobyte.menuapi.action.MenuAction;
+import nl.iobyte.themepark.ThemePark;
import nl.iobyte.themepark.api.attraction.objects.Attraction;
+import nl.iobyte.themepark.api.config.enums.StorageKey;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -14,7 +16,7 @@ public class TPAction extends MenuAction {
}
public void execute(Player player) {
- Bukkit.dispatchCommand(player, "themepark attraction warp "+attraction.getID());
+ Bukkit.dispatchCommand(player, ThemePark.getInstance().getAPI().getConfigurationManager().getString(StorageKey.CMD)+" attraction warp "+attraction.getID());
}
}
diff --git a/src/main/java/nl/iobyte/themepark/api/sign/SignManager.java b/src/main/java/nl/iobyte/themepark/api/sign/SignManager.java
index b698d37..2e35163 100644
--- a/src/main/java/nl/iobyte/themepark/api/sign/SignManager.java
+++ b/src/main/java/nl/iobyte/themepark/api/sign/SignManager.java
@@ -19,21 +19,22 @@ public class SignManager {
return signs;
}
- public void addSign(StatusSign sign) {
+ public boolean addSign(StatusSign sign) {
if(sign == null || sign.getLocation() == null)
- return;
+ return false;
if(!(sign.getLocation().getBlock().getState() instanceof Sign))
- return;
+ return false;
if(signs.containsKey(sign.getAttraction())) {
signs.get(sign.getAttraction()).add(sign);
- return;
+ return true;
}
ArrayList array = new ArrayList<>();
array.add(sign);
signs.put(sign.getAttraction(), array);
+ return true;
}
public boolean hasSigns(Attraction attraction) {
@@ -84,36 +85,40 @@ public class SignManager {
ThemePark.getInstance().getAPI().getConfigurationManager().set(StorageLocation.SIGN_DATA, "signs."+attraction.getID(), null);
}
- public void removeSign(StatusSign sign) {
+ public boolean removeSign(StatusSign sign) {
if(sign == null || sign.getLocation() == null || sign.getAttraction() == null)
- return;
+ return false;
if(!hasSigns(sign.getAttraction()))
- return;
+ return false;
+ String str2;
Location loc1 = sign.getLocation();
String str1 = LocationUtil.toString(loc1);
ArrayList array = signs.get(sign.getAttraction());
+ boolean b = false;
for(StatusSign s : new ArrayList<>(array)) {
Location loc2 = s.getLocation();
if(loc1 == null || loc2 == null)
- return;
-
- String str2 = LocationUtil.toString(loc2);
+ continue;
+ str2 = LocationUtil.toString(loc2);
if(!str1.equals(str2))
- return;
+ continue;
array.remove(s);
+ b = true;
+ break;
}
if(array.isEmpty()) {
signs.remove(sign.getAttraction());
ThemePark.getInstance().getAPI().getConfigurationManager().set(StorageLocation.SIGN_DATA, "signs."+sign.getAttraction().getID(), null);
- return;
+ return b;
}
signs.put(sign.getAttraction(), array);
+ return b;
}
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/ItemCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/ItemCommand.java
index 24523bd..913b431 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/ItemCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/ItemCommand.java
@@ -35,7 +35,7 @@ public class ItemCommand extends SubCommand {
Player player = (Player) sender.getOriginal();
player.getInventory().addItem(builder.getItem());
player.updateInventory();
- player.sendMessage(Text.color("&6&lThemeParkMC &f➢ Added item to your inventory"));
+ player.sendMessage(Text.color("&6&lThemePark &f➢ Added item to your inventory"));
}
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCoverCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCoverCommand.java
index a5544f8..470301c 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCoverCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCoverCommand.java
@@ -22,6 +22,6 @@ public class AttractionCoverCommand extends SubCommand {
Attraction attraction = (Attraction) list.get(0);
String url = (String) list.get(1);
attraction.setCover(url);
- sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the cover of attraction &f"+attraction.getID()));
+ sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the cover of attraction &f"+attraction.getID()));
}
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCreateCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCreateCommand.java
index 45b78c7..cf4afcc 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCreateCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionCreateCommand.java
@@ -64,7 +64,7 @@ public class AttractionCreateCommand extends SubCommand {
status,
location
));
- sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully created attraction &f"+id));
+ sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully created attraction &f"+id));
}
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionListCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionListCommand.java
index 4306490..b62c2ba 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionListCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionListCommand.java
@@ -75,7 +75,7 @@ public class AttractionListCommand extends SubCommand {
private void sendMultiPage(ICommandExecutor sender, int page, String title, Collection attractions) {
int pages = (int) Math.ceil(((double) attractions.size()) / 5);
if(page < 1 || page > pages) {
- sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ Page &6"+page+" &fdoesn't exist"));
+ sender.sendMessage(Text.color("&6&lThemePark &f➢ Page &6"+page+" &fdoesn't exist"));
return;
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionLocationCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionLocationCommand.java
index ec148d7..c080660 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionLocationCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionLocationCommand.java
@@ -22,7 +22,7 @@ public class AttractionLocationCommand extends SubCommand {
Attraction attraction = (Attraction) list.get(0);
Player player = (Player) sender.getOriginal();
attraction.setLocation(player.getLocation());
- player.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the location of attraction &f"+attraction.getID()));
+ player.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the location of attraction &f"+attraction.getID()));
}
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionNameCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionNameCommand.java
index 0bb7bae..384cb72 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionNameCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionNameCommand.java
@@ -22,7 +22,7 @@ public class AttractionNameCommand extends SubCommand {
Attraction attraction = (Attraction) list.get(0);
String name = (String) list.get(1);
attraction.setName(name);
- sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the name of attraction &f"+attraction.getID()));
+ sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the name of attraction &f"+attraction.getID()));
}
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRegionCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRegionCommand.java
index daa78db..7b70d07 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRegionCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRegionCommand.java
@@ -23,7 +23,7 @@ public class AttractionRegionCommand extends SubCommand {
Attraction attraction = (Attraction) list.get(0);
Region region = (Region) list.get(1);
attraction.setRegionID(region.getID());
- sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the region of attraction &f"+attraction.getID()));
+ sender.sendMessage(Text.color("&6&lThemePark &f➢ &aSuccessfully changed the region of attraction &f"+attraction.getID()));
}
}
diff --git a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRemoveCommand.java b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRemoveCommand.java
index 23221e3..ac2be97 100644
--- a/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRemoveCommand.java
+++ b/src/main/java/nl/iobyte/themepark/commands/subcommands/attraction/AttractionRemoveCommand.java
@@ -20,7 +20,7 @@ public class AttractionRemoveCommand extends SubCommand {
public void onCommand(ICommandExecutor sender, List