Fixed some rotation issues
This commit is contained in:
parent
c61063ebdf
commit
211b331d4d
3 changed files with 15 additions and 13 deletions
6
pom.xml
6
pom.xml
|
@ -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>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue