Fixed some rotation issues
This commit is contained in:
parent
c61063ebdf
commit
211b331d4d
3 changed files with 15 additions and 13 deletions
|
@ -20,7 +20,7 @@ public class LiftBlock implements Comparable<LiftBlock> {
|
|||
@Getter private final Material mat;
|
||||
@Getter private final byte data;
|
||||
@Getter private final BlockFace face;
|
||||
@Getter private final Object bisected;
|
||||
@Getter private final String bisected;
|
||||
@Getter private final String[] signLines;
|
||||
|
||||
//Only used for inputs!
|
||||
|
@ -105,7 +105,7 @@ public class LiftBlock implements Comparable<LiftBlock> {
|
|||
}
|
||||
|
||||
/* 1.13 liftblock (dir & bisec) */
|
||||
public LiftBlock(String world, int x, int y, int z, Material mat, BlockFace face, Object bisected) {
|
||||
public LiftBlock(String world, int x, int y, int z, Material mat, BlockFace face, String bisected) {
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
|
|
@ -30,19 +30,27 @@ public class DirectionUtil {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public static Object getBisected(@Nonnull Block block) {
|
||||
public static String getBisected(@Nonnull Block block) {
|
||||
if (block.getBlockData() instanceof Bisected) {
|
||||
Bisected bis = (Bisected) block.getBlockData();
|
||||
return bis.getHalf();
|
||||
return bis.getHalf().toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void setBisected(@Nonnull Block block, Object bisected) {
|
||||
if (bisected != null && block.getBlockData() instanceof Bisected && bisected instanceof Bisected.Half) {
|
||||
public static void setBisected(@Nonnull Block block, String bisected) {
|
||||
if (bisected != null && block.getBlockData() instanceof Bisected) {
|
||||
|
||||
Bisected.Half half;
|
||||
try {
|
||||
half = Bisected.Half.valueOf(bisected);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockData bd = block.getBlockData();
|
||||
Bisected bis = (Bisected) bd;
|
||||
bis.setHalf((Bisected.Half) bisected);
|
||||
bis.setHalf(half);
|
||||
block.setBlockData(bd);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue