Skip to content

Commit 8c1c1c3

Browse files
committed
fix conflict with worldedit
1 parent a943511 commit 8c1c1c3

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
## Changelog
22
- port to 1.21.3
3-
- rework `customSticky` mixin
3+
- rework `customSticky` mixin
4+
- fix conflict with worldedit

src/main/java/carpet/mixins/LevelChunk_fillUpdatesMixin.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package carpet.mixins;
22

33
import carpet.CarpetSettings;
4+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
5+
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
46
import net.minecraft.core.BlockPos;
57
import net.minecraft.world.level.Level;
68
import net.minecraft.world.level.block.state.BlockState;
@@ -13,14 +15,17 @@
1315
public class LevelChunk_fillUpdatesMixin
1416
{
1517
// 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(
1719
value = "INVOKE",
1820
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"
1921
))
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)
2123
{
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, state, b);
26+
} else {
27+
original.call(blockState, world, blockPos, state, b);
28+
}
2429
}
2530

2631
@Redirect(method = "setBlockState", at = @At(

0 commit comments

Comments
 (0)