mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-27 05:18:08 +01:00
Merge pull request #6088 from cakeGit/patch-2
Added station blockstate check
This commit is contained in:
commit
5fc2153d52
1 changed files with 5 additions and 1 deletions
|
@ -288,7 +288,7 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab
|
|||
BlockPos up = new BlockPos(track.getUpNormal(level, pos, state));
|
||||
BlockPos down = new BlockPos(track.getUpNormal(level, pos, state).scale(-1));
|
||||
int bogeyOffset = pos.distManhattan(edgePoint.getGlobalPosition()) - 1;
|
||||
|
||||
|
||||
if (!isValidBogeyOffset(bogeyOffset)) {
|
||||
for (boolean upsideDown : Iterate.falseAndTrue) {
|
||||
for (int i = -1; i <= 1; i++) {
|
||||
|
@ -364,6 +364,10 @@ public class StationBlockEntity extends SmartBlockEntity implements ITransformab
|
|||
if (!tryEnterAssemblyMode())
|
||||
return false;
|
||||
|
||||
//Check the station wasn't destroyed
|
||||
if (!(level.getBlockState(worldPosition).getBlock() instanceof StationBlock))
|
||||
return true;
|
||||
|
||||
BlockState newState = getBlockState().setValue(StationBlock.ASSEMBLING, true);
|
||||
level.setBlock(getBlockPos(), newState, 3);
|
||||
refreshBlockState();
|
||||
|
|
Loading…
Reference in a new issue