Updated Multiblock Controller textures, added multi-meta capability to Connected Texture Renderer

This commit is contained in:
Aidan Brady 2014-08-02 11:16:14 -04:00
parent 19cfb7b8d6
commit 33970b6bf7
4 changed files with 8 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package mekanism.common;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import mekanism.api.Coord4D;
@ -17,13 +18,13 @@ public class ConnectedTextureRenderer
public static final byte[][] sideEdges = {{2, 5, 3, 4}, {2, 5, 3, 4}, {1, 4, 0, 5}, {1, 5, 0, 4}, {1, 3, 0, 2}, {1, 2, 0, 3}};
public Block block;
public int metadata;
public List<Integer> metadata;
public String iconTitle;
public Map<Integer, IIcon> glassMap = new HashMap<Integer, IIcon>();
public ConnectedTextureRenderer(String title, Block b, int meta)
public ConnectedTextureRenderer(String title, Block b, List<Integer> meta)
{
iconTitle = title;
block = b;
@ -114,13 +115,13 @@ public class ConnectedTextureRenderer
Coord4D coord = obj.getFromSide(ForgeDirection.getOrientation(side));
Coord4D coordAbove = obj.getFromSide(ForgeDirection.getOrientation(face));
return (coord.getBlock(access) == block && coord.getMetadata(access) == metadata) && (coordAbove.getBlock(access) != block || coordAbove.getMetadata(access) != metadata);
return (coord.getBlock(access) == block && metadata.contains(coord.getMetadata(access))) && (coordAbove.getBlock(access) != block || metadata.contains(coordAbove.getMetadata(access)));
}
@SideOnly(Side.CLIENT)
public boolean shouldRenderSide(IBlockAccess world, int x, int y, int z, int side)
{
Coord4D obj = new Coord4D(x, y, z).getFromSide(ForgeDirection.getOrientation(side).getOpposite());
return obj.getBlock(world) != block || obj.getMetadata(world) != metadata;
return obj.getBlock(world) != block || metadata.contains(obj.getMetadata(world));
}
}

View file

@ -1,6 +1,7 @@
package mekanism.common.block;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
@ -19,8 +20,8 @@ import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.tile.TileEntityBin;
import mekanism.common.tile.TileEntityDynamicTank;
import mekanism.common.tile.TileEntityDynamicValve;
import mekanism.common.tile.TileEntitySalinationController;
import mekanism.common.tile.TileEntitySalinationBlock;
import mekanism.common.tile.TileEntitySalinationController;
import mekanism.common.tile.TileEntitySalinationValve;
import mekanism.common.util.MekanismUtils;
import net.minecraft.block.Block;
@ -74,7 +75,7 @@ public class BlockBasic extends Block
{
public IIcon[][] icons = new IIcon[256][6];
public ConnectedTextureRenderer glassRenderer = new ConnectedTextureRenderer("glass/DynamicGlass", this, 10);
public ConnectedTextureRenderer glassRenderer = new ConnectedTextureRenderer("glass/DynamicGlass", this, Arrays.asList(10));
public BlockBasic()
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB