diff --git a/pom.xml b/pom.xml index c63ff9b..699ff3b 100644 --- a/pom.xml +++ b/pom.xml @@ -147,7 +147,7 @@ de.tr7zw item-nbt-api - 2.6.0 + 2.7.1 com.github.MilkBowl diff --git a/src/main/lombok/nl/sbdeveloper/themeparkplus/ThemeParkPlus.java b/src/main/lombok/nl/sbdeveloper/themeparkplus/ThemeParkPlus.java index 7239548..fcf16e6 100644 --- a/src/main/lombok/nl/sbdeveloper/themeparkplus/ThemeParkPlus.java +++ b/src/main/lombok/nl/sbdeveloper/themeparkplus/ThemeParkPlus.java @@ -115,14 +115,15 @@ public final class ThemeParkPlus extends JavaPlugin { Bukkit.getLogger().info("[ThemeParkPlus] Loading listeners..."); Bukkit.getPluginManager().registerEvents(new DirectionalGateListener(), this); - Bukkit.getPluginManager().registerEvents(new FastpassListeners(), this); + Bukkit.getPluginManager().registerEvents(new FastpassListeners(), this); //TODO Detect if ThemePark is found. Bukkit.getPluginManager().registerEvents(new SignListeners(), this); - Bukkit.getPluginManager().registerEvents(new MalfunctionListener(), this); + Bukkit.getPluginManager().registerEvents(new MalfunctionListener(), this); //TODO Detect if ThemePark is found. Bukkit.getPluginManager().registerEvents(new WaitingTimeListener(), this); if (getSConfig().getFile().getBoolean("AntiFreerun.Enabled")) { Bukkit.getPluginManager().registerEvents(new AntiFreerunListener(), this); } + //TODO Detect if ThemePark is found. if (getSConfig().getFile().getBoolean("DiscordWebhook.Enabled")) { String URL = getSConfig().getFile().getString("DiscordWebhook.WebhookURL"); if (URL != null) { diff --git a/src/main/lombok/nl/sbdeveloper/themeparkplus/api/PlusAPI.java b/src/main/lombok/nl/sbdeveloper/themeparkplus/api/PlusAPI.java index 8a9d029..f574d6b 100644 --- a/src/main/lombok/nl/sbdeveloper/themeparkplus/api/PlusAPI.java +++ b/src/main/lombok/nl/sbdeveloper/themeparkplus/api/PlusAPI.java @@ -1,7 +1,6 @@ package nl.sbdeveloper.themeparkplus.api; import de.tr7zw.changeme.nbtapi.NBTItem; -import nl.iobyte.themepark.api.attraction.Attraction; import nl.sbdeveloper.themeparkplus.ThemeParkPlus; import nl.sbdeveloper.themeparkplus.api.objects.Gate; import nl.sbdeveloper.themeparkplus.api.objects.MalfunctionReport; @@ -170,7 +169,7 @@ public class PlusAPI { * @return The ticket as ItemStack */ @Nullable - public static ItemStack getFastpassTicket(Attraction att) { + public static ItemStack getFastpassTicket(nl.iobyte.themepark.api.attraction.Attraction att) { String ticketName = ConfigUtil.makecolored(ThemeParkPlus.getSConfig().getFile().getString("Fastpass.Item.DisplayName")); ItemStack ticket = XMaterial.PAPER.parseItem(); diff --git a/src/main/lombok/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java b/src/main/lombok/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java index 9a0e2b2..067c48e 100644 --- a/src/main/lombok/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java +++ b/src/main/lombok/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java @@ -1,7 +1,5 @@ package nl.sbdeveloper.themeparkplus.commands; -import nl.iobyte.themepark.api.API; -import nl.iobyte.themepark.api.attraction.Attraction; import nl.sbdeveloper.themeparkplus.ThemeParkPlus; import nl.sbdeveloper.themeparkplus.api.PlusAPI; import nl.sbdeveloper.themeparkplus.api.enums.WalkingDirection; @@ -196,17 +194,19 @@ public class TPPCMD implements CommandExecutor { } private boolean giveFPTicketCommand(CommandSender sender, String[] args) { + //TODO Detect if ThemePark is found. + if (args.length == 2 && !(sender instanceof Player)) { sender.sendMessage(ConfigUtil.getMessage("General.NoPlayer")); return true; } - if (!API.isAttraction(args[1])) { + if (!nl.iobyte.themepark.api.API.isAttraction(args[1])) { sender.sendMessage(ConfigUtil.getMessage("Fastpass.UnknownRide", Collections.singletonMap("%ridename%", args[1]))); return true; } - Attraction att = API.getAttraction(args[1]); + nl.iobyte.themepark.api.attraction.Attraction att = nl.iobyte.themepark.api.API.getAttraction(args[1]); Player target; if (args.length == 3) { @@ -404,7 +404,7 @@ public class TPPCMD implements CommandExecutor { Bukkit.getScheduler().runTaskLaterAsynchronously(ThemeParkPlus.getInstance(), () -> cub.getBlocks().forEach(block -> { if (block.getType().name().contains("REDSTONE_LAMP")) Bukkit.getScheduler().runTask(ThemeParkPlus.getInstance(), () -> LGUtil.zetLampUit(block)); - }), secOn * 20); + }), secOn * 20L); if (ConfigUtil.sendConsole(sender)) sender.sendMessage(ConfigUtil.getMessage("Lamps.TurnedOnSec", Collections.singletonMap("%sec%", String.valueOf(secOn)))); } return true; diff --git a/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/MalfunctionListener.java b/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/MalfunctionListener.java index c09e865..c6db944 100644 --- a/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/MalfunctionListener.java +++ b/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/MalfunctionListener.java @@ -5,7 +5,6 @@ import nl.iobyte.themepark.api.attraction.Attraction; import nl.sbdeveloper.themeparkplus.ThemeParkPlus; import nl.sbdeveloper.themeparkplus.gui.MalfunctionGUI; import nl.sbdeveloper.themeparkplus.util.ConfigUtil; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.block.Sign; import org.bukkit.event.EventHandler; diff --git a/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/SignListeners.java b/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/SignListeners.java index 41ea2a1..ba125e0 100644 --- a/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/SignListeners.java +++ b/src/main/lombok/nl/sbdeveloper/themeparkplus/listeners/SignListeners.java @@ -41,6 +41,7 @@ public class SignListeners implements Listener { return; } + //TODO Detect if ThemePark is found. if (!API.isAttraction(lines[2])) { p.sendMessage(ConfigUtil.getMessage("Fastpass.UnknownRide", Collections.singletonMap("ridename", e.getLine(2)))); return;