diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java index 806c8b4..09abc12 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java @@ -9,7 +9,6 @@ import org.bukkit.block.BlockFace; import javax.annotation.Nonnull; import java.util.Arrays; import java.util.Map; -import java.util.Objects; @NoArgsConstructor public class LiftBlock implements Comparable { @@ -31,7 +30,7 @@ public class LiftBlock implements Comparable { @Getter @Setter private boolean active = false; //Only used for chests - public Map[] serializedItemStacks = null; + public Map[] serializedItemStacks = null; /* Floor based liftblock, no material */ public LiftBlock(String world, int x, int y, int z, String floor) { diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java index b6a26c4..b7c85a0 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java @@ -4,8 +4,6 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import java.util.Objects; - @Getter @Setter @NoArgsConstructor public class LiftSign { private String world; 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 cb69c22..7f6bd81 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Runnables/MoveLift.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Runnables/MoveLift.java @@ -413,9 +413,7 @@ public class MoveLift implements Runnable { block = world.getBlockAt(rope.getX(), rope.getCurrently(), rope.getZ()); block.setType(rope.getType()); if (XMaterial.isNewVersion()) { - org.bukkit.block.data.Directional data = (org.bukkit.block.data.Directional) block.getBlockData(); - data.setFacing(rope.getFace()); - block.setBlockData(data); + DirectionUtil.setDirection(block, rope.getFace()); } else { BlockState state = block.getState(); org.bukkit.material.Ladder ladder = new org.bukkit.material.Ladder(rope.getType()); @@ -430,9 +428,7 @@ public class MoveLift implements Runnable { block = world.getBlockAt(rope.getX(), rope.getCurrently(), rope.getZ()); block.setType(rope.getType()); if (XMaterial.isNewVersion()) { - org.bukkit.block.data.Directional data = (org.bukkit.block.data.Directional) block.getBlockData(); - data.setFacing(rope.getFace()); - block.setBlockData(data); + DirectionUtil.setDirection(block, rope.getFace()); } else { BlockState state = block.getState(); org.bukkit.material.Ladder ladder = new org.bukkit.material.Ladder(rope.getType()); diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java index b955ab5..8d1c440 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java @@ -857,9 +857,7 @@ public class V10LiftAPI { BlockFace face; if (XMaterial.isNewVersion()) { - org.bukkit.block.data.type.Ladder ladder = (org.bukkit.block.data.type.Ladder) block.getBlockData(); - Bukkit.getLogger().info(ladder.getFacing().toString()); - face = ladder.getFacing(); + face = DirectionUtil.getDirection(block); } else { BlockState state = block.getState(); org.bukkit.material.Ladder ladder = (org.bukkit.material.Ladder) state.getData(); diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/Utils/DirectionUtil.java b/src/main/lombok/nl/SBDeveloper/V10Lift/Utils/DirectionUtil.java index 231e03c..34d2ebf 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/Utils/DirectionUtil.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/Utils/DirectionUtil.java @@ -2,7 +2,6 @@ package nl.SBDeveloper.V10Lift.Utils; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.block.data.Directional; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -12,8 +11,8 @@ public class DirectionUtil { @Nullable public static BlockFace getDirection(@Nonnull Block block) { if (!XMaterial.isNewVersion()) return null; - if (block.getBlockData() instanceof Directional) { - Directional dir = (Directional) block.getBlockData(); + if (block.getBlockData() instanceof org.bukkit.block.data.Directional) { + org.bukkit.block.data.Directional dir = (org.bukkit.block.data.Directional) block.getBlockData(); return dir.getFacing(); } return null; @@ -21,9 +20,9 @@ public class DirectionUtil { public static void setDirection(@Nonnull Block block, BlockFace blockFace) { if (!XMaterial.isNewVersion()) return; - if (blockFace != null && block.getBlockData() instanceof Directional) { + if (blockFace != null && block.getBlockData() instanceof org.bukkit.block.data.Directional) { org.bukkit.block.data.BlockData bd = block.getBlockData(); - Directional dir = (Directional) bd; + org.bukkit.block.data.Directional dir = (org.bukkit.block.data.Directional) bd; dir.setFacing(blockFace); block.setBlockData(bd); }