Fixed some rotation issues

This commit is contained in:
stijnb1234 2020-02-06 17:56:27 +01:00
parent c61063ebdf
commit 211b331d4d
3 changed files with 15 additions and 13 deletions

View file

@ -90,12 +90,6 @@
<version>1.18.10</version> <version>1.18.10</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Needed for 1.15, becuase that version is wrong -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies> </dependencies>

View file

@ -20,7 +20,7 @@ public class LiftBlock implements Comparable<LiftBlock> {
@Getter private final Material mat; @Getter private final Material mat;
@Getter private final byte data; @Getter private final byte data;
@Getter private final BlockFace face; @Getter private final BlockFace face;
@Getter private final Object bisected; @Getter private final String bisected;
@Getter private final String[] signLines; @Getter private final String[] signLines;
//Only used for inputs! //Only used for inputs!
@ -105,7 +105,7 @@ public class LiftBlock implements Comparable<LiftBlock> {
} }
/* 1.13 liftblock (dir & bisec) */ /* 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.world = world;
this.x = x; this.x = x;
this.y = y; this.y = y;

View file

@ -30,19 +30,27 @@ public class DirectionUtil {
} }
@Nullable @Nullable
public static Object getBisected(@Nonnull Block block) { public static String getBisected(@Nonnull Block block) {
if (block.getBlockData() instanceof Bisected) { if (block.getBlockData() instanceof Bisected) {
Bisected bis = (Bisected) block.getBlockData(); Bisected bis = (Bisected) block.getBlockData();
return bis.getHalf(); return bis.getHalf().toString();
} }
return null; return null;
} }
public static void setBisected(@Nonnull Block block, Object bisected) { public static void setBisected(@Nonnull Block block, String bisected) {
if (bisected != null && block.getBlockData() instanceof Bisected && bisected instanceof Bisected.Half) { if (bisected != null && block.getBlockData() instanceof Bisected) {
Bisected.Half half;
try {
half = Bisected.Half.valueOf(bisected);
} catch (IllegalArgumentException e) {
return;
}
BlockData bd = block.getBlockData(); BlockData bd = block.getBlockData();
Bisected bis = (Bisected) bd; Bisected bis = (Bisected) bd;
bis.setHalf((Bisected.Half) bisected); bis.setHalf(half);
block.setBlockData(bd); block.setBlockData(bd);
} }
} }