Add cancelable RenderHandEvent.
This commit is contained in:
parent
6f49bba302
commit
bad0639e90
3 changed files with 32 additions and 2 deletions
|
@ -125,7 +125,7 @@
|
|||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
@@ -1357,6 +1380,9 @@
|
||||
@@ -1357,9 +1380,12 @@
|
||||
this.renderCloudsCheck(renderglobal, par1);
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,11 @@
|
|||
+
|
||||
this.mc.mcProfiler.endStartSection("hand");
|
||||
|
||||
if (this.cameraZoom == 1.0D)
|
||||
- if (this.cameraZoom == 1.0D)
|
||||
+ if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, par1, j) && this.cameraZoom == 1.0D)
|
||||
{
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
this.renderHand(par1, j);
|
||||
@@ -1477,6 +1503,13 @@
|
||||
// JAVADOC METHOD $$ func_78474_d
|
||||
protected void renderRainSnow(float par1)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraftforge.client;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
|
@ -44,6 +45,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
|||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
|
@ -251,6 +253,11 @@ public class ForgeHooksClient
|
|||
MinecraftForge.EVENT_BUS.post(new RenderWorldLastEvent(context, partialTicks));
|
||||
}
|
||||
|
||||
public static boolean renderFirstPersonHand(RenderGlobal context, float partialTicks, int renderPass)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderHandEvent(context, partialTicks, renderPass));
|
||||
}
|
||||
|
||||
public static void onTextureStitchedPre(TextureMap map)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Pre(map));
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package net.minecraftforge.client.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
|
||||
@Cancelable
|
||||
public class RenderHandEvent extends Event
|
||||
{
|
||||
public final RenderGlobal context;
|
||||
public final float partialTicks;
|
||||
public final int renderPass;
|
||||
public RenderHandEvent(RenderGlobal context, float partialTicks, int renderPass)
|
||||
{
|
||||
this.context = context;
|
||||
this.partialTicks = partialTicks;
|
||||
this.renderPass = renderPass;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue