From 2146beba9da0e93d8dc341a159e62decaf2772d2 Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Sat, 8 Feb 2020 16:47:25 +0100 Subject: [PATCH] Fixed Bisected issues --- .../V10Lift/API/Objects/LiftRope.java | 1 - .../V10Lift/API/Objects/V10Entity.java | 1 - .../SBDeveloper/V10Lift/API/V10LiftAPI.java | 20 ++----------------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftRope.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftRope.java index 5add956..c4f076f 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftRope.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftRope.java @@ -6,7 +6,6 @@ import lombok.Setter; import org.bukkit.Material; import org.bukkit.block.BlockFace; -import java.lang.reflect.Field; import java.util.Objects; @Getter @Setter @NoArgsConstructor diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/V10Entity.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/V10Entity.java index f3be72a..90daf2b 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/V10Entity.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/V10Entity.java @@ -7,7 +7,6 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Entity; -import java.lang.reflect.Field; import java.util.Objects; import java.util.UUID; diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java index 3d161fc..b955ab5 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java @@ -174,18 +174,10 @@ public class V10LiftAPI { Material type = block.getType(); LiftBlock lb; if (XMaterial.isNewVersion()) { - Class biClass; - try { - biClass = Class.forName("org.bukkit.block.data.Bisected"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - return -1; - } - if (type.toString().contains("SIGN")) { Bukkit.getLogger().info("Block instanceof Dir 1.13 & is sign"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block), ((Sign) block.getState()).getLines()); - } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional && block.getBlockData().getClass().isInstance(biClass)) { + } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional && block.getBlockData() instanceof org.bukkit.block.data.Bisected) { Bukkit.getLogger().info("Block instanceof Dir 1.13 & bisected"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block), DirectionUtil.getBisected(block)); } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) { @@ -236,18 +228,10 @@ public class V10LiftAPI { Material type = block.getType(); LiftBlock lb; if (XMaterial.isNewVersion()) { - Class biClass; - try { - biClass = Class.forName("org.bukkit.block.data.Bisected"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - return -1; - } - if (type.toString().contains("SIGN")) { Bukkit.getLogger().info("Block instanceof Dir 1.13 & is sign"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block), ((Sign) block.getState()).getLines()); - } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional && block.getBlockData().getClass().isInstance(biClass)) { + } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional && block.getBlockData() instanceof org.bukkit.block.data.Bisected) { Bukkit.getLogger().info("Block instanceof Dir 1.13 & bisected"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block), DirectionUtil.getBisected(block)); } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) {