-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
48 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
32 changes: 32 additions & 0 deletions
32
...universaltweaks/bugfixes/blocks/piston/pistonretraction/mixin/UTPistonBaseBlockMixin.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,32 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.blocks.piston.pistonretraction.mixin; | ||
|
||
import static net.minecraft.block.BlockPistonBase.EXTENDED; | ||
|
||
import net.minecraft.block.BlockPistonBase; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
|
||
import mod.acgaming.universaltweaks.UniversalTweaks; | ||
import mod.acgaming.universaltweaks.config.UTConfigBugfixes; | ||
import org.objectweb.asm.Opcodes; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
// MC-88959 | ||
// https://bugs.mojang.com/browse/MC-88959 | ||
// Courtesy of mrgrim | ||
@Mixin(BlockPistonBase.class) | ||
public abstract class UTPistonBaseBlockMixin | ||
{ | ||
@Inject(method = "checkForMove", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;addBlockEvent(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;II)V", ordinal = 1)) | ||
private void onPistonDepower(World worldIn, BlockPos pos, IBlockState state, CallbackInfo ci) | ||
{ | ||
if (UTConfigBugfixes.BLOCKS.utPistonRetractionToggle) | ||
{ | ||
worldIn.setBlockState(pos, state.withProperty(EXTENDED, false), 2); | ||
} | ||
} | ||
} |
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
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
7 changes: 7 additions & 0 deletions
7
src/main/resources/mixins.bugfixes.blocks.pistontile.pistonretraction.json
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,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.bugfixes.blocks.piston.pistonretraction.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTPistonBaseBlockMixin"] | ||
} |