Skip to content

Commit

Permalink
Address some mixin errors from IntelliJ
Browse files Browse the repository at this point in the history
- Fixes default call in minecart mixin
- Marks AA laser relay mixin as cancellable
  • Loading branch information
jchung01 committed Jul 20, 2024
1 parent 22a760a commit b63e5c9
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class UTBlockOverlayMixin
{
@Shadow
private WorldClient world;
public WorldClient world;

@Shadow
@Final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

// Courtesy of WaitingIdly, TheRandomLabs (RandomPatches)
@Mixin(value = RenderPlayer.class)
public abstract class UTRenderPlayerMixin
public class UTRenderPlayerMixin
{
@WrapOperation(method = "applyRotations", at = @At(value = "INVOKE", target = "Ljava/lang/Math;acos(D)D"))
@WrapOperation(method = "applyRotations(Lnet/minecraft/client/entity/AbstractClientPlayer;FFF)V", at = @At(value = "INVOKE", target = "Ljava/lang/Math;acos(D)D"))
private double utClampToPreventInvisiblePlayerOnElytra(double instance, Operation<Double> original)
{
if (!UTConfigBugfixes.ENTITIES.utFixInvisiblePlayerModelWithElytra) return original.call(instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public abstract class UTSlotCraftingMixin extends Slot
{
@Shadow
private int amountCrafted;
public int amountCrafted;

public UTSlotCraftingMixin(IInventory inventoryIn, int index, int xPosition, int yPosition)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.spongepowered.asm.mixin.injection.Redirect;

// Courtesy of Sk1erLLC
@SuppressWarnings("UnresolvedMixinReference")
@Mixin(targets = "net.minecraft.client.renderer.BlockModelRenderer$AmbientOcclusionFace")
public class UTSmoothLightingMixin
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public void callUpdateBoundingBox(int chunkX, int chunkZ, CallbackInfoReturnable
}

@Shadow
protected abstract void updateBoundingBox();
public abstract void updateBoundingBox();
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@Mixin(value = BlockLaserRelay.class)
public abstract class UTBlockLaserRelayMixin
{
@Inject(method = "onBlockActivated", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;isCreative()Z"))
@Inject(method = "onBlockActivated", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;isCreative()Z"), cancellable = true)
public void utOnBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9, CallbackInfoReturnable<Boolean> cir)
{
if (!UTConfigMods.ACTUALLY_ADDITIONS.utLaserUpgradeVoid) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ private void utShouldUpdateInventory(CallbackInfo ci, @Share("shouldUpdate") Loc
shouldUpdate.set(true);
}

// TODO: Replace with v2.WrapWithCondition once we depend on MixinBooter 9.x
@WrapWithCondition(method = "tickEquipment", at = @At(value = "INVOKE", target = "Lnet/minecraft/inventory/Container;detectAndSendChanges()V", remap = true))
private boolean utUpdateInventoryIfAllowed(Container instance, @Share("shouldUpdate") LocalBooleanRef shouldUpdate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class UTContainerBackpackMixin extends Container
@ParametersAreNonnullByDefault
public boolean canInteractWith(EntityPlayer playerIn)
{
// Currently breaks hotkey functionality
// TODO: Currently breaks hotkey functionality
return this.backpackStack.getItem() instanceof IBackpack && (playerIn.getHeldItemMainhand() == this.backpackStack || playerIn.getHeldItemOffhand() == this.backpackStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Mixin(value = SmelteryRenderer.class, remap = false)
public abstract class UTSmelteryRendererMixin extends SmelteryTankRenderer<TileSmeltery>
{
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lslimeknights/tconstruct/smeltery/client/SmelteryRenderer;renderFluids(Lslimeknights/tconstruct/library/smeltery/SmelteryTank;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;DDD)V", shift = At.Shift.AFTER), cancellable = true)
@Inject(method = "render(Lslimeknights/tconstruct/smeltery/tileentity/TileSmeltery;DDDFIF)V", at = @At(value = "INVOKE", target = "Lslimeknights/tconstruct/smeltery/client/SmelteryRenderer;renderFluids(Lslimeknights/tconstruct/library/smeltery/SmelteryTank;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;DDD)V", shift = At.Shift.AFTER), cancellable = true)
public void utSmelteryRenderer(@Nonnull TileSmeltery smeltery, double x, double y, double z, float partialTicks, int destroyStage, float alpha, CallbackInfo ci)
{
if (UTConfigMods.TINKERS_CONSTRUCT.utMaximumItemRendersInSmeltery < 0) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class UTContainerRepairMixin
{
@Shadow
@Final
private IInventory inputSlots;
public IInventory inputSlots;

@Inject(method = "canInteractWith", at = @At("HEAD"), cancellable = true)
private void canInteractWith(EntityPlayer player, CallbackInfoReturnable<Boolean> info)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private EntityItem utDropMinecartType(EntityMinecart instance, ItemStack item, f
{
if (!UTConfigTweaks.ENTITIES.utMinecartDropsType || !(instance instanceof EntityMinecartFurnace || instance instanceof EntityMinecartChest || instance instanceof EntityMinecartTNT || instance instanceof EntityMinecartHopper))
{
return original.call(instance, instance, y);
return original.call(instance, item, y);
}
ItemStack itemstack = instance.getCartItem().copy();
if (instance.hasCustomName()) itemstack.setStackDisplayName(instance.getCustomNameTag());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import mod.acgaming.universaltweaks.tweaks.performance.connectionspeed.UTConnectionPatch;

// Courtesy of WaitingIdly
@SuppressWarnings("UnresolvedMixinReference")
@Mixin(targets = "net.minecraft.client.multiplayer.GuiConnecting$1")
public class UTGuiConnectingMixin
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import mod.acgaming.universaltweaks.tweaks.performance.connectionspeed.UTConnectionPatch;

// Courtesy of WaitingIdly
@SuppressWarnings("UnresolvedMixinReference")
@Mixin(targets = "net.minecraft.realms.RealmsConnect$1")
public class UTRealmsConnectMixin
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import mod.acgaming.universaltweaks.config.UTConfigTweaks;

// Courtesy of WaitingIdly, TheRandomLabs (RandomPatches)
@SuppressWarnings("UnresolvedMixinReference")
@Mixin(targets = "net.minecraft.client.gui.GuiLanguage$List")
public abstract class UTLanguageListMixin
{
Expand Down

0 comments on commit b63e5c9

Please sign in to comment.