From 5862aaf3a06dcf79c667c51655d3eb8bef2d2d95 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Fri, 1 Apr 2016 03:12:01 -0400 Subject: [PATCH] Add state param to canRenderInLayer --- .../net/minecraft/block/Block.java.patch | 16 ++++++++++++++-- .../client/renderer/chunk/RenderChunk.java.patch | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 6e5978dd0..7b605588b 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -201,7 +201,7 @@ } @SideOnly(Side.CLIENT) -@@ -844,6 +866,1179 @@ +@@ -844,6 +866,1191 @@ return "Block{" + field_149771_c.func_177774_c(this) + "}"; } @@ -1286,12 +1286,24 @@ + + /** + * Queries if this block should render in a given layer. -+ * ISmartBlockModel can use MinecraftForgeClient.getRenderLayer to alter their model based on layer ++ * ISmartBlockModel can use {@link MinecraftForgeClient#getRenderLayer()} to alter their model based on layer. ++ * ++ * @deprecated New method with state sensitivity: {@link #canRenderInLayer(IBlockState, BlockRenderLayer)} + */ ++ @Deprecated + public boolean canRenderInLayer(BlockRenderLayer layer) + { + return func_180664_k() == layer; + } ++ ++ /** ++ * Queries if this block should render in a given layer. ++ * ISmartBlockModel can use {@link MinecraftForgeClient#getRenderLayer()} to alter their model based on layer. ++ */ ++ public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) ++ { ++ return canRenderInLayer(layer); ++ } + + // For Internal use only to capture droped items inside getDrops + protected static ThreadLocal captureDrops = new ThreadLocal() diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch index 00f4a4f0e..bb29f62d1 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -26,7 +26,7 @@ - BlockRenderLayer blockrenderlayer1 = block.func_180664_k(); + for(BlockRenderLayer blockrenderlayer1 : BlockRenderLayer.values()) { -+ if(!block.canRenderInLayer(blockrenderlayer1)) continue; ++ if(!block.canRenderInLayer(iblockstate, blockrenderlayer1)) continue; + net.minecraftforge.client.ForgeHooksClient.setRenderLayer(blockrenderlayer1); int j = blockrenderlayer1.ordinal();