Added bisected but not directional support

This commit is contained in:
stijnb1234 2020-02-27 19:25:17 +01:00
parent 0a57539d50
commit 53cdc27880
3 changed files with 24 additions and 1 deletions

View file

@ -5,7 +5,7 @@
<groupId>nl.SBDeveloper</groupId> <groupId>nl.SBDeveloper</groupId>
<artifactId>V10Lift2</artifactId> <artifactId>V10Lift2</artifactId>
<name>V10Lift</name> <name>V10Lift</name>
<version>0.5.7</version> <version>0.5.8</version>
<distributionManagement> <distributionManagement>
<repository> <repository>

View file

@ -134,6 +134,20 @@ public class LiftBlock implements Comparable<LiftBlock> {
this.bisected = null; 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 @Override
public int compareTo(@Nonnull LiftBlock lb) { public int compareTo(@Nonnull LiftBlock lb) {
int ret = Integer.compare(y, lb.y); int ret = Integer.compare(y, lb.y);

View file

@ -207,6 +207,9 @@ public class V10LiftAPI {
} else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) {
Bukkit.getLogger().info("Block instanceof Dir 1.13"); Bukkit.getLogger().info("Block instanceof Dir 1.13");
lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block)); 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 { } else {
Bukkit.getLogger().info("Block not instanceof Dir 1.13"); Bukkit.getLogger().info("Block not instanceof Dir 1.13");
lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type); 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) { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) {
Bukkit.getLogger().info("Block instanceof Dir 1.13"); Bukkit.getLogger().info("Block instanceof Dir 1.13");
lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block)); 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 { } else {
Bukkit.getLogger().info("Block not instanceof Dir 1.13"); Bukkit.getLogger().info("Block not instanceof Dir 1.13");
lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type); 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) { } else if (block.getBlockData() instanceof org.bukkit.block.data.Directional) {
Bukkit.getLogger().info("Block instanceof Dir 1.13"); Bukkit.getLogger().info("Block instanceof Dir 1.13");
lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type, DirectionUtil.getDirection(block)); 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 { } else {
Bukkit.getLogger().info("Block not instanceof Dir 1.13"); Bukkit.getLogger().info("Block not instanceof Dir 1.13");
lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type); lb = new LiftBlock(block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), type);