mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-16 18:55:06 +00:00
Implement new voidstone animation, expose some more API methods
This commit is contained in:
1 parent
da64d4a803
commit
5b20e0728a
8 files changed
+181
-118
No files matched your search
@@ -1,16 +1,5 @@
|
||||
package com.cricketcraft.chisel;
|
||||
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.andesite;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.diorite;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.granite;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.jackolantern;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.planks;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.pumpkin;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.stainedGlass;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.stainedGlassPane;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.torches;
|
||||
import static com.cricketcraft.chisel.utils.General.sGNames;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -31,47 +20,14 @@ import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils.SimpleCarvingGroup;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
import com.cricketcraft.chisel.block.BlockAutoChisel;
|
||||
import com.cricketcraft.chisel.block.BlockBeaconBase;
|
||||
import com.cricketcraft.chisel.block.BlockCarvable;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableAntiBlock;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableBookshelf;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableCarpet;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableGlass;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableGlow;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableGlowstone;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableIce;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableIceStairs;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableLayered;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePackedIce;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePackedIceStairs;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePane;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePowered;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePumpkin;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableSlab;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableStairs;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableTorch;
|
||||
import com.cricketcraft.chisel.block.BlockCloud;
|
||||
import com.cricketcraft.chisel.block.BlockConcrete;
|
||||
import com.cricketcraft.chisel.block.BlockEldritch;
|
||||
import com.cricketcraft.chisel.block.BlockGrimstone;
|
||||
import com.cricketcraft.chisel.block.BlockHolystone;
|
||||
import com.cricketcraft.chisel.block.BlockLavastone;
|
||||
import com.cricketcraft.chisel.block.BlockLeaf;
|
||||
import com.cricketcraft.chisel.block.BlockMultiLayer;
|
||||
import com.cricketcraft.chisel.block.BlockPresent;
|
||||
import com.cricketcraft.chisel.block.BlockRoadLine;
|
||||
import com.cricketcraft.chisel.block.BlockSnakestone;
|
||||
import com.cricketcraft.chisel.block.BlockSnakestoneObsidian;
|
||||
import com.cricketcraft.chisel.block.BlockWaterstone;
|
||||
import com.cricketcraft.chisel.block.CarvableStairsMaker;
|
||||
import com.cricketcraft.chisel.block.IStairsCreator;
|
||||
import com.cricketcraft.chisel.block.*;
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
import com.cricketcraft.chisel.client.render.SubmapManagerAntiblock;
|
||||
import com.cricketcraft.chisel.client.render.SubmapManagerCarpetFloor;
|
||||
import com.cricketcraft.chisel.client.render.SubmapManagerFakeController;
|
||||
import com.cricketcraft.chisel.client.render.SubmapManagerLeaves;
|
||||
import com.cricketcraft.chisel.client.render.SubmapManagerSlab;
|
||||
import com.cricketcraft.chisel.client.render.SubmapManagerVoidstone;
|
||||
import com.cricketcraft.chisel.compat.fmp.ItemBlockChiselTorchPart;
|
||||
import com.cricketcraft.chisel.config.Configurations;
|
||||
import com.cricketcraft.chisel.entity.EntityBallOMoss;
|
||||
@@ -96,6 +52,9 @@ import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.*;
|
||||
import static com.cricketcraft.chisel.utils.General.sGNames;
|
||||
|
||||
public enum Features {
|
||||
|
||||
AE_CERTUS_QUARTZ("appliedenergistics2") {
|
||||
@@ -2702,28 +2661,28 @@ public enum Features {
|
||||
void addBlocks() {
|
||||
BlockCarvable voidstone = (BlockCarvable) new BlockCarvable().setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone)
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F);
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.0.desc", 0, "voidstone/raw");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.1.desc", 1, "voidstone/quarters");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.2.desc", 2, "voidstone/smooth");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.3.desc", 3, "voidstone/skulls");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.4.desc", 4, "voidstone/rune");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.5.desc", 5, "voidstone/metalborder");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.6.desc", 6, "voidstone/eye");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.7.desc", 7, "voidstone/bevel");
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.0.desc", 0, new SubmapManagerVoidstone("voidstone/raw"));
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.1.desc", 1, new SubmapManagerVoidstone("voidstone/quarters"));
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.2.desc", 2, new SubmapManagerVoidstone("voidstone/smooth"));
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.3.desc", 3, new SubmapManagerVoidstone("voidstone/skulls"));
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.4.desc", 4, new SubmapManagerVoidstone("voidstone/rune"));
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.5.desc", 5, new SubmapManagerVoidstone("voidstone/metalborder"));
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.6.desc", 6, new SubmapManagerVoidstone("voidstone/eye"));
|
||||
voidstone.carverHelper.addVariation("tile.voidstone.7.desc", 7, new SubmapManagerVoidstone("voidstone/bevel"));
|
||||
|
||||
voidstone.carverHelper.registerAll(voidstone, "voidstone");
|
||||
Carving.chisel.registerOre("voidstone", "voidstone");
|
||||
|
||||
BlockMultiLayer voidstone2 = (BlockMultiLayer) new BlockMultiLayer(Material.rock, Chisel.MOD_ID + ":voidstone/animated/void").setStepSound(Block.soundTypeStone)
|
||||
BlockCarvable voidstone2 = (BlockCarvable) new BlockCarvable().setStepSound(Block.soundTypeStone)
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F);
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.0.desc", 0, "voidstone/animated/raw");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.1.desc", 1, "voidstone/animated/quarters");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.2.desc", 2, "voidstone/animated/smooth");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.3.desc", 3, "voidstone/animated/skulls");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.4.desc", 4, "voidstone/animated/rune");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.5.desc", 5, "voidstone/animated/metalborder");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.6.desc", 6, "voidstone/animated/eye");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.7.desc", 7, "voidstone/animated/bevel");
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.0.desc", 0, new SubmapManagerVoidstone("voidstone/animated/raw"));
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.1.desc", 1, new SubmapManagerVoidstone("voidstone/animated/quarters"));
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.2.desc", 2, new SubmapManagerVoidstone("voidstone/animated/smooth"));
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.3.desc", 3, new SubmapManagerVoidstone("voidstone/animated/skulls"));
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.4.desc", 4, new SubmapManagerVoidstone("voidstone/animated/rune"));
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.5.desc", 5, new SubmapManagerVoidstone("voidstone/animated/metalborder"));
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.6.desc", 6, new SubmapManagerVoidstone("voidstone/animated/eye"));
|
||||
voidstone2.carverHelper.addVariation("tile.voidstone.7.desc", 7, new SubmapManagerVoidstone("voidstone/animated/bevel"));
|
||||
|
||||
voidstone2.carverHelper.registerAll(voidstone2, "voidstone2");
|
||||
Carving.chisel.registerOre("voidstone2", "voidstone2");
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
|
||||
private static double u, v, xDiff, yDiff, zDiff, uDiff, vDiff;
|
||||
|
||||
void render(RenderBlocksCTM inst, ForgeDirection normal, int cacheID) {
|
||||
@@ -66,7 +66,7 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
}
|
||||
u = cacheID == 1 || cacheID == 2 ? inst.maxU : inst.minU;
|
||||
v = cacheID < 2 ? inst.maxV : inst.minV;
|
||||
|
||||
|
||||
uDiff = inst.maxU - inst.minU;
|
||||
vDiff = inst.maxV - inst.minV;
|
||||
|
||||
@@ -289,8 +289,8 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
| ((blueBitChannel / lightVals.length) & 0xF0000) | ((sunlightBitChannel / lightVals.length) & 0xF00000);
|
||||
}
|
||||
|
||||
protected void side(SubSide side, int iconIndex) {
|
||||
|
||||
protected void side(Block block, SubSide side, int iconIndex) {
|
||||
|
||||
IIcon icon;
|
||||
TextureSubmap map;
|
||||
if (iconIndex >= 16) {
|
||||
@@ -299,9 +299,14 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
} else {
|
||||
map = submap;
|
||||
}
|
||||
int x = iconIndex % map.getWidth();
|
||||
int y = iconIndex / map.getHeight();
|
||||
icon = map.getSubIcon(x, y);
|
||||
|
||||
if (map == null) {
|
||||
icon = getBlockIconFromSide(block, side.normal.ordinal());
|
||||
} else {
|
||||
int x = iconIndex % map.getWidth();
|
||||
int y = iconIndex / map.getHeight();
|
||||
icon = map.getSubIcon(x, y);
|
||||
}
|
||||
|
||||
double umax = icon.getMaxU();
|
||||
double umin = icon.getMinU();
|
||||
@@ -346,14 +351,14 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
fillColormap(colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, blumap);
|
||||
|
||||
getLight(0, 0);
|
||||
side(XNEG_LB, tex[0]);
|
||||
side(block, XNEG_LB, tex[0]);
|
||||
getLight(1, 0);
|
||||
side(XNEG_RB, tex[1]);
|
||||
side(block, XNEG_RB, tex[1]);
|
||||
getLight(1, 1);
|
||||
side(XNEG_RT, tex[2]);
|
||||
side(block, XNEG_RT, tex[2]);
|
||||
getLight(0, 1);
|
||||
side(XNEG_LT, tex[3]);
|
||||
|
||||
side(block, XNEG_LT, tex[3]);
|
||||
|
||||
post(ForgeDirection.WEST);
|
||||
}
|
||||
}
|
||||
@@ -376,16 +381,16 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
fillColormap(colorRedTopLeft, colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, redmap);
|
||||
fillColormap(colorGreenTopLeft, colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, grnmap);
|
||||
fillColormap(colorBlueTopLeft, colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, blumap);
|
||||
|
||||
|
||||
getLight(0, 0);
|
||||
side(XPOS_LB, tex[0]);
|
||||
side(block, XPOS_LB, tex[0]);
|
||||
getLight(1, 0);
|
||||
side(XPOS_RB, tex[1]);
|
||||
side(block, XPOS_RB, tex[1]);
|
||||
getLight(1, 1);
|
||||
side(XPOS_RT, tex[2]);
|
||||
side(block, XPOS_RT, tex[2]);
|
||||
getLight(0, 1);
|
||||
side(XPOS_LT, tex[3]);
|
||||
|
||||
side(block, XPOS_LT, tex[3]);
|
||||
|
||||
post(ForgeDirection.EAST);
|
||||
}
|
||||
}
|
||||
@@ -408,16 +413,16 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
fillColormap(colorRedBottomRight, colorRedTopRight, colorRedTopLeft, colorRedBottomLeft, redmap);
|
||||
fillColormap(colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, colorGreenBottomLeft, grnmap);
|
||||
fillColormap(colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, blumap);
|
||||
|
||||
|
||||
getLight(0, 0);
|
||||
side(ZNEG_LB, tex[0]);
|
||||
side(block, ZNEG_LB, tex[0]);
|
||||
getLight(1, 0);
|
||||
side(ZNEG_RB, tex[1]);
|
||||
side(block, ZNEG_RB, tex[1]);
|
||||
getLight(1, 1);
|
||||
side(ZNEG_RT, tex[2]);
|
||||
side(block, ZNEG_RT, tex[2]);
|
||||
getLight(0, 1);
|
||||
side(ZNEG_LT, tex[3]);
|
||||
|
||||
side(block, ZNEG_LT, tex[3]);
|
||||
|
||||
post(ForgeDirection.NORTH);
|
||||
}
|
||||
}
|
||||
@@ -440,16 +445,16 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
fillColormap(colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, colorRedTopLeft, redmap);
|
||||
fillColormap(colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, grnmap);
|
||||
fillColormap(colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, blumap);
|
||||
|
||||
|
||||
getLight(0, 0);
|
||||
side(ZPOS_LB, tex[0]);
|
||||
side(block, ZPOS_LB, tex[0]);
|
||||
getLight(1, 0);
|
||||
side(ZPOS_RB, tex[1]);
|
||||
side(block, ZPOS_RB, tex[1]);
|
||||
getLight(1, 1);
|
||||
side(ZPOS_RT, tex[2]);
|
||||
side(block, ZPOS_RT, tex[2]);
|
||||
getLight(0, 1);
|
||||
side(ZPOS_LT, tex[3]);
|
||||
|
||||
side(block, ZPOS_LT, tex[3]);
|
||||
|
||||
post(ForgeDirection.SOUTH);
|
||||
}
|
||||
}
|
||||
@@ -472,16 +477,16 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
fillColormap(colorRedBottomLeft, colorRedBottomRight, colorRedTopRight, colorRedTopLeft, redmap);
|
||||
fillColormap(colorGreenBottomLeft, colorGreenBottomRight, colorGreenTopRight, colorGreenTopLeft, grnmap);
|
||||
fillColormap(colorBlueBottomLeft, colorBlueBottomRight, colorBlueTopRight, colorBlueTopLeft, blumap);
|
||||
|
||||
|
||||
getLight(0, 0);
|
||||
side(YNEG_LB, tex[0]);
|
||||
side(block, YNEG_LB, tex[0]);
|
||||
getLight(1, 0);
|
||||
side(YNEG_RB, tex[1]);
|
||||
side(block, YNEG_RB, tex[1]);
|
||||
getLight(1, 1);
|
||||
side(YNEG_RT, tex[2]);
|
||||
side(block, YNEG_RT, tex[2]);
|
||||
getLight(0, 1);
|
||||
side(YNEG_LT, tex[3]);
|
||||
|
||||
side(block, YNEG_LT, tex[3]);
|
||||
|
||||
post(ForgeDirection.DOWN);
|
||||
}
|
||||
}
|
||||
@@ -504,16 +509,16 @@ public class RenderBlocksCTM extends RenderBlocks {
|
||||
fillColormap(colorRedTopRight, colorRedTopLeft, colorRedBottomLeft, colorRedBottomRight, redmap);
|
||||
fillColormap(colorGreenTopRight, colorGreenTopLeft, colorGreenBottomLeft, colorGreenBottomRight, grnmap);
|
||||
fillColormap(colorBlueTopRight, colorBlueTopLeft, colorBlueBottomLeft, colorBlueBottomRight, blumap);
|
||||
|
||||
|
||||
getLight(0, 0);
|
||||
side(YPOS_LB, tex[0]);
|
||||
side(block, YPOS_LB, tex[0]);
|
||||
getLight(1, 0);
|
||||
side(YPOS_RB, tex[1]);
|
||||
side(block, YPOS_RB, tex[1]);
|
||||
getLight(1, 1);
|
||||
side(YPOS_RT, tex[2]);
|
||||
side(block, YPOS_RT, tex[2]);
|
||||
getLight(0, 1);
|
||||
side(YPOS_LT, tex[3]);
|
||||
|
||||
side(block, YPOS_LT, tex[3]);
|
||||
|
||||
post(ForgeDirection.UP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ public enum TextureType {
|
||||
|
||||
/* Some util stuff for shared code between v* and r* */
|
||||
|
||||
protected static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
|
||||
public static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
|
||||
int variationSize = (type == TextureType.V9) ? 3 : 2;
|
||||
|
||||
int xModulus = x % variationSize;
|
||||
@@ -299,7 +299,7 @@ public enum TextureType {
|
||||
return map.getSubIcon(index % variationSize, index / variationSize);
|
||||
}
|
||||
|
||||
protected static IIcon getRIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
|
||||
public static IIcon getRIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) {
|
||||
rand.setSeed(getCoordinateRandom(x, y, z));
|
||||
rand.nextBoolean();
|
||||
int size = type == TextureType.R4 ? 2 : type == TextureType.R9 ? 3 : 4;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.cricketcraft.chisel.client.render;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -28,29 +30,32 @@ public class RendererCTM implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
Drawing.drawBlock(block, metadata, renderer);
|
||||
IVariationInfo var = ((ICarvable) block).getVariation(new ItemStack(block, 1, metadata));
|
||||
Drawing.drawBlock(block, metadata, getContext(renderer, block, Minecraft.getMinecraft().theWorld, var, metadata));
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks rendererOld) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
IVariationInfo var = ((ICarvable) block).getVariation(world, x, y, z, meta);
|
||||
|
||||
return getContext(rendererOld, block, world, var, meta).renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
private RenderBlocks getContext(RenderBlocks rendererOld, Block block, IBlockAccess world, IVariationInfo var, int meta) {
|
||||
if (!rendererOld.hasOverrideBlockTexture() && var != null) {
|
||||
RenderBlocks rb = var.getSubmapManager().createRenderContext(rendererOld, block, world);
|
||||
if (rb != null && rb != rendererOld) {
|
||||
rb.blockAccess = world;
|
||||
if (rb instanceof RenderBlocksCTM) {
|
||||
((RenderBlocksCTM)rb).manager = var.getSubmapManager();
|
||||
((RenderBlocksCTM)rb).rendererOld = rendererOld;
|
||||
RenderBlocksCTM rbctm = (RenderBlocksCTM) rb;
|
||||
rbctm.manager = rbctm.manager == null ? var.getSubmapManager() : rbctm.manager;
|
||||
rbctm.rendererOld = rbctm.rendererOld == null ? rendererOld : rbctm.rendererOld;
|
||||
}
|
||||
return rb.renderStandardBlock(block, x, y, z);
|
||||
return rb;
|
||||
}
|
||||
}
|
||||
|
||||
return rendererOld.renderStandardBlock(block, x, y, z) || rendererOld.hasOverrideBlockTexture();
|
||||
return rendererOld;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.cricketcraft.chisel.client.render;
|
||||
|
||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||
import com.cricketcraft.chisel.api.rendering.TextureSubmap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SubmapManagerVoidstone extends SubmapManagerBase {
|
||||
|
||||
// TODO there must be a better more generic way to do this...
|
||||
@SideOnly(Side.CLIENT)
|
||||
private class RenderBlocksVoidstone extends RenderBlocks {
|
||||
|
||||
@Override
|
||||
public void renderFaceXNeg(Block block, double x, double y, double z, IIcon p_147798_8_) {
|
||||
super.renderFaceXNeg(block, x, y, z, getBase(x, y, z, ForgeDirection.WEST.ordinal()));
|
||||
super.renderFaceXNeg(block, x, y, z, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceXPos(Block block, double x, double y, double z, IIcon p_147764_8_) {
|
||||
super.renderFaceXPos(block, x, y, z, getBase(x, y, z, ForgeDirection.EAST.ordinal()));
|
||||
super.renderFaceXPos(block, x, y, z, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon p_147768_8_) {
|
||||
super.renderFaceYNeg(block, x, y, z, getBase(x, y, z, ForgeDirection.DOWN.ordinal()));
|
||||
super.renderFaceYNeg(block, x, y, z, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceYPos(Block block, double x, double y, double z, IIcon p_147806_8_) {
|
||||
super.renderFaceYPos(block, x, y, z, getBase(x, y, z, ForgeDirection.UP.ordinal()));
|
||||
super.renderFaceYPos(block, x, y, z, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceZNeg(Block block, double x, double y, double z, IIcon p_147761_8_) {
|
||||
super.renderFaceZNeg(block, x, y, z, getBase(x, y, z, ForgeDirection.NORTH.ordinal()));
|
||||
super.renderFaceZNeg(block, x, y, z, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFaceZPos(Block block, double x, double y, double z, IIcon p_147734_8_) {
|
||||
super.renderFaceZPos(block, x, y, z, getBase(x, y, z, ForgeDirection.SOUTH.ordinal()));
|
||||
super.renderFaceZPos(block, x, y, z, icon);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private RenderBlocks rb;
|
||||
|
||||
private IIcon icon;
|
||||
private TextureSubmap base;
|
||||
|
||||
private IIcon getBase(double x, double y, double z, int side) {
|
||||
return TextureType.getVIcon(TextureType.V4, base, MathHelper.floor_double(x), MathHelper.floor_double(y), MathHelper.floor_double(z), side);
|
||||
}
|
||||
|
||||
private String texture;
|
||||
|
||||
public SubmapManagerVoidstone(String texture) {
|
||||
this.texture = texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||
icon = register.registerIcon(modName + ":" + texture);
|
||||
base = new TextureSubmap(register.registerIcon(modName + ":" + "animations/hadesX32"), 2, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||
if (rb == null) {
|
||||
rb = new RenderBlocksVoidstone();
|
||||
}
|
||||
rb.setRenderBoundsFromBlock(block);
|
||||
return rb;
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public final class ChiselBlocks {
|
||||
public static final BlockCarvable laboratoryblock = null;
|
||||
|
||||
public static final BlockCarvable voidstone = null;
|
||||
public static final BlockMultiLayer voidstone2 = null;
|
||||
public static final BlockCarvable voidstone2 = null;
|
||||
public static final BlockCarvable voidstonerunic = null;
|
||||
public static final BlockCarvable voidstonePillar = null;
|
||||
public static final BlockCarvable voidstonePillar2 = null;
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
ItemChiselRenderer renderer = new ItemChiselRenderer();
|
||||
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user