-
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 remote-tracking branch 'upstream/main' into hotbar-scrolling
- Loading branch information
Showing
26 changed files
with
423 additions
and
7 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
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
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
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
...n/java/mod/acgaming/universaltweaks/mods/extrautilities/radar/mixin/UTRadarPingMixin.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.mods.extrautilities.radar.mixin; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.items.IItemHandler; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import com.rwtema.extrautils2.crafting.Radar; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
import mod.acgaming.universaltweaks.config.UTConfigMods; | ||
|
||
// Courtesy of WaitingIdly | ||
@Mixin(value = Radar.PacketPing.class, remap = false) | ||
public abstract class UTRadarPingMixin | ||
{ | ||
@WrapOperation(method = "lambda$doStuffServer$1", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/items/IItemHandler;getStackInSlot(I)Lnet/minecraft/item/ItemStack;")) | ||
private ItemStack utCatchItemHandlerException(IItemHandler instance, int slot, Operation<ItemStack> original) | ||
{ | ||
if (!UTConfigMods.EXTRA_UTILITIES.utCatchRadarException) return original.call(instance, slot); | ||
try | ||
{ | ||
return original.call(instance, slot); | ||
} | ||
catch (AbstractMethodError e) | ||
{ | ||
e.printStackTrace(); | ||
return ItemStack.EMPTY; | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ava/mod/acgaming/universaltweaks/mods/requiousfrakto/mixin/UTTileEntityAssemblyMixin.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,24 @@ | ||
package mod.acgaming.universaltweaks.mods.requiousfrakto.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import net.minecraft.tileentity.TileEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import requious.tile.TileEntityAssembly; | ||
|
||
// Courtesy of jchung01 | ||
@Mixin(value = TileEntityAssembly.class) | ||
public abstract class UTTileEntityAssemblyMixin extends TileEntity | ||
{ | ||
/** | ||
* @reason Updating MachineVisuals should only be needed client-side. | ||
* This is the earliest we can check the side before calls to IProxy | ||
* methods for spawning particles. | ||
*/ | ||
@ModifyExpressionValue(method = "update", at = @At(value = "INVOKE", target = "Ljava/util/Iterator;hasNext()Z", remap = false)) | ||
private boolean utCheckSide(boolean original) | ||
{ | ||
if (!this.world.isRemote) return false; | ||
return original; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/mod/acgaming/universaltweaks/mods/tconstruct/mixin/UTClientProxyMixin.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,27 @@ | ||
package mod.acgaming.universaltweaks.mods.tconstruct.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import com.llamalad7.mixinextras.sugar.ref.LocalRef; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.world.World; | ||
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; | ||
import slimeknights.tconstruct.common.ClientProxy; | ||
|
||
// Courtesy of jchung01 | ||
@Mixin(value = ClientProxy.class, remap = false) | ||
public class UTClientProxyMixin | ||
{ | ||
/** | ||
* @reason It is never correct to use passed worlds for particles, only use the client's. | ||
* Ideally we would check sides in the relevant methods before even calling this, | ||
* but this is simpler. | ||
*/ | ||
@Inject(method = "spawnParticle", at = @At(value = "HEAD")) | ||
private void utSetWorld(CallbackInfo ci, @Local(argsOnly = true) LocalRef<World> worldRef) | ||
{ | ||
worldRef.set(Minecraft.getMinecraft().world); | ||
} | ||
} |
Oops, something went wrong.