|
12 | 12 | import com.simibubi.create.content.trains.station.GlobalStation; |
13 | 13 | import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour; |
14 | 14 | import com.simibubi.create.foundation.utility.animation.LerpedFloat; |
| 15 | +import net.adeptstack.Blocks.Doors.SlidingDoor.TrainSlidingDoorBlock; |
15 | 16 | import net.adeptstack.Core.Utils.TrainSlidingDoorProperties; |
16 | 17 | import net.adeptstack.Blocks.Doors.SlidingDoor.TrainSlidingDoorBlockEntity; |
17 | 18 | import net.adeptstack.registry.TrainUtilitiesBuilderTransformers; |
|
25 | 26 | import net.minecraft.world.level.block.DoorBlock; |
26 | 27 | import net.minecraft.world.level.block.entity.BlockEntity; |
27 | 28 | import net.minecraft.world.level.block.state.BlockState; |
| 29 | +import net.minecraft.world.level.block.state.properties.DoorHingeSide; |
28 | 30 | import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; |
29 | 31 | import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; |
30 | 32 | import net.minecraft.world.phys.Vec3; |
@@ -76,16 +78,32 @@ public void run() { |
76 | 78 | } |
77 | 79 | }; |
78 | 80 |
|
79 | | - if (wasSettled && !sdbe.animation.settled() && !open) { |
80 | | - context.world.playLocalSound(context.position.x, context.position.y, context.position.z, |
81 | | - tsdp.GetClose(), SoundSource.BLOCKS, 1f, 1, false); |
82 | | - } |
| 81 | + if (TrainSlidingDoorBlock.isDoubleDoor(structureBlockInfo.state().getValue(TrainSlidingDoorBlock.HINGE), context.localPos, context.state.getValue(TrainSlidingDoorBlock.FACING), context)) { |
| 82 | + if (structureBlockInfo.state().getValue(TrainSlidingDoorBlock.HINGE) == DoorHingeSide.RIGHT) { |
| 83 | + if (wasSettled && !sdbe.animation.settled() && !open) { |
| 84 | + context.world.playLocalSound(context.position.x, context.position.y, context.position.z, |
| 85 | + tsdp.GetClose(), SoundSource.BLOCKS, 1f, 1, false); |
| 86 | + } |
83 | 87 |
|
84 | | - if (wasSettled && !sdbe.animation.settled() && open) { |
85 | | - context.world.playLocalSound(context.position.x, context.position.y, context.position.z, |
86 | | - tsdp.GetOpen(), SoundSource.BLOCKS, 1f, 1, false); |
87 | | - //Timer t = new Timer(); |
88 | | - //t.schedule(closeTask, 6000); |
| 88 | + if (wasSettled && !sdbe.animation.settled() && open) { |
| 89 | + context.world.playLocalSound(context.position.x, context.position.y, context.position.z, |
| 90 | + tsdp.GetOpen(), SoundSource.BLOCKS, 1f, 1, false); |
| 91 | + //Timer t = new Timer(); |
| 92 | + //t.schedule(closeTask, 6000); |
| 93 | + } |
| 94 | + } |
| 95 | + } else { |
| 96 | + if (wasSettled && !sdbe.animation.settled() && !open) { |
| 97 | + context.world.playLocalSound(context.position.x, context.position.y, context.position.z, |
| 98 | + tsdp.GetClose(), SoundSource.BLOCKS, 1f, 1, false); |
| 99 | + } |
| 100 | + |
| 101 | + if (wasSettled && !sdbe.animation.settled() && open) { |
| 102 | + context.world.playLocalSound(context.position.x, context.position.y, context.position.z, |
| 103 | + tsdp.GetOpen(), SoundSource.BLOCKS, 1f, 1, false); |
| 104 | + //Timer t = new Timer(); |
| 105 | + //t.schedule(closeTask, 6000); |
| 106 | + } |
89 | 107 | } |
90 | 108 | } |
91 | 109 |
|
|
0 commit comments