Fixed Bisected issues

This commit is contained in:
stijnb1234 2020-02-08 16:47:25 +01:00
parent b303e3b1be
commit 2146beba9d
3 changed files with 2 additions and 20 deletions

View file

@ -6,7 +6,6 @@ import lombok.Setter;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import java.lang.reflect.Field;
import java.util.Objects; import java.util.Objects;
@Getter @Setter @NoArgsConstructor @Getter @Setter @NoArgsConstructor

View file

@ -7,7 +7,6 @@ import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import java.lang.reflect.Field;
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;

View file

@ -174,18 +174,10 @@ public class V10LiftAPI {
Material type = block.getType(); Material type = block.getType();
LiftBlock lb; LiftBlock lb;
if (XMaterial.isNewVersion()) { 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")) { if (type.toString().contains("SIGN")) {
Bukkit.getLogger().info("Block instanceof Dir 1.13 & is 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()); 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"); 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)); 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) { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) {
@ -236,18 +228,10 @@ public class V10LiftAPI {
Material type = block.getType(); Material type = block.getType();
LiftBlock lb; LiftBlock lb;
if (XMaterial.isNewVersion()) { 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")) { if (type.toString().contains("SIGN")) {
Bukkit.getLogger().info("Block instanceof Dir 1.13 & is 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()); 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"); 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)); 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) { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) {