diff options
author | Appability <appable@icloud.com> | 2022-10-12 20:48:51 -0700 |
---|---|---|
committer | Appability <appable@icloud.com> | 2022-10-12 20:48:51 -0700 |
commit | c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8 (patch) | |
tree | f362a5f60f31e27f1567c7319a78d861b19430a7 /src/main/java/com/ambientaddons/mixin/MixinRenderItem.java | |
parent | 03728b81851af00cd265fadd4ce6eaa3a8066dcb (diff) | |
download | AmbientAddons-c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8.tar.gz AmbientAddons-c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8.tar.bz2 AmbientAddons-c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8.zip |
uh a lot of things
Diffstat (limited to 'src/main/java/com/ambientaddons/mixin/MixinRenderItem.java')
-rw-r--r-- | src/main/java/com/ambientaddons/mixin/MixinRenderItem.java | 22 |
1 files changed, 22 insertions, 0 deletions
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(); + } + } +} |