|
1 | 1 | package io.github.betterthanupdates.apron.stapi.mixin.client; |
2 | 2 |
|
| 3 | +import com.bawnorton.mixinsquared.TargetHandler; |
3 | 4 | import com.llamalad7.mixinextras.sugar.Local; |
4 | 5 | import org.spongepowered.asm.mixin.Mixin; |
5 | 6 | import org.spongepowered.asm.mixin.injection.At; |
|
12 | 13 |
|
13 | 14 | @Mixin(BlockRenderManager.class) |
14 | 15 | public class BlockRendererMixin { |
| 16 | + @TargetHandler( |
| 17 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.BlockRenderManagerMixin", |
| 18 | + name = "stationapi_block_captureTexture", |
| 19 | + prefix = "handler" |
| 20 | + ) |
15 | 21 | @ModifyVariable( |
16 | | - method = {"renderBottomFace", "renderTopFace", "renderEastFace", "renderWestFace", "renderNorthFace", "renderSouthFace"}, |
17 | | - at = @At( |
18 | | - value = "FIELD", |
19 | | - target = "Lnet/minecraft/client/render/block/BlockRenderManager;textureOverride:I", |
20 | | - opcode = 180, |
21 | | - ordinal = 1, |
22 | | - shift = At.Shift.BY, |
23 | | - by = 3 |
24 | | - ), |
| 22 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
25 | 23 | argsOnly = true |
26 | 24 | ) |
27 | | - private int apron$stapi$fixTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
| 25 | + private int apron$stapi$fixBlockTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
| 26 | + return ApronStAPICompat.fixBlockTexture(texture, block); |
| 27 | + } |
| 28 | + |
| 29 | + |
| 30 | + @TargetHandler( |
| 31 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.BedRendererMixin", |
| 32 | + name = "stationapi_bed_captureTexture1", |
| 33 | + prefix = "handler" |
| 34 | + ) |
| 35 | + @ModifyVariable( |
| 36 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 37 | + argsOnly = true, |
| 38 | + ordinal = 3 |
| 39 | + ) |
| 40 | + private int apron$stapi$fixBedTextureIndex1(int texture, @Local(ordinal = 0) Block block) { |
28 | 41 | return ApronStAPICompat.fixBlockTexture(texture, block); |
29 | 42 | } |
30 | 43 |
|
| 44 | + @TargetHandler( |
| 45 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.BedRendererMixin", |
| 46 | + name = "stationapi_bed_captureTexture2", |
| 47 | + prefix = "handler" |
| 48 | + ) |
| 49 | + @ModifyVariable( |
| 50 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 51 | + argsOnly = true, |
| 52 | + ordinal = 3 |
| 53 | + ) |
| 54 | + private int apron$stapi$fixBedTextureIndex2(int texture, @Local(ordinal = 0) Block block) { |
| 55 | + return ApronStAPICompat.fixBlockTexture(texture, block); |
| 56 | + } |
| 57 | + |
| 58 | + |
| 59 | + @TargetHandler( |
| 60 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.CropRendererMixin", |
| 61 | + name = "stationapi_column_captureTexture", |
| 62 | + prefix = "handler" |
| 63 | + ) |
31 | 64 | @ModifyVariable( |
32 | | - method = {"renderTiltedTorch", "renderCrop(Lnet/minecraft/block/Block;IDDD)V", "renderCross(Lnet/minecraft/block/Block;IDDD)V", "renderFire", "renderLadder"}, |
33 | | - at = @At( |
34 | | - value = "FIELD", |
35 | | - target = "Lnet/minecraft/client/render/block/BlockRenderManager;textureOverride:I", |
36 | | - opcode = 180, |
37 | | - ordinal = 1, |
38 | | - shift = At.Shift.BY, |
39 | | - by = 3 |
40 | | - ), |
41 | | - ordinal = 0 |
42 | | - ) |
43 | | - private int apron$stapi$fixOtherTextureIndex1(int texture, @Local(ordinal = 0) Block block) { |
| 65 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 66 | + argsOnly = true, |
| 67 | + ordinal = 1 |
| 68 | + ) |
| 69 | + private int apron$stapi$fixColumnTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
44 | 70 | return ApronStAPICompat.fixBlockTexture(texture, block); |
45 | 71 | } |
46 | 72 |
|
| 73 | + |
| 74 | + @TargetHandler( |
| 75 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.CrossRendererMixin", |
| 76 | + name = "stationapi_crossed_captureTexture", |
| 77 | + prefix = "handler" |
| 78 | + ) |
47 | 79 | @ModifyVariable( |
48 | | - method = {"renderCrop(Lnet/minecraft/block/Block;IDDD)V", "renderCross(Lnet/minecraft/block/Block;IDDD)V"}, |
49 | | - at = @At( |
50 | | - value = "FIELD", |
51 | | - target = "Lnet/minecraft/client/render/block/BlockRenderManager;textureOverride:I", |
52 | | - opcode = 180, |
53 | | - ordinal = 1, |
54 | | - shift = At.Shift.BY, |
55 | | - by = 3 |
56 | | - ), |
| 80 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 81 | + argsOnly = true, |
57 | 82 | ordinal = 1 |
58 | 83 | ) |
59 | | - private int apron$stapi$fixOtherTextureIndex2(int texture, @Local(ordinal = 0) Block block) { |
| 84 | + private int apron$stapi$fixCrossedTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
60 | 85 | return ApronStAPICompat.fixBlockTexture(texture, block); |
61 | 86 | } |
62 | 87 |
|
| 88 | + |
| 89 | + @TargetHandler( |
| 90 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.FireRendererMixin", |
| 91 | + name = "stationapi_fire_captureTexture1", |
| 92 | + prefix = "handler" |
| 93 | + ) |
63 | 94 | @ModifyVariable( |
64 | | - method = {"renderFire", "renderLadder"}, |
65 | | - at = @At( |
66 | | - value = "FIELD", |
67 | | - target = "Lnet/minecraft/client/render/block/BlockRenderManager;textureOverride:I", |
68 | | - opcode = 180, |
69 | | - ordinal = 1, |
70 | | - shift = At.Shift.BY, |
71 | | - by = 3 |
72 | | - ), |
| 95 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 96 | + argsOnly = true, |
73 | 97 | ordinal = 3 |
74 | 98 | ) |
75 | | - private int apron$stapi$fixOtherTextureIndex3(int texture, @Local(ordinal = 0) Block block) { |
| 99 | + private int apron$stapi$fixFireTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
76 | 100 | return ApronStAPICompat.fixBlockTexture(texture, block); |
77 | 101 | } |
78 | 102 |
|
| 103 | + |
| 104 | + @TargetHandler( |
| 105 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.FluidRendererMixin", |
| 106 | + name = "stationapi_fluid_captureTexture1", |
| 107 | + prefix = "handler" |
| 108 | + ) |
79 | 109 | @ModifyVariable( |
80 | | - method = {"renderRail"}, |
81 | | - at = @At( |
82 | | - value = "FIELD", |
83 | | - target = "Lnet/minecraft/client/render/block/BlockRenderManager;textureOverride:I", |
84 | | - opcode = 180, |
85 | | - ordinal = 1, |
86 | | - shift = At.Shift.BY, |
87 | | - by = 3 |
88 | | - ), |
89 | | - ordinal = 4 |
90 | | - ) |
91 | | - private int apron$stapi$fixOtherTextureIndex4(int texture, @Local(ordinal = 0) RailBlock block) { |
| 110 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 111 | + argsOnly = true, |
| 112 | + ordinal = 3 |
| 113 | + ) |
| 114 | + private int apron$stapi$fixFluidTextureIndex1(int texture, @Local(ordinal = 0) Block block) { |
92 | 115 | return ApronStAPICompat.fixBlockTexture(texture, block); |
93 | 116 | } |
94 | 117 |
|
| 118 | + @TargetHandler( |
| 119 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.FluidRendererMixin", |
| 120 | + name = "stationapi_fluid_captureTexture2", |
| 121 | + prefix = "handler" |
| 122 | + ) |
95 | 123 | @ModifyVariable( |
96 | | - method = {"renderRedstoneDust"}, |
97 | | - at = @At( |
98 | | - value = "FIELD", |
99 | | - target = "Lnet/minecraft/client/render/block/BlockRenderManager;textureOverride:I", |
100 | | - opcode = 180, |
101 | | - ordinal = 1, |
102 | | - shift = At.Shift.BY, |
103 | | - by = 3 |
104 | | - ), |
105 | | - ordinal = 4 |
106 | | - ) |
107 | | - private int apron$stapi$fixOtherTextureIndex5(int texture, @Local(ordinal = 0) Block block) { |
| 124 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 125 | + argsOnly = true, |
| 126 | + ordinal = 3 |
| 127 | + ) |
| 128 | + private int apron$stapi$fixFluidTextureIndex2(int texture, @Local(ordinal = 0) Block block) { |
| 129 | + return ApronStAPICompat.fixBlockTexture(texture, block); |
| 130 | + } |
| 131 | + |
| 132 | + |
| 133 | + @TargetHandler( |
| 134 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.LadderRendererMixin", |
| 135 | + name = "stationapi_ladder_captureTexture", |
| 136 | + prefix = "handler" |
| 137 | + ) |
| 138 | + @ModifyVariable( |
| 139 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 140 | + argsOnly = true, |
| 141 | + ordinal = 3 |
| 142 | + ) |
| 143 | + private int apron$stapi$fixLadderTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
| 144 | + return ApronStAPICompat.fixBlockTexture(texture, block); |
| 145 | + } |
| 146 | + |
| 147 | + |
| 148 | + @TargetHandler( |
| 149 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.LeverRendererMixin", |
| 150 | + name = "stationapi_lever_captureTexture", |
| 151 | + prefix = "handler" |
| 152 | + ) |
| 153 | + @ModifyVariable( |
| 154 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 155 | + argsOnly = true, |
| 156 | + ordinal = 3 |
| 157 | + ) |
| 158 | + private int apron$stapi$fixLeverTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
| 159 | + return ApronStAPICompat.fixBlockTexture(texture, block); |
| 160 | + } |
| 161 | + |
| 162 | + |
| 163 | + @TargetHandler( |
| 164 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.RailRendererMixin", |
| 165 | + name = "stationapi_rails_captureTexture", |
| 166 | + prefix = "handler" |
| 167 | + ) |
| 168 | + @ModifyVariable( |
| 169 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 170 | + argsOnly = true, |
| 171 | + ordinal = 3 |
| 172 | + ) |
| 173 | + private int apron$stapi$fixRailTextureIndex(int texture, @Local(ordinal = 0) RailBlock block) { |
| 174 | + return ApronStAPICompat.fixBlockTexture(texture, block); |
| 175 | + } |
| 176 | + |
| 177 | + |
| 178 | + @TargetHandler( |
| 179 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.RepeaterRendererMixin", |
| 180 | + name = "stationapi_repeater_captureTexture", |
| 181 | + prefix = "handler" |
| 182 | + ) |
| 183 | + @ModifyVariable( |
| 184 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 185 | + argsOnly = true, |
| 186 | + ordinal = 3 |
| 187 | + ) |
| 188 | + private int apron$stapi$fixRepeaterTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
| 189 | + return ApronStAPICompat.fixBlockTexture(texture, block); |
| 190 | + } |
| 191 | + |
| 192 | + |
| 193 | + @TargetHandler( |
| 194 | + mixin = "net.modificationstation.stationapi.mixin.arsenic.client.block.TorchRendererMixin", |
| 195 | + name = "stationapi_torch_captureTexture", |
| 196 | + prefix = "handler" |
| 197 | + ) |
| 198 | + @ModifyVariable( |
| 199 | + method = "@MixinSquared:Handler", at = @At("HEAD"), |
| 200 | + argsOnly = true |
| 201 | + ) |
| 202 | + private int apron$stapi$fixTorchTextureIndex(int texture, @Local(ordinal = 0) Block block) { |
108 | 203 | return ApronStAPICompat.fixBlockTexture(texture, block); |
109 | 204 | } |
110 | 205 | } |
0 commit comments