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 {
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 {
mavenLocal()
mavenCentral()
maven("https://dev.alttd.com/snapshots") // Altitude - Galaxy
maven("https://repo.destro.xyz/snapshots") // Altitude - Galaxy
maven("'https://jitpack.io'") // Vault
}

View File

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