From 4f5ef2cee5f5b281c27de3169094d21571fb4b20 Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Wed, 7 Apr 2021 10:57:35 +0200 Subject: [PATCH] Fixed Javadoc building and removed instance of ACBM and FBM --- pom.xml | 4 +-- .../SBDeveloper/V10Lift/api/V10LiftAPI.java | 34 ++----------------- .../V10Lift/api/runnables/MoveLift.java | 5 +-- .../listeners/PlayerInteractListener.java | 3 +- 4 files changed, 10 insertions(+), 36 deletions(-) diff --git a/pom.xml b/pom.xml index afc6c95..93b172a 100644 --- a/pom.xml +++ b/pom.xml @@ -120,8 +120,8 @@ 3.2.0 - nl/SBDeveloper/V10Lift/API/*.java - nl/SBDeveloper/V10Lift/API/Objects/*.java + nl/SBDeveloper/V10Lift/api/*.java + nl/SBDeveloper/V10Lift/api/objects/*.java diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/api/V10LiftAPI.java b/src/main/lombok/nl/SBDeveloper/V10Lift/api/V10LiftAPI.java index 665f955..26d6445 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/api/V10LiftAPI.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/api/V10LiftAPI.java @@ -5,7 +5,6 @@ import nl.SBDeveloper.V10Lift.V10LiftPlugin; import nl.SBDeveloper.V10Lift.api.objects.*; import nl.SBDeveloper.V10Lift.api.runnables.DoorCloser; import nl.SBDeveloper.V10Lift.api.runnables.MoveLift; -import nl.SBDeveloper.V10Lift.managers.AntiCopyBlockManager; import nl.SBDeveloper.V10Lift.managers.DataManager; import nl.SBDeveloper.V10Lift.managers.ForbiddenBlockManager; import nl.SBDeveloper.V10Lift.sbutils.LocationSerializer; @@ -26,33 +25,6 @@ import java.util.*; /** The Main API class, for all the API methods */ public class V10LiftAPI { - /* Load managers... */ - private static ForbiddenBlockManager fbm; - private static AntiCopyBlockManager acbm; - - public V10LiftAPI() { - fbm = new ForbiddenBlockManager(); - acbm = new AntiCopyBlockManager(); - } - - /** - * Get the ForbiddenBlockManager, to check if a material is forbidden - * - * @return {@link ForbiddenBlockManager} - */ - public ForbiddenBlockManager getFBM() { - return fbm; - } - - /** - * Get the AntiCopyBlockManager, to check if we can copy a material - * - * @return {@link AntiCopyBlockManager} - */ - public AntiCopyBlockManager getACBM() { - return acbm; - } - /* Private API methods */ private void sortFloors(@Nonnull Lift lift) { ArrayList> as = new ArrayList<>(lift.getFloors().entrySet()); @@ -236,7 +208,7 @@ public class V10LiftAPI { * @return 0 if added, -2 if forbidden, -3 if already added */ public int addBlockToLift(@Nonnull Set blocks, @Nonnull LiftBlock block) { - if (getFBM().isForbidden(block.getMat())) return -2; + if (ForbiddenBlockManager.isForbidden(block.getMat())) return -2; if (blocks.contains(block)) return -3; blocks.add(block); return 0; @@ -310,7 +282,7 @@ public class V10LiftAPI { public int switchBlockAtLift(TreeSet blocks, Block block) { if (blocks == null || block == null) return -1; Material type = block.getType(); - if (getFBM().isForbidden(type)) return -2; + if (ForbiddenBlockManager.isForbidden(type)) return -2; LiftBlock lb; if (XMaterial.isNewVersion()) { if (type.toString().contains("SIGN")) { @@ -906,7 +878,7 @@ public class V10LiftAPI { Block block = world.getBlockAt(x, minY, z); if (isRope(block)) return -3; Material mat = block.getType(); - if (getFBM().isForbidden(mat)) return -4; + if (ForbiddenBlockManager.isForbidden(mat)) return -4; for (int i = minY + 1; i <= maxY; i++) { block = world.getBlockAt(x, i, z); diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/api/runnables/MoveLift.java b/src/main/lombok/nl/SBDeveloper/V10Lift/api/runnables/MoveLift.java index 0e90219..148a7ec 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/api/runnables/MoveLift.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/api/runnables/MoveLift.java @@ -4,6 +4,7 @@ import com.cryptomorin.xseries.XMaterial; import com.cryptomorin.xseries.XSound; import nl.SBDeveloper.V10Lift.V10LiftPlugin; import nl.SBDeveloper.V10Lift.api.objects.*; +import nl.SBDeveloper.V10Lift.managers.AntiCopyBlockManager; import nl.SBDeveloper.V10Lift.managers.DataManager; import nl.SBDeveloper.V10Lift.sbutils.LocationSerializer; import nl.SBDeveloper.V10Lift.utils.ConfigUtil; @@ -176,7 +177,7 @@ public class MoveLift implements Runnable { iter = lift.getBlocks().iterator(); while (iter.hasNext()) { lb = iter.next(); - if (V10LiftPlugin.getAPI().getACBM().isAntiCopy(lb.getMat())) { + if (AntiCopyBlockManager.isAntiCopy(lb.getMat())) { tb.add(lb); iter.remove(); block = Objects.requireNonNull(Bukkit.getWorld(lb.getWorld()), "World is null at MoveLift").getBlockAt(lb.getX(), lb.getY(), lb.getZ()); @@ -322,7 +323,7 @@ public class MoveLift implements Runnable { iter = lift.getBlocks().iterator(); while (iter.hasNext()) { lb = iter.next(); - if (V10LiftPlugin.getAPI().getACBM().isAntiCopy(lb.getMat())) { + if (AntiCopyBlockManager.isAntiCopy(lb.getMat())) { tb.add(lb); iter.remove(); block = Objects.requireNonNull(Bukkit.getWorld(lb.getWorld()), "World is null at MoveLift").getBlockAt(lb.getX(), lb.getY(), lb.getZ()); diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/listeners/PlayerInteractListener.java b/src/main/lombok/nl/SBDeveloper/V10Lift/listeners/PlayerInteractListener.java index f3960a3..b02cc89 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/listeners/PlayerInteractListener.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/listeners/PlayerInteractListener.java @@ -6,6 +6,7 @@ import nl.SBDeveloper.V10Lift.api.objects.Floor; import nl.SBDeveloper.V10Lift.api.objects.Lift; import nl.SBDeveloper.V10Lift.api.objects.LiftBlock; import nl.SBDeveloper.V10Lift.managers.DataManager; +import nl.SBDeveloper.V10Lift.managers.ForbiddenBlockManager; import nl.SBDeveloper.V10Lift.managers.VaultManager; import nl.SBDeveloper.V10Lift.utils.ConfigUtil; import nl.SBDeveloper.V10Lift.utils.DoorUtil; @@ -276,7 +277,7 @@ public class PlayerInteractListener implements Listener { if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return; e.setCancelled(true); Block block = e.getClickedBlock(); - if (V10LiftPlugin.getAPI().getFBM().isForbidden(block.getType())) { + if (ForbiddenBlockManager.isForbidden(block.getType())) { ConfigUtil.sendMessage(e.getPlayer(), "Door.BlacklistedMaterial", Collections.singletonMap("%Name%", e.getClickedBlock().getType().toString().toLowerCase())); return; }