Added ChickenBones's request ITextureLoadHandler hook
This commit is contained in:
parent
4e575f353f
commit
421f31cce5
4 changed files with 53 additions and 2 deletions
|
@ -44,6 +44,15 @@ public class ForgeHooksClient
|
||||||
|
|
||||||
public static LinkedList<IHighlightHandler> highlightHandlers = new LinkedList<IHighlightHandler>();
|
public static LinkedList<IHighlightHandler> highlightHandlers = new LinkedList<IHighlightHandler>();
|
||||||
public static LinkedList<IRenderWorldLastHandler> renderWorldLastHandlers = new LinkedList<IRenderWorldLastHandler>();
|
public static LinkedList<IRenderWorldLastHandler> renderWorldLastHandlers = new LinkedList<IRenderWorldLastHandler>();
|
||||||
|
|
||||||
|
public static void onTextureLoad(String textureName, int textureID)
|
||||||
|
{
|
||||||
|
for (ITextureLoadHandler handler: textureLoadHandlers)
|
||||||
|
{
|
||||||
|
handler.onTextureLoad(textureName, textureID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static LinkedList<ITextureLoadHandler> textureLoadHandlers = new LinkedList<ITextureLoadHandler>();
|
||||||
|
|
||||||
public static boolean canRenderInPass(Block block, int pass)
|
public static boolean canRenderInPass(Block block, int pass)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
package net.minecraft.src.forge;
|
||||||
|
|
||||||
|
public interface ITextureLoadHandler
|
||||||
|
{
|
||||||
|
public void onTextureLoad(String textureName, int textureID);
|
||||||
|
}
|
|
@ -36,6 +36,24 @@ public class MinecraftForgeClient
|
||||||
{
|
{
|
||||||
ForgeHooksClient.registerRenderContextHandler(texture, subid, handler);
|
ForgeHooksClient.registerRenderContextHandler(texture, subid, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a Texture Load Handler
|
||||||
|
* @param handler The handler
|
||||||
|
*/
|
||||||
|
public static void registerTextureLoadHandler(ITextureLoadHandler handler)
|
||||||
|
{
|
||||||
|
ForgeHooksClient.textureLoadHandlers.add(handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a Render Last Handler
|
||||||
|
* @param handler The handler
|
||||||
|
*/
|
||||||
|
public static void registerRenderLastHandler(IRenderWorldLastHandler handler)
|
||||||
|
{
|
||||||
|
ForgeHooksClient.renderWorldLastHandlers.add(handler);
|
||||||
|
}
|
||||||
|
|
||||||
/** Bind a texture. This is used to bind a texture file when
|
/** Bind a texture. This is used to bind a texture file when
|
||||||
* performing your own rendering, rather than using ITextureProvider.
|
* performing your own rendering, rather than using ITextureProvider.
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -48,7 +48,7 @@
|
@@ -14,6 +14,9 @@
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
+
|
||||||
|
+import net.minecraft.src.forge.ForgeHooksClient;
|
||||||
|
+
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
public class RenderEngine
|
||||||
|
@@ -48,7 +51,7 @@
|
||||||
public boolean blurTexture = false;
|
public boolean blurTexture = false;
|
||||||
|
|
||||||
/** Texture pack */
|
/** Texture pack */
|
||||||
|
@ -9,7 +19,7 @@
|
||||||
|
|
||||||
/** Missing texture image */
|
/** Missing texture image */
|
||||||
private BufferedImage missingTextureImage = new BufferedImage(64, 64, 2);
|
private BufferedImage missingTextureImage = new BufferedImage(64, 64, 2);
|
||||||
@@ -156,6 +156,10 @@
|
@@ -156,6 +159,10 @@
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -20,3 +30,11 @@
|
||||||
this.singleIntBuffer.clear();
|
this.singleIntBuffer.clear();
|
||||||
GLAllocation.generateTextureNames(this.singleIntBuffer);
|
GLAllocation.generateTextureNames(this.singleIntBuffer);
|
||||||
int var6 = this.singleIntBuffer.get(0);
|
int var6 = this.singleIntBuffer.get(0);
|
||||||
|
@@ -199,6 +206,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
this.textureMap.put(par1Str, Integer.valueOf(var6));
|
||||||
|
+ ForgeHooksClient.onTextureLoad(par1Str, var6);
|
||||||
|
return var6;
|
||||||
|
}
|
||||||
|
catch (Exception var5)
|
||||||
|
|
Loading…
Reference in a new issue