A minimalistic hook for rendering world effect overlays or other 3D overlay

data.
This commit is contained in:
Eloraam 2011-12-21 09:57:10 +00:00
parent dbb5a37449
commit f4eec04eba
3 changed files with 36 additions and 1 deletions

View File

@ -30,7 +30,16 @@ public class ForgeHooksClient {
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) {
if(block instanceof IMultipassRender) {

View File

@ -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);
}

View File

@ -34,3 +34,12 @@
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
}
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)
{