|
1 | 1 | package carpet.mixins;
|
2 | 2 |
|
3 | 3 | import carpet.CarpetSettings;
|
| 4 | +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; |
| 5 | +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
4 | 6 | import net.minecraft.core.BlockPos;
|
5 | 7 | import net.minecraft.world.level.Level;
|
6 | 8 | import net.minecraft.world.level.block.state.BlockState;
|
|
13 | 15 | public class LevelChunk_fillUpdatesMixin
|
14 | 16 | {
|
15 | 17 | // todo onStateReplaced needs a bit more love since it removes be which is needed
|
16 |
| - @Redirect(method = "setBlockState", at = @At( |
| 18 | + @WrapOperation(method = "setBlockState", at = @At( |
17 | 19 | value = "INVOKE",
|
18 | 20 | target = "Lnet/minecraft/world/level/block/state/BlockState;onPlace(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Z)V"
|
19 | 21 | ))
|
20 |
| - private void onAdded(BlockState blockState, Level world_1, BlockPos blockPos_1, BlockState blockState_1, boolean boolean_1) |
| 22 | + private void onAdded(BlockState blockState, Level world, BlockPos blockPos, BlockState state, boolean b, Operation<Void> original) |
21 | 23 | {
|
22 |
| - if (!CarpetSettings.impendingFillSkipUpdates.get()) |
23 |
| - blockState.onPlace(world_1, blockPos_1, blockState_1, boolean_1); |
| 24 | + if (!CarpetSettings.impendingFillSkipUpdates.get()) { |
| 25 | + blockState.onPlace(world, blockPos, blockState, b); |
| 26 | + } else { |
| 27 | + original.call(blockState, world, blockPos, state, b); |
| 28 | + } |
24 | 29 | }
|
25 | 30 |
|
26 | 31 | @Redirect(method = "setBlockState", at = @At(
|
|
0 commit comments