-
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.
Merge pull request #361 from IcarussOne/main
4th Batch of Tweaks
- Loading branch information
Showing
9 changed files
with
144 additions
and
2 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); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...java/mod/acgaming/universaltweaks/bugfixes/entities/minecart/mixin/UTMinecartAIMixin.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,34 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.entities.minecart.mixin; | ||
|
||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.item.EntityMinecart; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
|
||
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.Redirect; | ||
import org.spongepowered.asm.mixin.injection.Slice; | ||
|
||
// MC-64836 | ||
// https://bugs.mojang.com/browse/MC-64836 | ||
// Courtesy of mrgrim | ||
@Mixin(EntityMinecart.class) | ||
public abstract class UTMinecartAIMixin | ||
{ | ||
// TODO: Investigate AI code (?) | ||
@Redirect(method = "moveAlongTrack", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/EntityLivingBase;moveForward:F", opcode = Opcodes.GETFIELD, ordinal = 0), | ||
slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/entity/item/EntityMinecart;getPassengers()Ljava/util/List;", ordinal = 1), | ||
to = @At(value = "INVOKE", target = "Lnet/minecraft/entity/item/EntityMinecart;shouldDoRailFunctions()Z", remap = false))) | ||
private float disableMobControl(EntityLivingBase entityIn) | ||
{ | ||
if (UTConfigBugfixes.ENTITIES.utMinecartAIToggle && !(entityIn instanceof EntityPlayer)) | ||
{ | ||
return 0.0F; | ||
} | ||
|
||
return entityIn.moveForward; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ain/java/mod/acgaming/universaltweaks/bugfixes/world/witchhuts/mixin/UTWitchHutMixin.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,28 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.world.witchhuts.mixin; | ||
|
||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.world.gen.structure.StructureStart; | ||
|
||
import mod.acgaming.universaltweaks.UniversalTweaks; | ||
import mod.acgaming.universaltweaks.config.UTConfigBugfixes; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
// MC-73051 | ||
// https://bugs.mojang.com/browse/MC-73051 | ||
// Courtesy of mrgrim, Xcom6000 | ||
@Mixin(StructureStart.class) | ||
public abstract class UTWitchHutMixin | ||
{ | ||
@Shadow | ||
protected abstract void updateBoundingBox(); | ||
|
||
@Inject(method = "writeStructureComponentsToNBT", at = @At(value = "CONSTANT", args = "stringValue=Children", ordinal = 0)) | ||
public void callUpdateBoundingBox(int chunkX, int chunkZ, CallbackInfoReturnable<NBTTagCompound> ci) | ||
{ | ||
if (UTConfigBugfixes.WORLD.utWitchStructuresToggle) this.updateBoundingBox(); | ||
} | ||
} |
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"] | ||
} |
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.entities.minecart.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTMinecartAIMixin"] | ||
} |
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.world.witchhuts.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": ["UTWitchHutMixin"] | ||
} |