mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 06:53:20 +00:00
Updates:
- Added warning message for non-preloaded textures. - Documentation - Ladder fix for SMP. - Obsoleted IBlockSecondaryProperties - Added hooks for place-by-side. - Fixed texture 3 and piston texture bug. - Added new tool system.
This commit is contained in:
1 parent
fb5f9373c5
commit
12b64fa287
6 files changed
+1823
-273
No files matched your search
@@ -79,6 +79,7 @@ public class ForgeHooksClient {
|
||||
|
||||
public static void beforeRenderPass(int pass) {
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
Tessellator.renderingWorldRenderer=true;
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
@@ -100,6 +101,7 @@ public class ForgeHooksClient {
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
Tessellator.renderingWorldRenderer=false;
|
||||
}
|
||||
|
||||
public static void beforeBlockRender(Block block,
|
||||
@@ -115,7 +117,7 @@ public class ForgeHooksClient {
|
||||
RenderBlocks renderblocks) {
|
||||
if (block instanceof ITextureProvider
|
||||
&& renderblocks.overrideBlockTexture == -1) {
|
||||
Tessellator.instance=Tessellator.firstInstance;
|
||||
unbindTexture();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,20 +12,43 @@ import net.minecraft.src.Tessellator;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class MinecraftForgeClient {
|
||||
/** Bind a texture. This is used to bind a texture file when
|
||||
* performing your own rendering, rather than using ITextureProvider.
|
||||
*
|
||||
* This variation is reserved for future expansion.
|
||||
*/
|
||||
public static void bindTexture(String name, int sub) {
|
||||
ForgeHooksClient.bindTexture(name,sub);
|
||||
}
|
||||
|
||||
/** Bind a texture. This is used to bind a texture file when
|
||||
* performing your own rendering, rather than using ITextureProvider.
|
||||
*/
|
||||
public static void bindTexture(String name) {
|
||||
ForgeHooksClient.bindTexture(name,0);
|
||||
}
|
||||
|
||||
/** Unbind a texture. This binds the default texture, when you are
|
||||
* finished performing custom rendering.
|
||||
*/
|
||||
public static void unbindTexture() {
|
||||
ForgeHooksClient.unbindTexture();
|
||||
}
|
||||
|
||||
/** Preload a texture. Textures must be preloaded before the first
|
||||
* use, or they will cause visual anomalies.
|
||||
*/
|
||||
public static void preloadTexture(String texture) {
|
||||
ModLoader.getMinecraftInstance().renderEngine
|
||||
.getTexture(texture);
|
||||
}
|
||||
|
||||
/** Render a block. Render a block which may have a custom texture.
|
||||
*/
|
||||
public static void renderBlock(RenderBlocks rb, Block bl, int i, int
|
||||
j, int k) {
|
||||
ForgeHooksClient.beforeBlockRender(bl,rb);
|
||||
rb.renderBlockByRenderType(bl,i,j,k);
|
||||
ForgeHooksClient.afterBlockRender(bl,rb);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user