Skip to content

Commit

Permalink
Add rule: reIntroduceTrapdoorUpdateSkipping
Browse files Browse the repository at this point in the history
  • Loading branch information
FxMorin committed Jul 5, 2023
1 parent 45facb0 commit 0c21721
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/carpetfixes/CFSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,12 @@ other bugs, except they deserve a category of their own (for sorting purposes...
)
public static boolean reIntroducePistonTranslocation = false;

//By FX - PR0CESS
@Rule(
categories = {REINTRODUCE}
)
public static boolean reIntroduceTrapdoorUpdateSkipping = false;


/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package carpetfixes.mixins.reIntroduced;

import carpetfixes.CFSettings;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.block.RedstoneWireBlock;
import net.minecraft.block.TrapdoorBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;

@Mixin(RedstoneWireBlock.class)
public class RedstoneWireBlock_skipperMixin {

@WrapOperation(
method = "getRenderConnectionType(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;" +
"Lnet/minecraft/util/math/Direction;Z)Lnet/minecraft/block/enums/WireConnection;",
constant = @Constant(classValue = TrapdoorBlock.class)
)
private boolean trapdoorUpdateSkipping(Object obj, Operation<Boolean> original) {
return !CFSettings.reIntroduceTrapdoorUpdateSkipping && original.call(obj);
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/carpet-fixes/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@
"carpet-fixes.rule.reIntroduceVeryAggressiveSaving.desc": "Re-introduces very aggressive saving by removing the chunk save cooldown that was added in 22w05a",
"carpet-fixes.rule.reIntroduceZeroTickFarms.desc": "Re-introduces zero tick farms",
"carpet-fixes.rule.reIntroduceZeroTickFarms.extra": "Reverts [MC-113809](https://bugs.mojang.com/browse/MC-113809) from 20w12a",
"carpet-fixes.rule.reIntroduceTrapdoorUpdateSkipping.desc": "Re-introduces compact update skippers using trapdoors",
"carpet-fixes.rule.reIntroduceTrapdoorUpdateSkipping.extra": "This was patched in 1.20",
"carpet-fixes.rule.recordWorldEventFix.desc": "Fixes record world events being sent at the wrong time, causing multiple disks to play at the same time",
"carpet-fixes.rule.recordWorldEventFix.extra": "[MC-112245](https://bugs.mojang.com/browse/MC-112245)",
"carpet-fixes.rule.redstoneComponentUpdateOrderOnBreakFix.desc": "Fixes redstone torch/repeater/comparator update order when being broken, causing incorrect update order",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/carpet-fixes.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
"reIntroduced.PistonBlockEntity_translocationMixin",
"reIntroduced.PlayerManager_LlamaRidingDupeMixin",
"reIntroduced.PlayerManager_LlamaRidingDupeMixin_VMPCompat",
"reIntroduced.RedstoneWireBlock_skipperMixin",
"reIntroduced.ScreenHandler_itemShadowingMixin",
"reIntroduced.ServerWorld_zeroTickMixin",
"reIntroduced.TargetBlock_PermanentlyPoweredMixin",
Expand Down

0 comments on commit 0c21721

Please sign in to comment.