Add RenderItemInFrameEvent
This commit is contained in:
parent
7525d209b6
commit
aca429f17b
2 changed files with 47 additions and 0 deletions
|
@ -0,0 +1,20 @@
|
||||||
|
--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java
|
||||||
|
+++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java
|
||||||
|
@@ -176,6 +176,9 @@
|
||||||
|
GL11.glTranslatef(0.16F, -0.16F, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this);
|
||||||
|
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
|
||||||
|
+ {
|
||||||
|
if (item == Items.field_151098_aY)
|
||||||
|
{
|
||||||
|
this.field_76990_c.field_78724_e.func_110577_a(field_110789_a);
|
||||||
|
@@ -244,6 +247,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ }
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package net.minecraftforge.client.event;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.tileentity.RenderItemFrame;
|
||||||
|
import net.minecraft.entity.item.EntityItemFrame;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||||
|
import cpw.mods.fml.common.eventhandler.Event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is called when an item is rendered in an item frame.
|
||||||
|
*
|
||||||
|
* You can set canceled to do no further vanilla processing.
|
||||||
|
*/
|
||||||
|
@Cancelable
|
||||||
|
public class RenderItemInFrameEvent extends Event
|
||||||
|
{
|
||||||
|
public final ItemStack item;
|
||||||
|
public final EntityItemFrame entityItemFrame;
|
||||||
|
public final RenderItemFrame renderer;
|
||||||
|
|
||||||
|
public RenderItemInFrameEvent(EntityItemFrame itemFrame, RenderItemFrame renderItemFrame)
|
||||||
|
{
|
||||||
|
item = itemFrame.getDisplayedItem();
|
||||||
|
entityItemFrame = itemFrame;
|
||||||
|
renderer = renderItemFrame;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue