mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 00:07:37 +00:00
Fix chisel using its own render pass variable
This commit is contained in:
1 parent
2bdb6ef9c0
commit
fdc0171abe
2 files changed
+4
-5
No files matched your search
@@ -4,12 +4,12 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import com.cricketcraft.chisel.client.render.RendererMultiLayer;
|
||||
|
||||
public abstract class BlockMultiLayerBase extends Block {
|
||||
|
||||
public int currentPass;
|
||||
public Block base;
|
||||
public IIcon icon;
|
||||
String iconFile;
|
||||
@@ -43,8 +43,7 @@ public abstract class BlockMultiLayerBase extends Block {
|
||||
|
||||
@Override
|
||||
public boolean canRenderInPass(int pass) {
|
||||
currentPass = pass;
|
||||
|
||||
ForgeHooksClient.setRenderPass(pass);
|
||||
return pass == 1 || pass == 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
|
||||
@@ -52,7 +52,7 @@ public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
|
||||
return false;
|
||||
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
|
||||
|
||||
if (block.currentPass == 0) {
|
||||
if (MinecraftForgeClient.getRenderPass() == 0) {
|
||||
if (block.icon != null) {
|
||||
renderer.overrideBlockTexture = block.icon;
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
Reference in new issue
Block a user