Added connected textures for the lesu
This commit is contained in:
parent
f889b9a051
commit
f5c31a6a31
4 changed files with 687 additions and 23 deletions
|
@ -17,7 +17,7 @@ import net.minecraft.world.IBlockAccess;
|
|||
import net.minecraft.world.World;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.client.texture.ConnectedTexture;
|
||||
import techreborn.client.texture.ConnectedTextureGenerator;
|
||||
import techreborn.client.texture.CasingConnectedTextureGenerator;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -95,11 +95,11 @@ public class BlockMachineCasing extends BlockMultiblockBase {
|
|||
public IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta) {
|
||||
if (iconRegister instanceof TextureMap) {
|
||||
TextureMap map = (TextureMap) iconRegister;
|
||||
String name = ConnectedTextureGenerator.getDerivedName(types[meta] + "." + texNum);
|
||||
String name = CasingConnectedTextureGenerator.getDerivedName(types[meta] + "." + texNum);
|
||||
System.out.println(name);
|
||||
TextureAtlasSprite texture = map.getTextureExtry(name);
|
||||
if (texture == null) {
|
||||
texture = new ConnectedTextureGenerator(name, types[meta], connectedTexture);
|
||||
texture = new CasingConnectedTextureGenerator(name, types[meta], connectedTexture);
|
||||
map.setTextureEntry(name, texture);
|
||||
}
|
||||
return map.getTextureExtry(name);
|
||||
|
|
|
@ -5,6 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -12,18 +14,13 @@ import net.minecraft.util.IIcon;
|
|||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.blocks.BlockMachineBase;
|
||||
import techreborn.client.texture.ConnectedTexture;
|
||||
import techreborn.client.texture.LesuConnectedTextureGenerator;
|
||||
import techreborn.tiles.lesu.TileLesuStorage;
|
||||
|
||||
public class BlockLesuStorage extends BlockMachineBase {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconBottom;
|
||||
public IIcon[][] icons;
|
||||
|
||||
public BlockLesuStorage(Material material) {
|
||||
super(material);
|
||||
|
@ -32,20 +29,54 @@ public class BlockLesuStorage extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister icon) {
|
||||
this.blockIcon = icon.registerIcon("techreborn:machine/lesu_block");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/lesu_block");
|
||||
this.iconTop = icon.registerIcon("techreborn:machine/lesu_block");
|
||||
this.iconBottom = icon.registerIcon("techreborn:machine/lesu_block");
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.icons = new IIcon[1][16];
|
||||
// up down left right
|
||||
int i = 0;
|
||||
icons[i][0] = genIcon(new ConnectedTexture(true, true, true, true), iconRegister, 0, i);
|
||||
icons[i][1] = genIcon(new ConnectedTexture(true, false, true, true), iconRegister, 1, i);
|
||||
icons[i][2] = genIcon(new ConnectedTexture(false, true, true, true), iconRegister, 2, i);
|
||||
icons[i][3] = genIcon(new ConnectedTexture(true, true, true, false), iconRegister, 3, i);
|
||||
icons[i][4] = genIcon(new ConnectedTexture(true, true, false, true), iconRegister, 4, i);
|
||||
icons[i][5] = genIcon(new ConnectedTexture(true, true, false, false), iconRegister, 5, i);
|
||||
icons[i][6] = genIcon(new ConnectedTexture(false, false, true, true), iconRegister, 6, i);
|
||||
icons[i][7] = genIcon(new ConnectedTexture(false, true, false, true), iconRegister, 7, i);
|
||||
icons[i][8] = genIcon(new ConnectedTexture(false, true, true, false), iconRegister, 8, i);
|
||||
icons[i][9] = genIcon(new ConnectedTexture(true, false, false, true), iconRegister, 9, i);
|
||||
icons[i][10] = genIcon(new ConnectedTexture(true, false, true, false), iconRegister, 10, i);
|
||||
icons[i][11] = genIcon(new ConnectedTexture(false, true, false, false), iconRegister, 11, i);
|
||||
icons[i][12] = genIcon(new ConnectedTexture(true, false, false, false), iconRegister, 12, i);
|
||||
icons[i][13] = genIcon(new ConnectedTexture(false, false, false, true), iconRegister, 13, i);
|
||||
icons[i][14] = genIcon(new ConnectedTexture(false, false, true, false), iconRegister, 14, i);
|
||||
icons[i][15] = genIcon(new ConnectedTexture(false, false, false, false), iconRegister, 15, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
int metadata = getTileRotation((World) blockAccess, x, y, z);
|
||||
return metadata == 0 && side == 3 ? this.iconFront
|
||||
: side == 1 ? this.iconTop :
|
||||
side == 0 ? this.iconBottom : (side == 0 ? this.iconTop
|
||||
: (side == metadata ? this.iconFront : this.blockIcon));
|
||||
return getConnectedBlockTexture(blockAccess, x, y, z, side, icons[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[0][0];
|
||||
}
|
||||
|
||||
|
||||
public IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta) {
|
||||
if (iconRegister instanceof TextureMap) {
|
||||
TextureMap map = (TextureMap) iconRegister;
|
||||
String name = LesuConnectedTextureGenerator.getDerivedName("lesu." + texNum);
|
||||
System.out.println(name);
|
||||
TextureAtlasSprite texture = map.getTextureExtry(name);
|
||||
if (texture == null) {
|
||||
texture = new LesuConnectedTextureGenerator(name, "lesu", connectedTexture);
|
||||
map.setTextureEntry(name, texture);
|
||||
}
|
||||
return map.getTextureExtry(name);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,4 +102,513 @@ public class BlockLesuStorage extends BlockMachineBase {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is taken from https://github.com/SlimeKnights/TinkersConstruct/blob/a7405a3d10318bb5c486ec75fb62897a8149d1a6/src/main/java/tconstruct/smeltery/blocks/GlassBlockConnected.java
|
||||
*/
|
||||
public IIcon getConnectedBlockTexture (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5, IIcon[] icons)
|
||||
{
|
||||
boolean isOpenUp = false, isOpenDown = false, isOpenLeft = false, isOpenRight = false;
|
||||
|
||||
switch (par5)
|
||||
{
|
||||
case 0:
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[15];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[11];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[12];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[13];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[14];
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return icons[5];
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[6];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[8];
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[10];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return icons[7];
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return icons[9];
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return icons[3];
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return icons[4];
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return icons[2];
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return icons[1];
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[15];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[11];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[12];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[13];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[14];
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return icons[5];
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[6];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[8];
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[10];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return icons[7];
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return icons[9];
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return icons[3];
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return icons[4];
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return icons[2];
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return icons[1];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[15];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[13];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[14];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[11];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[12];
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return icons[6];
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[5];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[9];
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[10];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return icons[7];
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return icons[8];
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return icons[1];
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return icons[2];
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return icons[4];
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return icons[3];
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[15];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[14];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[13];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[11];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[12];
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return icons[6];
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[5];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[10];
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[9];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return icons[8];
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return icons[7];
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return icons[1];
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return icons[2];
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return icons[3];
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return icons[4];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[15];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[14];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[13];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[11];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[12];
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return icons[6];
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[5];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[10];
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[9];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return icons[8];
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return icons[7];
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return icons[1];
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return icons[2];
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return icons[3];
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return icons[4];
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[15];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[13];
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[14];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[11];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[12];
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return icons[6];
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return icons[5];
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return icons[9];
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return icons[10];
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return icons[7];
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return icons[8];
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return icons[1];
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return icons[2];
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return icons[4];
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return icons[3];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {
|
||||
return block == (Block) this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue