From c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8 Mon Sep 17 00:00:00 2001 From: Appability Date: Wed, 12 Oct 2022 20:48:51 -0700 Subject: uh a lot of things --- .../com/ambientaddons/mixin/MixinRenderItem.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/com/ambientaddons/mixin/MixinRenderItem.java (limited to 'src/main/java/com/ambientaddons/mixin/MixinRenderItem.java') diff --git a/src/main/java/com/ambientaddons/mixin/MixinRenderItem.java b/src/main/java/com/ambientaddons/mixin/MixinRenderItem.java new file mode 100644 index 0000000..8068291 --- /dev/null +++ b/src/main/java/com/ambientaddons/mixin/MixinRenderItem.java @@ -0,0 +1,22 @@ +package com.ambientaddons.mixin; + +import com.ambientaddons.events.GuiContainerEvent; +import com.ambientaddons.events.ItemOverlayEvent; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +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; + +@Mixin(RenderItem.class) +public abstract class MixinRenderItem { + @Inject(method = "renderItemOverlayIntoGUI", at = @At("HEAD"),cancellable = true) + public void renderItemOverlayIntoGui(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text, CallbackInfo ci) { + if (MinecraftForge.EVENT_BUS.post(new ItemOverlayEvent(stack, xPosition, yPosition))) { + ci.cancel(); + } + } +} -- cgit