-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/vazkii/quark/mixin/TripWireHookBlockMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package vazkii.quark.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.WrapWithCondition; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.TripWireHookBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import vazkii.quark.content.experimental.module.GameNerfsModule; | ||
|
||
@Mixin(TripWireHookBlock.class) | ||
public class TripWireHookBlockMixin { | ||
|
||
@WrapWithCondition(method = "calculateState", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;setBlock(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;I)Z")) | ||
private boolean fixTripWireDupe(Level instance, BlockPos pos, BlockState state, int flag) { | ||
if (GameNerfsModule.shouldTripwireHooksCheckForAir() && state.is(Blocks.TRIPWIRE_HOOK)) | ||
return instance.getBlockState(pos).is(Blocks.TRIPWIRE_HOOK); | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters