Implement new galaxy api that should stop block connecting after it has been rotated by this plugin

This commit is contained in:
Teriuihi 2023-07-09 00:26:52 +02:00
parent ce51eb2a33
commit 3dfc2109a4
3 changed files with 8 additions and 7 deletions

View File

@ -45,5 +45,7 @@ tasks {
} }
dependencies { dependencies {
compileOnly("com.alttd:Galaxy-API:1.19-R0.1-SNAPSHOT") compileOnly("com.alttd:Galaxy-API:1.20.1-R0.1-SNAPSHOT") {
isChanging = true
}
} }

View File

@ -4,7 +4,6 @@ dependencyResolutionManagement {
repositories { repositories {
mavenLocal() mavenLocal()
mavenCentral() mavenCentral()
maven("https://dev.alttd.com/snapshots") // Altitude - Galaxy
maven("https://repo.destro.xyz/snapshots") // Altitude - Galaxy maven("https://repo.destro.xyz/snapshots") // Altitude - Galaxy
maven("'https://jitpack.io'") // Vault maven("'https://jitpack.io'") // Vault
} }

View File

@ -120,7 +120,7 @@ public class RotateBlockEvent implements Listener {
Set<BlockFace> faces = fence.getFaces(); Set<BlockFace> faces = fence.getFaces();
fence.setFace(blockFace, !faces.contains(blockFace)); fence.setFace(blockFace, !faces.contains(blockFace));
block.setBlockData(fence); block.setBlockAndForget(fence);
} }
private void toggleWall(Block block, BlockFace blockFace, Player player, boolean leftClick) { private void toggleWall(Block block, BlockFace blockFace, Player player, boolean leftClick) {
@ -136,7 +136,7 @@ public class RotateBlockEvent implements Listener {
if (player.isSneaking()) { if (player.isSneaking()) {
VALID_FOUR_STATES.forEach(face -> wall.setHeight(face, Wall.Height.NONE)); VALID_FOUR_STATES.forEach(face -> wall.setHeight(face, Wall.Height.NONE));
wall.setUp(true); wall.setUp(true);
block.setBlockData(wall); block.setBlockAndForget(wall);
return; return;
} }
@ -144,7 +144,7 @@ public class RotateBlockEvent implements Listener {
if (wallHasNoFaces(wall)) if (wallHasNoFaces(wall))
return; return;
wall.setUp(!wall.isUp()); wall.setUp(!wall.isUp());
block.setBlockData(wall); block.setBlockAndForget(wall);
return; return;
} }
@ -160,7 +160,7 @@ public class RotateBlockEvent implements Listener {
if (!wall.isUp() && wallHasNoFaces(wall)) { if (!wall.isUp() && wallHasNoFaces(wall)) {
wall.setUp(true); wall.setUp(true);
} }
block.setBlockData(wall); block.setBlockAndForget(wall);
} }
private boolean wallHasNoFaces(Wall wall) { private boolean wallHasNoFaces(Wall wall) {
@ -186,7 +186,7 @@ public class RotateBlockEvent implements Listener {
nextRotation = getPreviousRotation(stairs); nextRotation = getPreviousRotation(stairs);
else else
nextRotation = getNextRotation(stairs); nextRotation = getNextRotation(stairs);
block.setBlockData(nextRotation); block.setBlockAndForget(nextRotation);
} }
private Stairs getNextRotation(Stairs stairs) { private Stairs getNextRotation(Stairs stairs) {