mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Fixes #341
This commit is contained in:
1 parent
60efdfe29a
commit
1b328f1348
1 file changed
+1
-24
@@ -12,7 +12,6 @@ import com.cricketcraft.chisel.block.BlockCarvableGlow;
|
||||
import com.cricketcraft.chisel.config.Configurations;
|
||||
import com.cricketcraft.chisel.utils.GeneralClient;
|
||||
import com.cricketcraft.ctmlib.Drawing;
|
||||
import com.cricketcraft.ctmlib.RenderBlocksCTM;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@@ -39,32 +38,10 @@ public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
Tessellator.instance.setColorOpaque_I(Configurations.configColors[world.getBlockMetadata(x, y, z)]);
|
||||
Tessellator.instance.setBrightness(0xF000F0);
|
||||
BlockCarvableGlow glow = (BlockCarvableGlow) block;
|
||||
if(glow.hasSubmapManager()){
|
||||
renderer.overrideBlockTexture = glow.getGlowTexture();
|
||||
getContext(renderer, glow, world).renderBlockAllFaces(glow, x, y, z);
|
||||
} else {
|
||||
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture());
|
||||
}
|
||||
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture());
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
private RenderBlocks getContext(RenderBlocks rendererOld, BlockCarvableGlow block, IBlockAccess world) {
|
||||
if (!rendererOld.hasOverrideBlockTexture() && block != null) {
|
||||
RenderBlocks rb = block.getSubmapManager().createRenderContext(rendererOld, block, world);
|
||||
if (rb != null && rb != rendererOld) {
|
||||
rb.blockAccess = world;
|
||||
if (rb instanceof RenderBlocksCTM) {
|
||||
RenderBlocksCTM rbctm = (RenderBlocksCTM) rb;
|
||||
rbctm.manager = rbctm.manager == null ? block.getSubmapManager() : rbctm.manager;
|
||||
rbctm.rendererOld = rbctm.rendererOld == null ? rendererOld : rbctm.rendererOld;
|
||||
}
|
||||
return rb;
|
||||
}
|
||||
}
|
||||
return rendererOld;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
|
||||
Reference in new issue
Block a user