mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-26 15:06:42 +01:00
Add check to contraption disassembly code to not set NBT data for Sculk sensors/shriekers. Add check in same location to reset Sculk shriekers to their default block state after contraption disassembly. (Fixes #4677)
This commit is contained in:
parent
98952f9e48
commit
18bdec4b54
1 changed files with 11 additions and 1 deletions
|
@ -1006,7 +1006,7 @@ public abstract class Contraption {
|
||||||
if (disassembled)
|
if (disassembled)
|
||||||
return;
|
return;
|
||||||
disassembled = true;
|
disassembled = true;
|
||||||
|
|
||||||
for (boolean nonBrittles : Iterate.trueAndFalse) {
|
for (boolean nonBrittles : Iterate.trueAndFalse) {
|
||||||
for (StructureBlockInfo block : blocks.values()) {
|
for (StructureBlockInfo block : blocks.values()) {
|
||||||
if (nonBrittles == BlockMovementChecks.isBrittle(block.state))
|
if (nonBrittles == BlockMovementChecks.isBrittle(block.state))
|
||||||
|
@ -1047,6 +1047,10 @@ public abstract class Contraption {
|
||||||
if (state.hasProperty(SlidingDoorBlock.VISIBLE))
|
if (state.hasProperty(SlidingDoorBlock.VISIBLE))
|
||||||
state = state.setValue(SlidingDoorBlock.VISIBLE, !state.getValue(SlidingDoorBlock.OPEN))
|
state = state.setValue(SlidingDoorBlock.VISIBLE, !state.getValue(SlidingDoorBlock.OPEN))
|
||||||
.setValue(SlidingDoorBlock.POWERED, false);
|
.setValue(SlidingDoorBlock.POWERED, false);
|
||||||
|
// Stop Sculk shriekers from getting "stuck" if moved mid-shriek.
|
||||||
|
if(state.is(Blocks.SCULK_SHRIEKER)){
|
||||||
|
state = Blocks.SCULK_SHRIEKER.defaultBlockState();
|
||||||
|
}
|
||||||
|
|
||||||
world.setBlock(targetPos, state, Block.UPDATE_MOVE_BY_PISTON | Block.UPDATE_ALL);
|
world.setBlock(targetPos, state, Block.UPDATE_MOVE_BY_PISTON | Block.UPDATE_ALL);
|
||||||
|
|
||||||
|
@ -1060,6 +1064,12 @@ public abstract class Contraption {
|
||||||
BlockEntity tileEntity = world.getBlockEntity(targetPos);
|
BlockEntity tileEntity = world.getBlockEntity(targetPos);
|
||||||
|
|
||||||
CompoundTag tag = block.nbt;
|
CompoundTag tag = block.nbt;
|
||||||
|
|
||||||
|
// Temporary fix: Calling load(CompoundTag tag) on a Sculk sensor causes it to not react to vibrations.
|
||||||
|
if(state.is(Blocks.SCULK_SENSOR) || state.is(Blocks.SCULK_SHRIEKER)){
|
||||||
|
tag = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (tileEntity != null)
|
if (tileEntity != null)
|
||||||
tag = NBTProcessors.process(tileEntity, tag, false);
|
tag = NBTProcessors.process(tileEntity, tag, false);
|
||||||
if (tileEntity != null && tag != null) {
|
if (tileEntity != null && tag != null) {
|
||||||
|
|
Loading…
Reference in a new issue