RenderBlocksCTM will now respect the render bounds (read below)

This behavior allows for certain renderers to no longer be needed
(carpet floor) and for some rendering to be possible (CTM slabs).

A single version of marble slab has been implemented with CTM as an
example, we will move over the rest of the textures once this is
finalized.
This commit is contained in:
tterrag1098 committed 2015-04-24 16:43:30 -04:00
1 parent 3999d31342
commit 3013e263a2
17 files changed
+258 -105

No files matched your search

@@ -1,11 +1,13 @@
package com.cricketcraft.chisel.api.carving;
import net.minecraft.client.renderer.RenderBlocks;
import com.cricketcraft.chisel.api.rendering.ISubmapManager;
import com.cricketcraft.chisel.api.rendering.TextureType;
public interface IVariationInfo {
ISubmapManager getSubmapManager();
ISubmapManager<? extends RenderBlocks> getSubmapManager();
ICarvingVariation getVariation();
@@ -5,8 +5,9 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
public interface ISubmapManager {
public interface ISubmapManager<T extends RenderBlocks> {
/**
* Gets the icon for item rendering, based on side and item metadata.
@@ -36,5 +37,9 @@ public interface ISubmapManager {
*/
void registerIcons(String modName, Block block, IIconRegister register);
RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world);
T createRenderContext(RenderBlocks rendererOld, IBlockAccess world);
void preRenderSide(T renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side);
void postRenderSide(T renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side);
}
@@ -9,6 +9,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Pair;
@@ -306,7 +307,7 @@ public enum TextureType {
this.suffixes = suffixes.length == 0 ? new String[] { "" } : suffixes;
}
public ISubmapManager createManagerFor(ICarvingVariation variation, String texturePath) {
public ISubmapManager<RenderBlocks> createManagerFor(ICarvingVariation variation, String texturePath) {
return new SubmapManagerDefault(this, variation, texturePath);
}
@@ -355,7 +356,7 @@ public enum TextureType {
}
}
private static class SubmapManagerDefault implements ISubmapManager {
private static class SubmapManagerDefault implements ISubmapManager<RenderBlocks> {
private TextureType type;
private ICarvingVariation variation;
@@ -387,5 +388,13 @@ public enum TextureType {
public RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world) {
return type.createRenderContext(rendererOld, world, cachedObject);
}
@Override
public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {
}
@Override
public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {
}
}
}