Completely modularize submap and RenderBlocks managing

- Fix RenderBlocksCTM ignoring the renderMin/Max values
- Add custom handler for carpet to avoid hardcoding
- TODO blocks that use existing blocks as icons, e.g. ice stairs
This commit is contained in:
tterrag1098 committed 2015-04-24 03:38:37 -04:00
1 parent bc607a3104
commit 65693b868c
23 files changed
+661 -493

No files matched your search

@@ -9,7 +9,6 @@ import org.lwjgl.opengl.GL11;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.ICarvable;
import com.cricketcraft.chisel.api.carving.IVariationInfo;
import com.cricketcraft.chisel.carving.CarvableHelper.TextureType;
import com.cricketcraft.chisel.utils.Drawing;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
@@ -38,39 +37,15 @@ public class RendererCTM implements ISimpleBlockRenderingHandler {
int meta = world.getBlockMetadata(x, y, z);
IVariationInfo var = ((ICarvable) block).getVariation(world, x, y, z, meta);
if (rendererOld.hasOverrideBlockTexture()) {
// breaking anim
rendererOld.renderStandardBlock(block, x, y, z);
return true;
if (!rendererOld.hasOverrideBlockTexture() && var != null) {
RenderBlocks rb = var.getSubmapManager().createRenderContext(rendererOld, world);
if (rb != null) {
return rb.renderStandardBlock(block, x, y, z);
}
}
switch (var == null ? TextureType.NORMAL : var.type) {
case CTMX:
rendererCTM.blockAccess = world;
rendererCTM.renderMaxX = 1.0;
rendererCTM.renderMaxY = 1.0;
rendererCTM.renderMaxZ = 1.0;
rendererCTM.submap = var.submap;
rendererCTM.submapSmall = var.submapSmall;
rendererCTM.rendererOld = rendererOld;
return rendererCTM.renderStandardBlock(block, x, y, z);
case CTMV:
rendererColumn.blockAccess = world;
rendererColumn.renderMaxX = 1.0;
rendererColumn.renderMaxY = 1.0;
rendererColumn.renderMaxZ = 1.0;
rendererColumn.submap = var.seamsCtmVert;
rendererColumn.iconTop = var.iconTop;
return rendererColumn.renderStandardBlock(block, x, y, z);
default:
return rendererOld.renderStandardBlock(block, x, y, z);
}
return rendererOld.renderStandardBlock(block, x, y, z) || rendererOld.hasOverrideBlockTexture();
}
@Override