mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-26 15:03:09 +00:00
More work on "framed" drawers.
This commit is contained in:
1 parent
0a290d8c66
commit
4f77c91f9b
10 files changed
+399
-28
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 316 B |
Binary file not shown.
|
After Width: | Height: | Size: 320 B |
Binary file not shown.
|
After Width: | Height: | Size: 340 B |
Binary file not shown.
|
After Width: | Height: | Size: 324 B |
@@ -23,7 +23,6 @@ public class BlockDrawersCustom extends BlockDrawers
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon overlayTrimShadow;
|
||||
|
||||
|
||||
public BlockDrawersCustom (String blockName, int drawerCount, boolean halfDepth) {
|
||||
super(blockName, drawerCount, halfDepth);
|
||||
}
|
||||
@@ -50,24 +49,6 @@ public class BlockDrawersCustom extends BlockDrawers
|
||||
list.add(new ItemStack(item));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconTrim (int meta) {
|
||||
return Blocks.planks.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta) {
|
||||
return Blocks.planks.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
return Blocks.planks.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getHandleOverlay () {
|
||||
return overlayHandle;
|
||||
@@ -91,5 +72,13 @@ public class BlockDrawersCustom extends BlockDrawers
|
||||
overlayHandle = register.registerIcon(StorageDrawers.MOD_ID + ":overlay/handle_" + drawerCount);
|
||||
overlayFaceShadow = register.registerIcon(StorageDrawers.MOD_ID + ":overlay/shading_face_" + drawerCount);
|
||||
overlayTrimShadow = register.registerIcon(StorageDrawers.MOD_ID + ":overlay/shading_trim_" + drawerCount);
|
||||
|
||||
iconSide[0] = register.registerIcon(StorageDrawers.MOD_ID + ":drawers_raw_side");
|
||||
iconSideV[0] = register.registerIcon(StorageDrawers.MOD_ID + ":drawers_raw_side");
|
||||
iconSideH[0] = register.registerIcon(StorageDrawers.MOD_ID + ":drawers_raw_side");
|
||||
iconTrim[0] = register.registerIcon(StorageDrawers.MOD_ID + ":drawers_raw_side");
|
||||
iconFront1[0] = register.registerIcon(StorageDrawers.MOD_ID + ":drawers_raw_front_1");
|
||||
iconFront2[0] = register.registerIcon(StorageDrawers.MOD_ID + ":drawers_raw_front_2");
|
||||
iconFront4[0] = register.registerIcon(StorageDrawers.MOD_ID + ":drawers_raw_front_4");
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,9 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
|
||||
|
||||
private String customName;
|
||||
|
||||
private NBTTagCompound failureSnapshot;
|
||||
private ItemStack materialSide;
|
||||
private ItemStack materialFront;
|
||||
private ItemStack materialTrim;
|
||||
|
||||
protected TileEntityDrawers (int drawerCount) {
|
||||
initWithDrawerCount(drawerCount);
|
||||
@@ -303,6 +305,30 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack getMaterialSide () {
|
||||
return materialSide;
|
||||
}
|
||||
|
||||
public ItemStack getMaterialFront () {
|
||||
return materialFront;
|
||||
}
|
||||
|
||||
public ItemStack getMaterialTrim () {
|
||||
return materialTrim;
|
||||
}
|
||||
|
||||
public void setMaterialSide (ItemStack material) {
|
||||
materialSide = material;
|
||||
}
|
||||
|
||||
public void setMaterialFront (ItemStack material) {
|
||||
materialFront = material;
|
||||
}
|
||||
|
||||
public void setMaterialTrim (ItemStack material) {
|
||||
materialTrim = material;
|
||||
}
|
||||
|
||||
public ItemStack takeItemsFromSlot (int slot, int count) {
|
||||
if (slot < 0 || slot >= getDrawerCount())
|
||||
return null;
|
||||
@@ -472,6 +498,18 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
|
||||
}
|
||||
|
||||
inventory = new StorageInventory(this, getSideManager(), this);
|
||||
|
||||
materialSide = null;
|
||||
if (tag.hasKey("MatS"))
|
||||
materialSide = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("MatS"));
|
||||
|
||||
materialFront = null;
|
||||
if (tag.hasKey("MatF"))
|
||||
materialFront = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("MatF"));
|
||||
|
||||
materialTrim = null;
|
||||
if (tag.hasKey("MatT"))
|
||||
materialTrim = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("MatT"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -507,6 +545,24 @@ public abstract class TileEntityDrawers extends BaseTileEntity implements IDrawe
|
||||
}
|
||||
|
||||
tag.setTag("Slots", slots);
|
||||
|
||||
if (materialSide != null) {
|
||||
NBTTagCompound itag = new NBTTagCompound();
|
||||
materialSide.writeToNBT(itag);
|
||||
tag.setTag("MatS", itag);
|
||||
}
|
||||
|
||||
if (materialFront != null) {
|
||||
NBTTagCompound itag = new NBTTagCompound();
|
||||
materialFront.writeToNBT(itag);
|
||||
tag.setTag("MatF", itag);
|
||||
}
|
||||
|
||||
if (materialTrim != null) {
|
||||
NBTTagCompound itag = new NBTTagCompound();
|
||||
materialTrim.writeToNBT(itag);
|
||||
tag.setTag("MatT", itag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+20
-6
@@ -5,8 +5,10 @@ import com.jaquadro.minecraft.storagedrawers.block.BlockDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.BlockDrawersCustom;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.core.ClientProxy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class DrawersCustomRenderer extends DrawersRenderer
|
||||
@@ -17,12 +19,24 @@ public class DrawersCustomRenderer extends DrawersRenderer
|
||||
protected void renderBaseBlock (IBlockAccess world, TileEntityDrawers tile, int x, int y, int z, BlockDrawers block, RenderBlocks renderer) {
|
||||
BlockDrawersCustom custom = (BlockDrawersCustom)block;
|
||||
|
||||
panelRenderer.setTrimWidth(block.trimWidth);
|
||||
ItemStack materialSide = tile.getMaterialSide();
|
||||
if (materialSide == null)
|
||||
materialSide = new ItemStack(block);
|
||||
|
||||
ItemStack materialFront = tile.getMaterialFront();
|
||||
if (materialFront == null)
|
||||
materialFront = materialSide;
|
||||
|
||||
ItemStack materialTrim = tile.getMaterialTrim();
|
||||
if (materialTrim == null)
|
||||
materialTrim = materialSide;
|
||||
|
||||
panelRenderer.setTrimWidth(block.getTrimWidth());
|
||||
panelRenderer.setTrimDepth(0);
|
||||
panelRenderer.setTrimColor(ModularBoxRenderer.COLOR_WHITE);
|
||||
panelRenderer.setTrimIcon(Blocks.lapis_block.getIcon(0, 0));
|
||||
panelRenderer.setTrimIcon(Block.getBlockFromItem(materialTrim.getItem()).getIcon(0, materialTrim.getItemDamage()));
|
||||
panelRenderer.setPanelColor(ModularBoxRenderer.COLOR_WHITE);
|
||||
panelRenderer.setPanelIcon(Blocks.planks.getIcon(0, 0));
|
||||
panelRenderer.setPanelIcon(Block.getBlockFromItem(materialSide.getItem()).getIcon(0, materialSide.getItemDamage()));
|
||||
|
||||
if (ClientProxy.renderPass == 0) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
@@ -33,15 +47,15 @@ public class DrawersCustomRenderer extends DrawersRenderer
|
||||
panelRenderer.renderFacePanel(i, world, block, x, y, z, 0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
|
||||
panelRenderer.setPanelIcon(Blocks.planks.getIcon(0, 2));
|
||||
panelRenderer.setTrimDepth(block.trimDepth);
|
||||
panelRenderer.setPanelIcon(Block.getBlockFromItem(materialFront.getItem()).getIcon(4, materialFront.getItemDamage()));
|
||||
panelRenderer.setTrimDepth(block.getTrimDepth());
|
||||
|
||||
panelRenderer.renderFaceTrim(2, world, block, x, y, z, 0, 0, 0, 1, 1, 1);
|
||||
panelRenderer.renderInteriorTrim(2, world, block, x, y, z, 0, 0, 0, 1, 1, 1);
|
||||
panelRenderer.renderFacePanel(2, world, block, x, y, z, 0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
else if (ClientProxy.renderPass == 1) {
|
||||
panelRenderer.setTrimDepth(block.trimDepth);
|
||||
panelRenderer.setTrimDepth(block.getTrimDepth());
|
||||
panelRenderer.setTrimIcon(custom.getTrimShadowOverlay());
|
||||
panelRenderer.renderFaceTrim(2, world, block, x, y, z, 0, 0, 0, 1, 1, 1);
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ public class DrawersRenderer implements ISimpleBlockRenderingHandler
|
||||
renderInterior(block, x, y, z, side, renderer);
|
||||
|
||||
if (renderer.overrideBlockTexture != null && renderer.overrideBlockTexture.getIconName().startsWith("destroy_stage"))
|
||||
return true;
|
||||
return;
|
||||
|
||||
if (StorageDrawers.config.cache.enableIndicatorUpgrades)
|
||||
renderIndicator(block, x, y, z, side, renderer, tile.getEffectiveStatusLevel());
|
||||
@@ -159,7 +159,7 @@ public class DrawersRenderer implements ISimpleBlockRenderingHandler
|
||||
|
||||
renderShroud(block, x, y, z, side, renderer, tile.isShrouded());
|
||||
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
private void renderLock (BlockDrawers block, int x, int y, int z, int side, RenderBlocks renderer, boolean locked) {
|
||||
|
||||
@@ -0,0 +1,309 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.client.renderer;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.util.RenderHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class PanelBoxRenderer
|
||||
{
|
||||
public static final int FACE_YNEG = 0;
|
||||
public static final int FACE_YPOS = 1;
|
||||
public static final int FACE_ZNEG = 2;
|
||||
public static final int FACE_ZPOS = 3;
|
||||
public static final int FACE_XNEG = 4;
|
||||
public static final int FACE_XPOS = 5;
|
||||
|
||||
private static final int TRIM_CUT = ModularBoxRenderer.CUT_XNEG | ModularBoxRenderer.CUT_YNEG | ModularBoxRenderer.CUT_ZNEG
|
||||
| ModularBoxRenderer.CUT_XPOS | ModularBoxRenderer.CUT_YPOS | ModularBoxRenderer.CUT_ZPOS;
|
||||
|
||||
private ModularBoxRenderer trimRenderer = new ModularBoxRenderer();
|
||||
|
||||
private double trimWidth = 0.0625;
|
||||
private double trimDepth = 0;
|
||||
|
||||
private float[] trimColor = new float[3];
|
||||
private IIcon trimIcon;
|
||||
|
||||
private float[] panelColor = new float[3];
|
||||
private IIcon panelIcon;
|
||||
|
||||
public void setTrimWidth (double width) {
|
||||
trimWidth = width;
|
||||
}
|
||||
|
||||
public void setTrimDepth (double depth) {
|
||||
trimDepth = depth;
|
||||
}
|
||||
|
||||
public void setTrimIcon (IIcon icon) {
|
||||
trimIcon = icon;
|
||||
}
|
||||
|
||||
public void setTrimColor (float[] color) {
|
||||
copyFrom(trimColor, color);
|
||||
}
|
||||
|
||||
public void setPanelIcon (IIcon icon) {
|
||||
panelIcon = icon;
|
||||
}
|
||||
|
||||
public void setPanelColor (float[] color) {
|
||||
copyFrom(panelColor, color);
|
||||
}
|
||||
|
||||
public void renderFacePanel (int face, IBlockAccess blockAccess, Block block, double x, double y, double z, double xNeg, double yNeg, double zNeg, double xPos, double yPos, double zPos) {
|
||||
RenderHelper renderer = RenderHelper.instance;
|
||||
|
||||
switch (face) {
|
||||
case FACE_YNEG:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg + trimDepth, zNeg + trimWidth, xPos - trimWidth, yNeg + trimDepth, zPos - trimWidth);
|
||||
renderPaneltFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_YPOS:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yPos - trimDepth, zNeg + trimWidth, xPos - trimWidth, yPos - trimDepth, zPos - trimWidth);
|
||||
renderPaneltFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_ZNEG:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg + trimWidth, zNeg + trimDepth, xPos - trimWidth, yPos - trimWidth, zNeg + trimDepth);
|
||||
renderPaneltFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_ZPOS:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg + trimWidth, zPos - trimDepth, xPos - trimWidth, yPos - trimWidth, zPos - trimDepth);
|
||||
renderPaneltFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_XNEG:
|
||||
renderer.setRenderBounds(xNeg + trimDepth, yNeg + trimWidth, zNeg + trimWidth, xNeg + trimDepth, yPos - trimWidth, zPos - trimWidth);
|
||||
renderPaneltFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_XPOS:
|
||||
renderer.setRenderBounds(xPos - trimDepth, yNeg + trimWidth, zNeg + trimWidth, xPos - trimDepth, yPos - trimWidth, zPos - trimWidth);
|
||||
renderPaneltFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void renderInteriorTrim (int face, IBlockAccess blockAccess, Block block, double x, double y, double z, double xNeg, double yNeg, double zNeg, double xPos, double yPos, double zPos) {
|
||||
RenderHelper renderer = RenderHelper.instance;
|
||||
|
||||
switch (face) {
|
||||
case FACE_YNEG:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg, zPos - trimWidth, xPos - trimWidth, yNeg + trimDepth, zPos - trimWidth);
|
||||
renderCutFace(FACE_ZNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg, zNeg + trimWidth, xPos - trimWidth, yNeg + trimDepth, zNeg + trimWidth);
|
||||
renderCutFace(FACE_ZPOS, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - trimWidth, yNeg, zNeg + trimWidth, xPos - trimWidth, yNeg + trimDepth, zPos - trimWidth);
|
||||
renderCutFace(FACE_XNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg, zNeg + trimWidth, xNeg + trimWidth, yNeg + trimDepth, zPos - trimWidth);
|
||||
renderCutFace(FACE_XPOS, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_YPOS:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yPos - trimDepth, zPos - trimWidth, xPos - trimWidth, yPos, zPos - trimWidth);
|
||||
renderCutFace(FACE_ZNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yPos - trimDepth, zNeg + trimWidth, xPos - trimWidth, yPos, zNeg + trimWidth);
|
||||
renderCutFace(FACE_ZPOS, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - trimWidth, yPos - trimDepth, zNeg + trimWidth, xPos - trimWidth, yPos, zPos - trimWidth);
|
||||
renderCutFace(FACE_XNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yPos - trimDepth, zNeg + trimWidth, xNeg + trimWidth, yPos, zPos - trimWidth);
|
||||
renderCutFace(FACE_XPOS, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_ZNEG:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yPos - trimWidth, zNeg, xPos - trimWidth, yPos - trimWidth, zNeg + trimDepth);
|
||||
renderCutFace(FACE_YNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg + trimWidth, zNeg, xPos - trimWidth, yNeg + trimWidth, zNeg + trimDepth);
|
||||
renderCutFace(FACE_YPOS, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - trimWidth, yNeg + trimWidth, zNeg, xPos - trimWidth, yPos - trimWidth, zNeg + trimDepth);
|
||||
renderCutFace(FACE_XNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg + trimWidth, zNeg, xNeg + trimWidth, yPos - trimWidth, zNeg + trimDepth);
|
||||
renderCutFace(FACE_XPOS, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_ZPOS:
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yPos - trimWidth, zPos - trimDepth, xPos - trimWidth, yPos - trimWidth, zPos);
|
||||
renderCutFace(FACE_YNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg + trimWidth, zPos - trimDepth, xPos - trimWidth, yNeg + trimWidth, zPos);
|
||||
renderCutFace(FACE_YPOS, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - trimWidth, yNeg + trimWidth, zPos - trimDepth, xPos - trimWidth, yPos - trimWidth, zPos);
|
||||
renderCutFace(FACE_XNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + trimWidth, yNeg + trimWidth, zPos - trimDepth, xNeg + trimWidth, yPos - trimWidth, zPos);
|
||||
renderCutFace(FACE_XPOS, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_XNEG:
|
||||
renderer.setRenderBounds(xNeg, yNeg + trimWidth, zPos - trimWidth, xNeg + trimDepth, yPos - trimWidth, zPos - trimWidth);
|
||||
renderCutFace(FACE_ZNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg + trimWidth, zNeg + trimWidth, xNeg + trimDepth, yPos - trimWidth, zNeg + trimWidth);
|
||||
renderCutFace(FACE_ZPOS, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos - trimWidth, zNeg + trimWidth, xNeg + trimDepth, yPos - trimWidth, zPos - trimWidth);
|
||||
renderCutFace(FACE_YNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg + trimWidth, zNeg + trimWidth, xNeg + trimDepth, yNeg + trimWidth, zPos - trimWidth);
|
||||
renderCutFace(FACE_YPOS, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_XPOS:
|
||||
renderer.setRenderBounds(xPos - trimDepth, yNeg + trimWidth, zPos - trimWidth, xPos, yPos - trimWidth, zPos - trimWidth);
|
||||
renderCutFace(FACE_ZNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - trimDepth, yNeg + trimWidth, zNeg + trimWidth, xPos, yPos - trimWidth, zNeg + trimWidth);
|
||||
renderCutFace(FACE_ZPOS, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - trimDepth, yPos - trimWidth, zNeg + trimWidth, xPos, yPos - trimWidth, zPos - trimWidth);
|
||||
renderCutFace(FACE_YNEG, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - trimDepth, yNeg + trimWidth, zNeg + trimWidth, xPos, yNeg + trimWidth, zPos - trimWidth);
|
||||
renderCutFace(FACE_YPOS, blockAccess, block, x, y, z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void renderFaceTrim (int face, IBlockAccess blockAccess, Block block, double x, double y, double z, double xNeg, double yNeg, double zNeg, double xPos, double yPos, double zPos) {
|
||||
double unit = trimWidth;
|
||||
RenderHelper renderer = RenderHelper.instance;
|
||||
|
||||
switch (face) {
|
||||
case FACE_YNEG:
|
||||
renderer.setRenderBounds(xNeg, yNeg, zNeg, xNeg + unit, yNeg, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yNeg, zNeg, xPos, yNeg, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg, zPos - unit, xNeg + unit, yNeg, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yNeg, zPos - unit, xPos, yNeg, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(xNeg + unit, yNeg, zNeg, xPos - unit, yNeg, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + unit, yNeg, zPos - unit, xPos - unit, yNeg, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg, zNeg + unit, xNeg + unit, yNeg, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yNeg, zNeg + unit, xPos, yNeg, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_YPOS:
|
||||
renderer.setRenderBounds(xNeg, yPos, zNeg, xNeg + unit, yPos, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yPos, zNeg, xPos, yPos, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos, zPos - unit, xNeg + unit, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yPos, zPos - unit, xPos, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(xNeg + unit, yPos, zNeg, xPos - unit, yPos, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + unit, yPos, zPos - unit, xPos - unit, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos, zNeg + unit, xNeg + unit, yPos, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yPos, zNeg + unit, xPos, yPos, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_ZNEG:
|
||||
renderer.setRenderBounds(xNeg, yNeg, zNeg, xNeg + unit, yNeg + unit, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yNeg, zNeg, xPos, yNeg + unit, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos - unit, zNeg, xNeg + unit, yPos, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yPos - unit, zNeg, xPos, yPos, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(xNeg + unit, yNeg, zNeg, xPos - unit, yNeg + unit, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + unit, yPos - unit, zNeg, xPos - unit, yPos, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg + unit, zNeg, xNeg + unit, yPos - unit, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yNeg + unit, zNeg, xPos, yPos - unit, zNeg);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_ZPOS:
|
||||
renderer.setRenderBounds(xNeg, yNeg, zPos, xNeg + unit, yNeg + unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yNeg, zPos, xPos, yNeg + unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos - unit, zPos, xNeg + unit, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yPos - unit, zPos, xPos, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(xNeg + unit, yNeg, zPos, xPos - unit, yNeg + unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg + unit, yPos - unit, zPos, xPos - unit, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg + unit, zPos, xNeg + unit, yPos - unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos - unit, yNeg + unit, zPos, xPos, yPos - unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_XNEG:
|
||||
renderer.setRenderBounds(xNeg, yNeg, zNeg, xNeg, yNeg + unit, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos - unit, zNeg, xNeg, yPos, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg, zPos - unit, xNeg, yNeg + unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos - unit, zPos - unit, xNeg, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(xNeg, yNeg + unit, zNeg, xNeg, yPos - unit, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg + unit, zPos - unit, xNeg, yPos - unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yNeg, zNeg + unit, xNeg, yNeg + unit, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xNeg, yPos - unit, zNeg + unit, xNeg, yPos, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
|
||||
case FACE_XPOS:
|
||||
renderer.setRenderBounds(xPos, yNeg, zNeg, xPos, yNeg + unit, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos, yPos - unit, zNeg, xPos, yPos, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos, yNeg, zPos - unit, xPos, yNeg + unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos, yPos - unit, zPos - unit, xPos, yPos, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
|
||||
renderer.setRenderBounds(xPos, yNeg + unit, zNeg, xPos, yPos - unit, zNeg + unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos, yNeg + unit, zPos - unit, xPos, yPos - unit, zPos);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos, yNeg, zNeg + unit, xPos, yNeg + unit, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
renderer.setRenderBounds(xPos, yPos - unit, zNeg + unit, xPos, yPos, zPos - unit);
|
||||
renderCutFace(face, blockAccess, block, x, y, z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderCutFace (int face, IBlockAccess blockAccess, Block block, double x, double y, double z) {
|
||||
RenderHelper.instance.renderFace(face, blockAccess, block, (int)x, (int)y, (int)z, trimIcon, trimColor[0], trimColor[1], trimColor[2]);
|
||||
}
|
||||
|
||||
private void renderPaneltFace (int face, IBlockAccess blockAccess, Block block, double x, double y, double z) {
|
||||
RenderHelper.instance.renderFace(face, blockAccess, block, (int)x, (int)y, (int)z, panelIcon, panelColor[0], panelColor[1], panelColor[2]);
|
||||
}
|
||||
|
||||
private void copyFrom (float[] target, float[] source) {
|
||||
target[0] = source[0];
|
||||
target[1] = source[1];
|
||||
target[2] = source[2];
|
||||
}
|
||||
|
||||
private void copyFrom (float[] target, float r, float g, float b) {
|
||||
target[0] = r;
|
||||
target[1] = g;
|
||||
target[2] = b;
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,7 @@ public class ModBlocks
|
||||
public static BlockSlave controllerSlave;
|
||||
|
||||
public static BlockDrawersCustom fullCustom1;
|
||||
public static BlockDrawersCustom fullCustom2;
|
||||
|
||||
public void init () {
|
||||
fullDrawers1 = new BlockDrawers("fullDrawers1", 1, false);
|
||||
@@ -43,6 +44,7 @@ public class ModBlocks
|
||||
controllerSlave = new BlockSlave("controllerSlave");
|
||||
|
||||
fullCustom1 = new BlockDrawersCustom("fullCustom1", 1, false);
|
||||
fullCustom2 = new BlockDrawersCustom("fullCustom2", 2, false);
|
||||
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
|
||||
@@ -66,6 +68,7 @@ public class ModBlocks
|
||||
GameRegistry.registerBlock(trim, ItemTrim.class, "trim");
|
||||
|
||||
GameRegistry.registerBlock(fullCustom1, ItemDrawers.class, "fullCustom1");
|
||||
GameRegistry.registerBlock(fullCustom2, ItemDrawers.class, "fullCustom2");
|
||||
|
||||
GameRegistry.registerTileEntityWithAlternatives(TileEntityDrawersStandard.class, getQualifiedName("tileDrawersStandard"),
|
||||
getQualifiedName(fullDrawers1), getQualifiedName(fullDrawers2), getQualifiedName(fullDrawers4),
|
||||
|
||||
Reference in new issue
Block a user