From 53cdc27880829102b27b6057c5537dc3527540c4 Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Thu, 27 Feb 2020 19:25:17 +0100 Subject: [PATCH] Added bisected but not directional support --- pom.xml | 2 +- .../SBDeveloper/V10Lift/API/Objects/LiftBlock.java | 14 ++++++++++++++ .../nl/SBDeveloper/V10Lift/API/V10LiftAPI.java | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 38d93dc..a52d0bd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ nl.SBDeveloper V10Lift2 V10Lift - 0.5.7 + 0.5.8 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 0d87e26..9d1a107 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java @@ -134,6 +134,20 @@ public class LiftBlock implements Comparable { this.bisected = null; } + /* 1.13 liftblock (no dir but bisec) */ + public LiftBlock(String world, int x, int y, int z, Material mat, String bisected) { + this.world = world; + this.x = x; + this.y = y; + this.z = z; + this.mat = mat; + this.face = null; + this.data = 0; + this.signLines = null; + this.floor = null; + this.bisected = bisected; + } + @Override public int compareTo(@Nonnull LiftBlock lb) { int ret = Integer.compare(y, lb.y); diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java index cc44ed0..3896a83 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java @@ -207,6 +207,9 @@ public class V10LiftAPI { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) { Bukkit.getLogger().info("Block instanceof Dir 1.13"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block)); + } else if (block.getBlockData() instanceof org.bukkit.block.data.Bisected) { + Bukkit.getLogger().info("Block not instanceof Dir 1.13 but instanceof bisected"); + lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block), DirectionUtil.getBisected(block)); } else { Bukkit.getLogger().info("Block not instanceof Dir 1.13"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type); @@ -261,6 +264,9 @@ public class V10LiftAPI { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) { Bukkit.getLogger().info("Block instanceof Dir 1.13"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block)); + } else if (block.getBlockData() instanceof org.bukkit.block.data.Bisected) { + Bukkit.getLogger().info("Block not instanceof Dir 1.13 but instanceof bisected"); + lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block), DirectionUtil.getBisected(block)); } else { Bukkit.getLogger().info("Block not instanceof Dir 1.13"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type); @@ -315,6 +321,9 @@ public class V10LiftAPI { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) { Bukkit.getLogger().info("Block instanceof Dir 1.13"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block)); + } else if (block.getBlockData() instanceof org.bukkit.block.data.Bisected) { + Bukkit.getLogger().info("Block not instanceof Dir 1.13 but instanceof bisected"); + lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block), DirectionUtil.getBisected(block)); } else { Bukkit.getLogger().info("Block not instanceof Dir 1.13"); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type);