|
| 1 | +diff --git a/build.gradle b/build.gradle |
| 2 | +index c66075c7..d2d3e930 100644 |
| 3 | +--- a/build.gradle |
| 4 | ++++ b/build.gradle |
| 5 | +@@ -171,6 +171,7 @@ minecraft { |
| 6 | + property 'forge.enabledGameTestNamespaces', 'advancedperipherals,advancedperipheralstest' |
| 7 | + property 'advancedperipheralstest.sources', file("src/testMod/resources/data/advancedperipheralstest").absolutePath |
| 8 | + |
| 9 | ++ args "--mixin.config=ccgametest.mixins.json" |
| 10 | + args "--mixin.config=advancedperipheralstest.mixins.json" |
| 11 | + |
| 12 | + mods { |
| 13 | +@@ -202,6 +203,7 @@ minecraft { |
| 14 | + property 'forge.enabledGameTestNamespaces', 'advancedperipherals,advancedperipheralstest' |
| 15 | + property 'advancedperipheralstest.sources', file("src/testMod/resources/data/advancedperipheralstest").absolutePath |
| 16 | + |
| 17 | ++ args "--mixin.config=ccgametest.mixins.json" |
| 18 | + args "--mixin.config=advancedperipheralstest.mixins.json" |
| 19 | + parent runs.server |
| 20 | + |
| 21 | +diff --git a/src/testMod/java/de/srendi/advancedperipherals/test/mixin/RsBaseBlockMixin.java b/src/testMod/java/de/srendi/advancedperipherals/test/mixin/RsBaseBlockMixin.java |
| 22 | +new file mode 100644 |
| 23 | +index 00000000..eaef15c4 |
| 24 | +--- /dev/null |
| 25 | ++++ b/src/testMod/java/de/srendi/advancedperipherals/test/mixin/RsBaseBlockMixin.java |
| 26 | +@@ -0,0 +1,35 @@ |
| 27 | ++package de.srendi.advancedperipherals.test.mixin; |
| 28 | ++ |
| 29 | ++import com.refinedmods.refinedstorage.block.BaseBlock; |
| 30 | ++import com.refinedmods.refinedstorage.block.BlockDirection; |
| 31 | ++import net.minecraft.core.Direction; |
| 32 | ++import net.minecraft.world.level.block.Rotation; |
| 33 | ++import net.minecraft.world.level.block.state.BlockState; |
| 34 | ++import org.spongepowered.asm.mixin.Mixin; |
| 35 | ++import org.spongepowered.asm.mixin.Overwrite; |
| 36 | ++import org.spongepowered.asm.mixin.Shadow; |
| 37 | ++ |
| 38 | ++@Mixin(BaseBlock.class) |
| 39 | ++public class RsBaseBlockMixin { |
| 40 | ++ |
| 41 | ++ @Shadow |
| 42 | ++ public BlockDirection getDirection() { |
| 43 | ++ return null; |
| 44 | ++ } |
| 45 | ++ |
| 46 | ++ @Overwrite |
| 47 | ++ public BlockState rotate(BlockState state, Rotation rot) { |
| 48 | ++ BlockDirection dir = this.getDirection(); |
| 49 | ++ if (dir == BlockDirection.NONE) return state; |
| 50 | ++ |
| 51 | ++ Direction newDirection = switch (rot) { |
| 52 | ++ case NONE -> state.getValue(dir.getProperty()); |
| 53 | ++ case CLOCKWISE_90 -> dir.cycle(state.getValue(dir.getProperty()).getClockWise().getClockWise()); |
| 54 | ++ case CLOCKWISE_180 -> dir.cycle(state.getValue(dir.getProperty()).getClockWise().getClockWise().getClockWise()); |
| 55 | ++ case COUNTERCLOCKWISE_90 -> dir.cycle(state.getValue(dir.getProperty())); |
| 56 | ++ }; |
| 57 | ++ |
| 58 | ++ return state.setValue(dir.getProperty(), newDirection); |
| 59 | ++ } |
| 60 | ++ |
| 61 | ++} |
| 62 | +diff --git a/src/testMod/resources/advancedperipheralstest.mixins.json b/src/testMod/resources/advancedperipheralstest.mixins.json |
| 63 | +index 76ac7799..782eaa71 100644 |
| 64 | +--- a/src/testMod/resources/advancedperipheralstest.mixins.json |
| 65 | ++++ b/src/testMod/resources/advancedperipheralstest.mixins.json |
| 66 | +@@ -1,16 +1,12 @@ |
| 67 | + { |
| 68 | + "required": true, |
| 69 | +- "package": "dan200.computercraft.mixin.gametest", |
| 70 | ++ "package": "de.srendi.advancedperipherals.test.mixin", |
| 71 | + "minVersion": "0.8", |
| 72 | + "compatibilityLevel": "JAVA_17", |
| 73 | + "injectors": { |
| 74 | + "defaultRequire": 1 |
| 75 | + }, |
| 76 | + "mixins": [ |
| 77 | +- "GameTestHelperAccessor", |
| 78 | +- "GameTestInfoAccessor", |
| 79 | +- "GameTestSequenceAccessor", |
| 80 | +- "GameTestSequenceMixin", |
| 81 | +- "TestCommandAccessor" |
| 82 | ++ "RsBaseBlockMixin" |
| 83 | + ] |
| 84 | + } |
| 85 | +diff --git a/src/testMod/resources/ccgametest.mixins.json b/src/testMod/resources/ccgametest.mixins.json |
| 86 | +new file mode 100644 |
| 87 | +index 00000000..76ac7799 |
| 88 | +--- /dev/null |
| 89 | ++++ b/src/testMod/resources/ccgametest.mixins.json |
| 90 | +@@ -0,0 +1,16 @@ |
| 91 | ++{ |
| 92 | ++ "required": true, |
| 93 | ++ "package": "dan200.computercraft.mixin.gametest", |
| 94 | ++ "minVersion": "0.8", |
| 95 | ++ "compatibilityLevel": "JAVA_17", |
| 96 | ++ "injectors": { |
| 97 | ++ "defaultRequire": 1 |
| 98 | ++ }, |
| 99 | ++ "mixins": [ |
| 100 | ++ "GameTestHelperAccessor", |
| 101 | ++ "GameTestInfoAccessor", |
| 102 | ++ "GameTestSequenceAccessor", |
| 103 | ++ "GameTestSequenceMixin", |
| 104 | ++ "TestCommandAccessor" |
| 105 | ++ ] |
| 106 | ++} |
0 commit comments