A minimalistic hook for rendering world effect overlays or other 3D overlay
data.
This commit is contained in:
parent
dbb5a37449
commit
f4eec04eba
3 changed files with 36 additions and 1 deletions
|
@ -30,7 +30,16 @@ public class ForgeHooksClient {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LinkedList<IHighlightHandler> highlightHandlers = new LinkedList<IHighlightHandler>();
|
public static void onRenderWorldLast(RenderGlobal rg, float f) {
|
||||||
|
for (IRenderWorldLastHandler handler : renderWorldLastHandlers) {
|
||||||
|
handler.onRenderWorldLast(rg,f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static LinkedList<IHighlightHandler> highlightHandlers =
|
||||||
|
new LinkedList<IHighlightHandler>();
|
||||||
|
static LinkedList<IRenderWorldLastHandler> renderWorldLastHandlers =
|
||||||
|
new LinkedList<IRenderWorldLastHandler>();
|
||||||
|
|
||||||
public static boolean canRenderInPass(Block block, int pass) {
|
public static boolean canRenderInPass(Block block, int pass) {
|
||||||
if(block instanceof IMultipassRender) {
|
if(block instanceof IMultipassRender) {
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* This software is provided under the terms of the Minecraft Forge Public
|
||||||
|
* License v1.0.
|
||||||
|
*/
|
||||||
|
package net.minecraft.src.forge;
|
||||||
|
|
||||||
|
import net.minecraft.src.RenderGlobal;
|
||||||
|
|
||||||
|
public interface IRenderWorldLastHandler {
|
||||||
|
/** Called after rendering all the 3D data of the world. This is
|
||||||
|
* called before the user's tool is rendered, but otherwise after all
|
||||||
|
* 3D content. It is called twice in anaglyph mode. This is intended
|
||||||
|
* for rendering visual effect overlays into the world.
|
||||||
|
*/
|
||||||
|
void onRenderWorldLast(RenderGlobal rg, float f);
|
||||||
|
}
|
||||||
|
|
|
@ -34,3 +34,12 @@
|
||||||
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
|
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
|
||||||
}
|
}
|
||||||
Profiler.endStartSection("weather");
|
Profiler.endStartSection("weather");
|
||||||
|
@@ -988,6 +993,8 @@
|
||||||
|
setupFog(1, f);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
+ Profiler.endStartSection("fhooks");
|
||||||
|
+ ForgeHooksClient.onRenderWorldLast(renderglobal,f);
|
||||||
|
Profiler.endStartSection("hand");
|
||||||
|
if(cameraZoom == 1.0D)
|
||||||
|
{
|
||||||
|
|
Loading…
Reference in a new issue