|
20 | 20 |
|
21 | 21 | import dev.technici4n.moderndynamics.init.MdBlocks; |
22 | 22 | import dev.technici4n.moderndynamics.test.framework.MdGameTestHelper; |
23 | | -import java.util.List; |
24 | 23 | import net.minecraft.core.BlockPos; |
25 | 24 | import net.minecraft.core.Direction; |
26 | 25 | import net.minecraft.network.chat.Component; |
27 | | -import net.minecraft.world.item.Items; |
28 | 26 | import net.minecraft.world.level.block.Blocks; |
29 | | -import net.minecraft.world.level.block.RedstoneLampBlock; |
30 | 27 | import net.neoforged.neoforge.capabilities.Capabilities; |
31 | | -import net.neoforged.neoforge.transfer.item.ItemResource; |
32 | | -import net.neoforged.neoforge.transfer.transaction.Transaction; |
33 | 28 |
|
34 | 29 | public class MachineExtenderTest { |
35 | 30 | @MdGameTest |
@@ -58,53 +53,4 @@ public void machineExtenderNotForwardingFromBelow(MdGameTestHelper helper) { |
58 | 53 | }) |
59 | 54 | .thenSucceed(); |
60 | 55 | } |
61 | | - |
62 | | - @MdGameTest |
63 | | - public void machineExtenderForwardWeakSignal(MdGameTestHelper helper) { |
64 | | - var l0 = new BlockPos(4, 1, 4); |
65 | | - var l1 = l0.above(); |
66 | | - var l2 = l1.above(); |
67 | | - |
68 | | - helper.setBlock(l0, Blocks.HOPPER); |
69 | | - helper.setBlock(l0.north().below(), Blocks.STONE, Direction.SOUTH); |
70 | | - helper.setBlock(l0.north(), Blocks.COMPARATOR, Direction.SOUTH); |
71 | | - helper.setBlock(l0.north().north(), Blocks.REDSTONE_LAMP); |
72 | | - |
73 | | - helper.setBlock(l1, MdBlocks.MACHINE_EXTENDER.get()); |
74 | | - helper.setBlock(l1.east().below(), Blocks.STONE); |
75 | | - helper.setBlock(l1.east(), Blocks.COMPARATOR, Direction.WEST); |
76 | | - helper.setBlock(l1.east().east(), Blocks.REDSTONE_LAMP); |
77 | | - |
78 | | - helper.setBlock(l2, MdBlocks.MACHINE_EXTENDER.get()); |
79 | | - helper.setBlock(l2.west().below(), Blocks.STONE); |
80 | | - helper.setBlock(l2.west(), Blocks.COMPARATOR, Direction.EAST); |
81 | | - helper.setBlock(l2.west().west(), Blocks.REDSTONE_LAMP); |
82 | | - |
83 | | - var lamps = List.of(l0.north().north(), l1.east().east(), l2.west().west()); |
84 | | - var lampOff = Blocks.REDSTONE_LAMP.defaultBlockState(); |
85 | | - var lampOn = lampOff.setValue(RedstoneLampBlock.LIT, true); |
86 | | - |
87 | | - helper.startSequence() |
88 | | - .thenExecute(() -> { |
89 | | - for (var lamp : lamps) { |
90 | | - helper.assertBlockState(lamp, lampOff); |
91 | | - } |
92 | | - }) |
93 | | - .thenExecuteAfter(1, () -> { |
94 | | - // Fill the hopper |
95 | | - try (var tx = Transaction.openRoot()) { |
96 | | - var items = helper.getLevel().getCapability(Capabilities.Item.BLOCK, helper.absolutePos(l0), Direction.UP); |
97 | | - for (int i = 0; i < items.size(); i++) { |
98 | | - items.insert(ItemResource.of(Items.STICK), 64, tx); |
99 | | - } |
100 | | - tx.commit(); |
101 | | - } |
102 | | - }) |
103 | | - .thenExecuteAfter(5, () -> { |
104 | | - for (var lamp : lamps) { |
105 | | - helper.assertBlockState(lamp, lampOn); |
106 | | - } |
107 | | - }) |
108 | | - .thenSucceed(); |
109 | | - } |
110 | 56 | } |
0 commit comments