Clean up Machine and Basic Blocks a bit.
Got rid of the direct object equality testing, and introduce enums that we can switch through when needed.
This commit is contained in:
parent
a01cf948ff
commit
fc8fab1987
4 changed files with 532 additions and 620 deletions
|
@ -18,20 +18,22 @@ import mekanism.common.item.ItemBlockGasTank;
|
|||
import mekanism.common.item.ItemBlockMachine;
|
||||
import mekanism.common.item.ItemBlockOre;
|
||||
import mekanism.common.item.ItemBlockPlastic;
|
||||
import mekanism.common.item.ItemBlockPlasticFence;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
import static mekanism.common.block.BlockBasic.BasicBlock.*;
|
||||
import static mekanism.common.block.BlockMachine.MachineBlock.*;
|
||||
|
||||
@ObjectHolder("Mekanism")
|
||||
public class MekanismBlocks
|
||||
{
|
||||
public static final Block BasicBlock = new BlockBasic().setBlockName("BasicBlock");
|
||||
public static final Block BasicBlock2 = new BlockBasic().setBlockName("BasicBlock2");
|
||||
public static final Block MachineBlock = new BlockMachine().setBlockName("MachineBlock");
|
||||
public static final Block MachineBlock2 = new BlockMachine().setBlockName("MachineBlock2");
|
||||
public static final Block BasicBlock = new BlockBasic(BASIC_BLOCK_1).setBlockName("BasicBlock");
|
||||
public static final Block BasicBlock2 = new BlockBasic(BASIC_BLOCK_2).setBlockName("BasicBlock2");
|
||||
public static final Block MachineBlock = new BlockMachine(MACHINE_BLOCK_1).setBlockName("MachineBlock");
|
||||
public static final Block MachineBlock2 = new BlockMachine(MACHINE_BLOCK_2).setBlockName("MachineBlock2");
|
||||
public static final Block MachineBlock3 = new BlockMachine(MACHINE_BLOCK_3).setBlockName("MachineBlock3");
|
||||
public static final Block OreBlock = new BlockOre().setBlockName("OreBlock");
|
||||
public static final Block ObsidianTNT = new BlockObsidianTNT().setBlockName("ObsidianTNT").setCreativeTab(Mekanism.tabMekanism);
|
||||
public static final Block EnergyCube = new BlockEnergyCube().setBlockName("EnergyCube");
|
||||
|
@ -55,6 +57,7 @@ public class MekanismBlocks
|
|||
GameRegistry.registerBlock(BasicBlock2, ItemBlockBasic.class, "BasicBlock2");
|
||||
GameRegistry.registerBlock(MachineBlock, ItemBlockMachine.class, "MachineBlock");
|
||||
GameRegistry.registerBlock(MachineBlock2, ItemBlockMachine.class, "MachineBlock2");
|
||||
GameRegistry.registerBlock(MachineBlock3, ItemBlockMachine.class, "MachineBlock3");
|
||||
GameRegistry.registerBlock(OreBlock, ItemBlockOre.class, "OreBlock");
|
||||
GameRegistry.registerBlock(EnergyCube, ItemBlockEnergyCube.class, "EnergyCube");
|
||||
GameRegistry.registerBlock(ObsidianTNT, "ObsidianTNT");
|
||||
|
|
|
@ -79,12 +79,15 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
|
||||
public CTMData[][] ctms = new CTMData[16][2];
|
||||
|
||||
public BlockBasic()
|
||||
public BasicBlock blockType;
|
||||
|
||||
public BlockBasic(BasicBlock type)
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(5F);
|
||||
setResistance(10F);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
blockType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -110,44 +113,45 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
ctms[9][0] = new CTMData("ctm/DynamicTank", this, Arrays.asList(9, 11)).registerIcons(register);
|
||||
ctms[10][0] = new CTMData("ctm/DynamicGlass", this, Arrays.asList(10)).registerIcons(register);
|
||||
ctms[11][0] = new CTMData("ctm/DynamicValve", this, Arrays.asList(11, 9)).registerIcons(register);
|
||||
case BASIC_BLOCK_1:
|
||||
ctms[9][0] = new CTMData("ctm/DynamicTank", this, Arrays.asList(9, 11)).registerIcons(register);
|
||||
ctms[10][0] = new CTMData("ctm/DynamicGlass", this, Arrays.asList(10)).registerIcons(register);
|
||||
ctms[11][0] = new CTMData("ctm/DynamicValve", this, Arrays.asList(11, 9)).registerIcons(register);
|
||||
|
||||
ctms[14][0] = new CTMData("ctm/SalinationBlock", this, Arrays.asList(14, 15)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock2, Arrays.asList(0)).addFacingOverride("ctm/SalinationController").registerIcons(register);
|
||||
ctms[14][1] = new CTMData("ctm/SalinationBlock", this, Arrays.asList(14, 15)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock2, Arrays.asList(0)).addFacingOverride("ctm/SalinationControllerOn").registerIcons(register);
|
||||
ctms[15][0] = new CTMData("ctm/SalinationValve", this, Arrays.asList(15, 14)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock2, Arrays.asList(0)).registerIcons(register);
|
||||
ctms[14][0] = new CTMData("ctm/SalinationBlock", this, Arrays.asList(14, 15)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock2, Arrays.asList(0)).addFacingOverride("ctm/SalinationController").registerIcons(register);
|
||||
ctms[14][1] = new CTMData("ctm/SalinationBlock", this, Arrays.asList(14, 15)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock2, Arrays.asList(0)).addFacingOverride("ctm/SalinationControllerOn").registerIcons(register);
|
||||
ctms[15][0] = new CTMData("ctm/SalinationValve", this, Arrays.asList(15, 14)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock2, Arrays.asList(0)).registerIcons(register);
|
||||
|
||||
icons[0][0] = register.registerIcon("mekanism:OsmiumBlock");
|
||||
icons[1][0] = register.registerIcon("mekanism:BronzeBlock");
|
||||
icons[2][0] = register.registerIcon("mekanism:RefinedObsidian");
|
||||
icons[3][0] = register.registerIcon("mekanism:CoalBlock");
|
||||
icons[4][0] = register.registerIcon("mekanism:RefinedGlowstone");
|
||||
icons[5][0] = register.registerIcon("mekanism:SteelBlock");
|
||||
icons[6][0] = register.registerIcon("mekanism:BinSide");
|
||||
icons[6][1] = register.registerIcon("mekanism:BinTop");
|
||||
icons[6][2] = register.registerIcon("mekanism:BinFront");
|
||||
icons[6][3] = register.registerIcon("mekanism:BinTopOn");
|
||||
icons[6][4] = register.registerIcon("mekanism:BinFrontOn");
|
||||
icons[7][0] = register.registerIcon("mekanism:TeleporterFrame");
|
||||
icons[8][0] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[9][0] = ctms[9][0].mainTextureData.icon;
|
||||
icons[10][0] = ctms[10][0].mainTextureData.icon;
|
||||
icons[11][0] = ctms[11][0].mainTextureData.icon;
|
||||
icons[12][0] = register.registerIcon("mekanism:CopperBlock");
|
||||
icons[13][0] = register.registerIcon("mekanism:TinBlock");
|
||||
icons[14][0] = ctms[14][0].facingOverride.icon;
|
||||
icons[14][1] = ctms[14][1].facingOverride.icon;
|
||||
icons[14][2] = ctms[14][0].mainTextureData.icon;
|
||||
icons[15][0] = ctms[15][0].mainTextureData.icon;
|
||||
}
|
||||
else if(this == MekanismBlocks.BasicBlock2)
|
||||
{
|
||||
ctms[0][0] = new CTMData("ctm/SalinationBlock", this, Arrays.asList(0)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock, Arrays.asList(14, 15)).registerIcons(register);
|
||||
icons[0][0] = register.registerIcon("mekanism:OsmiumBlock");
|
||||
icons[1][0] = register.registerIcon("mekanism:BronzeBlock");
|
||||
icons[2][0] = register.registerIcon("mekanism:RefinedObsidian");
|
||||
icons[3][0] = register.registerIcon("mekanism:CoalBlock");
|
||||
icons[4][0] = register.registerIcon("mekanism:RefinedGlowstone");
|
||||
icons[5][0] = register.registerIcon("mekanism:SteelBlock");
|
||||
icons[6][0] = register.registerIcon("mekanism:BinSide");
|
||||
icons[6][1] = register.registerIcon("mekanism:BinTop");
|
||||
icons[6][2] = register.registerIcon("mekanism:BinFront");
|
||||
icons[6][3] = register.registerIcon("mekanism:BinTopOn");
|
||||
icons[6][4] = register.registerIcon("mekanism:BinFrontOn");
|
||||
icons[7][0] = register.registerIcon("mekanism:TeleporterFrame");
|
||||
icons[8][0] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[9][0] = ctms[9][0].mainTextureData.icon;
|
||||
icons[10][0] = ctms[10][0].mainTextureData.icon;
|
||||
icons[11][0] = ctms[11][0].mainTextureData.icon;
|
||||
icons[12][0] = register.registerIcon("mekanism:CopperBlock");
|
||||
icons[13][0] = register.registerIcon("mekanism:TinBlock");
|
||||
icons[14][0] = ctms[14][0].facingOverride.icon;
|
||||
icons[14][1] = ctms[14][1].facingOverride.icon;
|
||||
icons[14][2] = ctms[14][0].mainTextureData.icon;
|
||||
icons[15][0] = ctms[15][0].mainTextureData.icon;
|
||||
break;
|
||||
case BASIC_BLOCK_2:
|
||||
ctms[0][0] = new CTMData("ctm/SalinationBlock", this, Arrays.asList(0)).addOtherBlockConnectivities(MekanismBlocks.BasicBlock, Arrays.asList(14, 15)).registerIcons(register);
|
||||
|
||||
icons[0][0] = ctms[0][0].mainTextureData.icon;
|
||||
icons[0][0] = ctms[0][0].mainTextureData.icon;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,49 +159,49 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
switch(metadata)
|
||||
{
|
||||
case 6:
|
||||
TileEntityBasicBlock tileEntity6 = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
case BASIC_BLOCK_1:
|
||||
switch(meta)
|
||||
{
|
||||
case 6:
|
||||
TileEntityBasicBlock tileEntity6 = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
|
||||
if(side == 0 || side == 1)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[6][3] : icons[6][1];
|
||||
}
|
||||
else if(side == tileEntity6.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[6][4] : icons[6][2];
|
||||
}
|
||||
else
|
||||
{
|
||||
return icons[6][0];
|
||||
}
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
return ctms[metadata][0].getIcon(side);
|
||||
case 14:
|
||||
TileEntitySalinationController tileEntity14 = (TileEntitySalinationController)world.getTileEntity(x, y, z);
|
||||
if(side == 0 || side == 1)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[meta][3] : icons[meta][1];
|
||||
} else if(side == tileEntity6.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[meta][4] : icons[meta][2];
|
||||
} else
|
||||
{
|
||||
return icons[meta][0];
|
||||
}
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
return ctms[meta][0].getIcon(side);
|
||||
case 14:
|
||||
TileEntitySalinationController tileEntity14 = (TileEntitySalinationController)world.getTileEntity(x, y, z);
|
||||
|
||||
if(side == tileEntity14.facing)
|
||||
{
|
||||
return tileEntity14.structured ? icons[14][1] : icons[14][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return icons[14][2];
|
||||
}
|
||||
default:
|
||||
return getIcon(side, metadata);
|
||||
}
|
||||
}
|
||||
else if(this == MekanismBlocks.BasicBlock2)
|
||||
{
|
||||
return getIcon(side, metadata);
|
||||
if(side == tileEntity14.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[meta][1] : icons[meta][0];
|
||||
} else
|
||||
{
|
||||
return icons[meta][2];
|
||||
}
|
||||
default:
|
||||
return getIcon(side, meta);
|
||||
}
|
||||
case BASIC_BLOCK_2:
|
||||
switch(meta)
|
||||
{
|
||||
default:
|
||||
return getIcon(side, meta);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -207,43 +211,38 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
if(meta != 6 && meta != 14)
|
||||
{
|
||||
case BASIC_BLOCK_1:
|
||||
switch(meta)
|
||||
{
|
||||
case 6:
|
||||
if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[meta][1];
|
||||
} else if(side == 3)
|
||||
{
|
||||
return icons[meta][2];
|
||||
} else
|
||||
{
|
||||
return icons[meta][0];
|
||||
}
|
||||
case 14:
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else
|
||||
{
|
||||
return icons[meta][2];
|
||||
}
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
case BASIC_BLOCK_2:
|
||||
return icons[meta][0];
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
else if(meta == 6)
|
||||
{
|
||||
if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[6][1];
|
||||
}
|
||||
else if(side == 3)
|
||||
{
|
||||
return icons[6][2];
|
||||
}
|
||||
else {
|
||||
return icons[6][0];
|
||||
}
|
||||
}
|
||||
else if(meta == 14)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[14][0];
|
||||
}
|
||||
else {
|
||||
return icons[14][2];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(this == MekanismBlocks.BasicBlock2)
|
||||
{
|
||||
return icons[meta][0];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -256,28 +255,32 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativetabs, List list)
|
||||
{
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
list.add(new ItemStack(item, 1, 2));
|
||||
list.add(new ItemStack(item, 1, 3));
|
||||
list.add(new ItemStack(item, 1, 4));
|
||||
list.add(new ItemStack(item, 1, 5));
|
||||
list.add(new ItemStack(item, 1, 6));
|
||||
list.add(new ItemStack(item, 1, 7));
|
||||
list.add(new ItemStack(item, 1, 8));
|
||||
list.add(new ItemStack(item, 1, 9));
|
||||
list.add(new ItemStack(item, 1, 10));
|
||||
list.add(new ItemStack(item, 1, 11));
|
||||
list.add(new ItemStack(item, 1, 12));
|
||||
list.add(new ItemStack(item, 1, 13));
|
||||
list.add(new ItemStack(item, 1, 14));
|
||||
list.add(new ItemStack(item, 1, 15));
|
||||
}
|
||||
else if(this == MekanismBlocks.BasicBlock2)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
case BASIC_BLOCK_1:
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
list.add(new ItemStack(item, 1, 2));
|
||||
list.add(new ItemStack(item, 1, 3));
|
||||
list.add(new ItemStack(item, 1, 4));
|
||||
list.add(new ItemStack(item, 1, 5));
|
||||
list.add(new ItemStack(item, 1, 6));
|
||||
list.add(new ItemStack(item, 1, 7));
|
||||
list.add(new ItemStack(item, 1, 8));
|
||||
list.add(new ItemStack(item, 1, 9));
|
||||
list.add(new ItemStack(item, 1, 10));
|
||||
list.add(new ItemStack(item, 1, 11));
|
||||
list.add(new ItemStack(item, 1, 12));
|
||||
list.add(new ItemStack(item, 1, 13));
|
||||
list.add(new ItemStack(item, 1, 14));
|
||||
list.add(new ItemStack(item, 1, 15));
|
||||
}
|
||||
break;
|
||||
case BASIC_BLOCK_2:
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,36 +289,38 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
if(meta == 9 || meta == 10 || meta == 11)
|
||||
{
|
||||
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileEntity != null)
|
||||
case BASIC_BLOCK_1:
|
||||
switch(meta)
|
||||
{
|
||||
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
|
||||
{
|
||||
if(tileEntity.structure != null)
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileEntity != null)
|
||||
{
|
||||
return false;
|
||||
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
|
||||
{
|
||||
if(tileEntity.structure != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(tileEntity.clientHasStructure)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(tileEntity.clientHasStructure)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case BASIC_BLOCK_2:
|
||||
return super.canCreatureSpawn(type, world, x, y, z);
|
||||
default:
|
||||
return super.canCreatureSpawn(type, world, x, y, z);
|
||||
}
|
||||
else if(this == MekanismBlocks.BasicBlock2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return super.canCreatureSpawn(type, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -323,7 +328,7 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
if(!world.isRemote && meta == 6)
|
||||
{
|
||||
|
@ -352,7 +357,7 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
if(metadata != 6)
|
||||
{
|
||||
|
@ -452,7 +457,7 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
|
||||
{
|
||||
return !(this == MekanismBlocks.BasicBlock && world.getBlockMetadata(x, y, z) == 10);
|
||||
return !(blockType == BasicBlock.BASIC_BLOCK_1 && world.getBlockMetadata(x, y, z) == 10);
|
||||
}
|
||||
|
||||
private boolean manageInventory(EntityPlayer player, TileEntityDynamicTank tileEntity)
|
||||
|
@ -609,7 +614,7 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
}
|
||||
}
|
||||
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
switch(metadata)
|
||||
{
|
||||
|
@ -628,49 +633,69 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
return metadata == 6 || metadata == 9 || metadata == 10 || metadata == 11 || metadata == 12 || metadata == 14 || metadata == 15;
|
||||
case BASIC_BLOCK_1:
|
||||
switch(metadata)
|
||||
{
|
||||
case 6:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 14:
|
||||
case 15:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
case BASIC_BLOCK_2:
|
||||
switch(metadata)
|
||||
{
|
||||
case 0:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
else if(this == MekanismBlocks.BasicBlock2)
|
||||
{
|
||||
return metadata == 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata)
|
||||
{
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
switch(metadata)
|
||||
{
|
||||
case 6:
|
||||
return new TileEntityBin();
|
||||
case 9:
|
||||
return new TileEntityDynamicTank();
|
||||
case 10:
|
||||
return new TileEntityDynamicTank();
|
||||
case 11:
|
||||
return new TileEntityDynamicValve();
|
||||
case 14:
|
||||
return new TileEntitySalinationController();
|
||||
case 15:
|
||||
return new TileEntitySalinationValve();
|
||||
}
|
||||
case BASIC_BLOCK_1:
|
||||
switch(metadata)
|
||||
{
|
||||
case 6:
|
||||
return new TileEntityBin();
|
||||
case 9:
|
||||
return new TileEntityDynamicTank();
|
||||
case 10:
|
||||
return new TileEntityDynamicTank();
|
||||
case 11:
|
||||
return new TileEntityDynamicValve();
|
||||
case 14:
|
||||
return new TileEntitySalinationController();
|
||||
case 15:
|
||||
return new TileEntitySalinationValve();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
case BASIC_BLOCK_2:
|
||||
switch(metadata)
|
||||
{
|
||||
case 0:
|
||||
return new TileEntitySalinationBlock();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
else if(this == MekanismBlocks.BasicBlock2)
|
||||
{
|
||||
switch(metadata)
|
||||
{
|
||||
case 0:
|
||||
return new TileEntitySalinationBlock();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -735,7 +760,7 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
{
|
||||
ItemStack ret = new ItemStack(this, 1, world.getBlockMetadata(x, y, z));
|
||||
|
||||
if(this == MekanismBlocks.BasicBlock)
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
if(ret.getItemDamage() == 6)
|
||||
{
|
||||
|
@ -805,7 +830,7 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
Coord4D obj = new Coord4D(x, y, z).getFromSide(ForgeDirection.getOrientation(side).getOpposite());
|
||||
if(this == MekanismBlocks.BasicBlock && obj.getMetadata(world) == 10)
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1 && obj.getMetadata(world) == 10)
|
||||
{
|
||||
return ctms[10][0].shouldRenderSide(world, x, y, z, side);
|
||||
}
|
||||
|
@ -864,4 +889,10 @@ public class BlockBasic extends Block implements IBlockCTM
|
|||
|
||||
return ctms[meta][0];
|
||||
}
|
||||
|
||||
public static enum BasicBlock
|
||||
{
|
||||
BASIC_BLOCK_1,
|
||||
BASIC_BLOCK_2;
|
||||
}
|
||||
}
|
|
@ -131,6 +131,7 @@ import dan200.computercraft.api.peripheral.IPeripheralProvider;
|
|||
* 1:12: Fluidic Plenisher
|
||||
* 1:13: Laser
|
||||
* 1:14: Laser Amplifier
|
||||
* 1:15: Entangled Block
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
|
@ -138,61 +139,68 @@ import dan200.computercraft.api.peripheral.IPeripheralProvider;
|
|||
public class BlockMachine extends BlockContainer implements ISpecialBounds, IPeripheralProvider
|
||||
{
|
||||
public IIcon[][] icons = new IIcon[16][16];
|
||||
public Random machineRand = new Random();
|
||||
|
||||
public BlockMachine()
|
||||
public MachineBlock blockType;
|
||||
|
||||
public BlockMachine(MachineBlock type)
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(3.5F);
|
||||
setResistance(8F);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
blockType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
if(this == MekanismBlocks.MachineBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
icons[0][0] = register.registerIcon("mekanism:EnrichmentChamberFrontOff");
|
||||
icons[0][1] = register.registerIcon("mekanism:EnrichmentChamberFrontOn");
|
||||
icons[0][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[1][0] = register.registerIcon("mekanism:OsmiumCompressorFrontOff");
|
||||
icons[1][1] = register.registerIcon("mekanism:OsmiumCompressorFrontOn");
|
||||
icons[1][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[2][0] = register.registerIcon("mekanism:CombinerFrontOff");
|
||||
icons[2][1] = register.registerIcon("mekanism:CombinerFrontOn");
|
||||
icons[2][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[3][0] = register.registerIcon("mekanism:CrusherFrontOff");
|
||||
icons[3][1] = register.registerIcon("mekanism:CrusherFrontOn");
|
||||
icons[3][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[5][0] = register.registerIcon("mekanism:BasicFactoryFront");
|
||||
icons[5][1] = register.registerIcon("mekanism:BasicFactorySide");
|
||||
icons[5][2] = register.registerIcon("mekanism:BasicFactoryTop");
|
||||
icons[6][0] = register.registerIcon("mekanism:AdvancedFactoryFront");
|
||||
icons[6][1] = register.registerIcon("mekanism:AdvancedFactorySide");
|
||||
icons[6][2] = register.registerIcon("mekanism:AdvancedFactoryTop");
|
||||
icons[7][0] = register.registerIcon("mekanism:EliteFactoryFront");
|
||||
icons[7][1] = register.registerIcon("mekanism:EliteFactorySide");
|
||||
icons[7][2] = register.registerIcon("mekanism:EliteFactoryTop");
|
||||
icons[9][0] = register.registerIcon("mekanism:PurificationChamberFrontOff");
|
||||
icons[9][1] = register.registerIcon("mekanism:PurificationChamberFrontOn");
|
||||
icons[9][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[10][0] = register.registerIcon("mekanism:EnergizedSmelterFrontOff");
|
||||
icons[10][1] = register.registerIcon("mekanism:EnergizedSmelterFrontOn");
|
||||
icons[10][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[11][0] = register.registerIcon("mekanism:Teleporter");
|
||||
}
|
||||
else if(this == MekanismBlocks.MachineBlock2)
|
||||
{
|
||||
icons[3][0] = register.registerIcon("mekanism:ChemicalInjectionChamberFrontOff");
|
||||
icons[3][1] = register.registerIcon("mekanism:ChemicalInjectionChamberFrontOn");
|
||||
icons[3][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[5][0] = register.registerIcon("mekanism:PrecisionSawmillFrontOff");
|
||||
icons[5][1] = register.registerIcon("mekanism:PrecisionSawmillFrontOn");
|
||||
icons[5][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[15][0] = register.registerIcon("mekanism:SteelCasing");
|
||||
case MACHINE_BLOCK_1:
|
||||
icons[0][0] = register.registerIcon("mekanism:EnrichmentChamberFrontOff");
|
||||
icons[0][1] = register.registerIcon("mekanism:EnrichmentChamberFrontOn");
|
||||
icons[0][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[1][0] = register.registerIcon("mekanism:OsmiumCompressorFrontOff");
|
||||
icons[1][1] = register.registerIcon("mekanism:OsmiumCompressorFrontOn");
|
||||
icons[1][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[2][0] = register.registerIcon("mekanism:CombinerFrontOff");
|
||||
icons[2][1] = register.registerIcon("mekanism:CombinerFrontOn");
|
||||
icons[2][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[3][0] = register.registerIcon("mekanism:CrusherFrontOff");
|
||||
icons[3][1] = register.registerIcon("mekanism:CrusherFrontOn");
|
||||
icons[3][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[5][0] = register.registerIcon("mekanism:BasicFactoryFront");
|
||||
icons[5][1] = register.registerIcon("mekanism:BasicFactorySide");
|
||||
icons[5][2] = register.registerIcon("mekanism:BasicFactoryTop");
|
||||
icons[6][0] = register.registerIcon("mekanism:AdvancedFactoryFront");
|
||||
icons[6][1] = register.registerIcon("mekanism:AdvancedFactorySide");
|
||||
icons[6][2] = register.registerIcon("mekanism:AdvancedFactoryTop");
|
||||
icons[7][0] = register.registerIcon("mekanism:EliteFactoryFront");
|
||||
icons[7][1] = register.registerIcon("mekanism:EliteFactorySide");
|
||||
icons[7][2] = register.registerIcon("mekanism:EliteFactoryTop");
|
||||
icons[9][0] = register.registerIcon("mekanism:PurificationChamberFrontOff");
|
||||
icons[9][1] = register.registerIcon("mekanism:PurificationChamberFrontOn");
|
||||
icons[9][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[10][0] = register.registerIcon("mekanism:EnergizedSmelterFrontOff");
|
||||
icons[10][1] = register.registerIcon("mekanism:EnergizedSmelterFrontOn");
|
||||
icons[10][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[11][0] = register.registerIcon("mekanism:Teleporter");
|
||||
break;
|
||||
case MACHINE_BLOCK_2:
|
||||
icons[3][0] = register.registerIcon("mekanism:ChemicalInjectionChamberFrontOff");
|
||||
icons[3][1] = register.registerIcon("mekanism:ChemicalInjectionChamberFrontOn");
|
||||
icons[3][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[5][0] = register.registerIcon("mekanism:PrecisionSawmillFrontOff");
|
||||
icons[5][1] = register.registerIcon("mekanism:PrecisionSawmillFrontOn");
|
||||
icons[5][2] = register.registerIcon("mekanism:SteelCasing");
|
||||
icons[15][0] = register.registerIcon("mekanism:SteelCasing");
|
||||
break;
|
||||
case MACHINE_BLOCK_3:
|
||||
icons[0][0] = register.registerIcon("mekanism:AmbientAccumulator");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -336,290 +344,129 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
if(this == MekanismBlocks.MachineBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
if(meta == 0)
|
||||
{
|
||||
if(side == 3)
|
||||
case MACHINE_BLOCK_1:
|
||||
switch(meta)
|
||||
{
|
||||
return icons[0][0];
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 9:
|
||||
case 10:
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else
|
||||
{
|
||||
return icons[meta][2];
|
||||
}
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[meta][2];
|
||||
} else
|
||||
{
|
||||
return icons[meta][1];
|
||||
}
|
||||
default:
|
||||
return icons[11][0];
|
||||
}
|
||||
else {
|
||||
return icons[0][2];
|
||||
}
|
||||
}
|
||||
else if(meta == 1)
|
||||
{
|
||||
if(side == 3)
|
||||
case MACHINE_BLOCK_2:
|
||||
switch(meta)
|
||||
{
|
||||
return icons[1][0];
|
||||
case 3:
|
||||
case 5:
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else
|
||||
{
|
||||
return icons[meta][2];
|
||||
}
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
else {
|
||||
return icons[1][2];
|
||||
}
|
||||
}
|
||||
else if(meta == 2)
|
||||
{
|
||||
if(side == 3)
|
||||
case MACHINE_BLOCK_3:
|
||||
switch(meta)
|
||||
{
|
||||
return icons[2][0];
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
else {
|
||||
return icons[2][2];
|
||||
}
|
||||
}
|
||||
else if(meta == 3)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[3][0];
|
||||
}
|
||||
else {
|
||||
return icons[3][2];
|
||||
}
|
||||
}
|
||||
else if(meta == 5)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[5][0];
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[5][2];
|
||||
}
|
||||
else {
|
||||
return icons[5][1];
|
||||
}
|
||||
}
|
||||
else if(meta == 6)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[6][0];
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[6][2];
|
||||
}
|
||||
else {
|
||||
return icons[6][1];
|
||||
}
|
||||
}
|
||||
else if(meta == 7)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[7][0];
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[7][2];
|
||||
}
|
||||
else {
|
||||
return icons[7][1];
|
||||
}
|
||||
}
|
||||
else if(meta == 9)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[9][0];
|
||||
}
|
||||
else {
|
||||
return icons[9][2];
|
||||
}
|
||||
}
|
||||
else if(meta == 10)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[10][0];
|
||||
}
|
||||
else {
|
||||
return icons[10][2];
|
||||
}
|
||||
}
|
||||
else if(meta == 11)
|
||||
{
|
||||
return icons[11][0];
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
else if(this == MekanismBlocks.MachineBlock2)
|
||||
{
|
||||
if(meta == 3 || meta == 5)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[meta][0];
|
||||
}
|
||||
else {
|
||||
return icons[meta][2];
|
||||
}
|
||||
}
|
||||
else if(meta == 9)
|
||||
{
|
||||
if(side == 3)
|
||||
{
|
||||
return icons[meta][1];
|
||||
}
|
||||
else {
|
||||
return icons[meta][0];
|
||||
}
|
||||
}
|
||||
else if(meta == 15)
|
||||
{
|
||||
return icons[meta][0];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
|
||||
if(this == MekanismBlocks.MachineBlock)
|
||||
switch(blockType)
|
||||
{
|
||||
if(metadata == 0)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
case MACHINE_BLOCK_1:
|
||||
switch(meta)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[0][1] : icons[0][0];
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 9:
|
||||
case 10:
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[meta][1] : icons[meta][0];
|
||||
} else
|
||||
{
|
||||
return icons[meta][2];
|
||||
}
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return icons[meta][0];
|
||||
} else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[meta][2];
|
||||
} else
|
||||
{
|
||||
return icons[meta][1];
|
||||
}
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
else {
|
||||
return icons[0][2];
|
||||
}
|
||||
}
|
||||
else if(metadata == 1)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
case MACHINE_BLOCK_2:
|
||||
switch(meta)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[1][1] : icons[1][0];
|
||||
case 3:
|
||||
case 5:
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[meta][1] : icons[meta][0];
|
||||
} else
|
||||
{
|
||||
return icons[meta][2];
|
||||
}
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
else {
|
||||
return icons[1][2];
|
||||
}
|
||||
}
|
||||
else if(metadata == 2)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
case MACHINE_BLOCK_3:
|
||||
switch(meta)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[2][1] : icons[2][0];
|
||||
default:
|
||||
return icons[meta][0];
|
||||
}
|
||||
else {
|
||||
return icons[2][2];
|
||||
}
|
||||
}
|
||||
else if(metadata == 3)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[3][1] : icons[3][0];
|
||||
}
|
||||
else {
|
||||
return icons[3][2];
|
||||
}
|
||||
}
|
||||
else if(metadata == 5)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return icons[5][0];
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[5][2];
|
||||
}
|
||||
else {
|
||||
return icons[5][1];
|
||||
}
|
||||
}
|
||||
else if(metadata == 6)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return icons[6][0];
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[6][2];
|
||||
}
|
||||
else {
|
||||
return icons[6][1];
|
||||
}
|
||||
}
|
||||
else if(metadata == 7)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return icons[7][0];
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
{
|
||||
return icons[7][2];
|
||||
}
|
||||
else {
|
||||
return icons[7][1];
|
||||
}
|
||||
}
|
||||
else if(metadata == 9)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[9][1] : icons[9][0];
|
||||
}
|
||||
else {
|
||||
return icons[9][2];
|
||||
}
|
||||
}
|
||||
else if(metadata == 10)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[10][1] : icons[10][0];
|
||||
}
|
||||
else {
|
||||
return icons[10][2];
|
||||
}
|
||||
}
|
||||
else if(metadata == 11)
|
||||
{
|
||||
return icons[11][0];
|
||||
}
|
||||
}
|
||||
else if(this == MekanismBlocks.MachineBlock2)
|
||||
{
|
||||
if(metadata == 3 || metadata == 5)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return MekanismUtils.isActive(world, x, y, z) ? icons[metadata][1] : icons[metadata][0];
|
||||
}
|
||||
else {
|
||||
return icons[metadata][2];
|
||||
}
|
||||
}
|
||||
else if(metadata == 9)
|
||||
{
|
||||
if(side == tileEntity.facing)
|
||||
{
|
||||
return icons[metadata][1];
|
||||
}
|
||||
else {
|
||||
return icons[metadata][0];
|
||||
}
|
||||
}
|
||||
else if(metadata == 15)
|
||||
{
|
||||
return icons[metadata][0];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -635,32 +482,35 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
{
|
||||
for(MachineType type : MachineType.values())
|
||||
{
|
||||
if(type.typeBlock == this)
|
||||
if(type.typeBlock == blockType)
|
||||
{
|
||||
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
|
||||
switch(type)
|
||||
{
|
||||
for(RecipeType recipe : RecipeType.values())
|
||||
{
|
||||
ItemStack stack = new ItemStack(item, 1, type.meta);
|
||||
((IFactory)stack.getItem()).setRecipeType(recipe.ordinal(), stack);
|
||||
list.add(stack);
|
||||
}
|
||||
}
|
||||
else if(type == MachineType.PORTABLE_TANK) {
|
||||
list.add(new ItemStack(item, 1, type.meta));
|
||||
case BASIC_FACTORY:
|
||||
case ADVANCED_FACTORY:
|
||||
case ELITE_FACTORY:
|
||||
for(RecipeType recipe : RecipeType.values())
|
||||
{
|
||||
ItemStack stack = new ItemStack(item, 1, type.meta);
|
||||
((IFactory)stack.getItem()).setRecipeType(recipe.ordinal(), stack);
|
||||
list.add(stack);
|
||||
}
|
||||
break;
|
||||
case PORTABLE_TANK:
|
||||
list.add(new ItemStack(item, 1, type.meta));
|
||||
|
||||
ItemBlockMachine itemMachine = (ItemBlockMachine)item;
|
||||
ItemBlockMachine itemMachine = (ItemBlockMachine)item;
|
||||
|
||||
for(Fluid f : FluidRegistry.getRegisteredFluids().values())
|
||||
{
|
||||
ItemStack filled = new ItemStack(item, 1, type.meta);
|
||||
itemMachine.setFluidStack(new FluidStack(f, itemMachine.getCapacity(filled)), filled);
|
||||
itemMachine.setPrevScale(filled, 1);
|
||||
list.add(filled);
|
||||
}
|
||||
}
|
||||
else {
|
||||
list.add(new ItemStack(item, 1, type.meta));
|
||||
for(Fluid f : FluidRegistry.getRegisteredFluids().values())
|
||||
{
|
||||
ItemStack filled = new ItemStack(item, 1, type.meta);
|
||||
itemMachine.setFluidStack(new FluidStack(f, itemMachine.getCapacity(filled)), filled);
|
||||
itemMachine.setPrevScale(filled, 1);
|
||||
list.add(filled);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
list.add(new ItemStack(item, 1, type.meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -725,59 +575,53 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
if(tileEntity != null)
|
||||
{
|
||||
MachineType type = MachineType.get(this, metadata);
|
||||
|
||||
if(type == MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
TileEntityElectricChest electricChest = (TileEntityElectricChest)tileEntity;
|
||||
|
||||
if(!(entityplayer.isSneaking() || world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)))
|
||||
{
|
||||
if(electricChest.canAccess())
|
||||
{
|
||||
MekanismUtils.openElectricChestGui((EntityPlayerMP)entityplayer, electricChest, null, true);
|
||||
}
|
||||
else if(!electricChest.authenticated)
|
||||
{
|
||||
Mekanism.packetHandler.sendTo(new ElectricChestMessage(ElectricChestPacketType.CLIENT_OPEN, true, false, 2, 0, null, Coord4D.get(electricChest)), (EntityPlayerMP)entityplayer);
|
||||
}
|
||||
else {
|
||||
Mekanism.packetHandler.sendTo(new ElectricChestMessage(ElectricChestPacketType.CLIENT_OPEN, true, false, 1, 0, null, Coord4D.get(electricChest)), (EntityPlayerMP)entityplayer);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(type == MachineType.PORTABLE_TANK)
|
||||
switch(type)
|
||||
{
|
||||
if(entityplayer.getCurrentEquippedItem() != null && FluidContainerRegistry.isContainer(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
if(manageInventory(entityplayer, (TileEntityPortableTank)tileEntity))
|
||||
case ELECTRIC_CHEST:
|
||||
TileEntityElectricChest electricChest = (TileEntityElectricChest)tileEntity;
|
||||
|
||||
if(!(entityplayer.isSneaking() || world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)))
|
||||
{
|
||||
entityplayer.inventory.markDirty();
|
||||
if(electricChest.canAccess())
|
||||
{
|
||||
MekanismUtils.openElectricChestGui((EntityPlayerMP)entityplayer, electricChest, null, true);
|
||||
} else if(!electricChest.authenticated)
|
||||
{
|
||||
Mekanism.packetHandler.sendTo(new ElectricChestMessage(ElectricChestPacketType.CLIENT_OPEN, true, false, 2, 0, null, Coord4D.get(electricChest)), (EntityPlayerMP)entityplayer);
|
||||
} else
|
||||
{
|
||||
Mekanism.packetHandler.sendTo(new ElectricChestMessage(ElectricChestPacketType.CLIENT_OPEN, true, false, 1, 0, null, Coord4D.get(electricChest)), (EntityPlayerMP)entityplayer);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
entityplayer.openGui(Mekanism.instance, type.guiId, world, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(type == MachineType.LOGISTICAL_SORTER)
|
||||
{
|
||||
TileEntityLogisticalSorter sorter = (TileEntityLogisticalSorter)tileEntity;
|
||||
LogisticalSorterGuiMessage.openServerGui(SorterGuiPacket.SERVER, 0, world, (EntityPlayerMP)entityplayer, Coord4D.get(tileEntity), -1);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
if(!entityplayer.isSneaking() && type.guiId != -1)
|
||||
{
|
||||
entityplayer.openGui(Mekanism.instance, type.guiId, world, x, y, z);
|
||||
break;
|
||||
case PORTABLE_TANK:
|
||||
if(entityplayer.getCurrentEquippedItem() != null && FluidContainerRegistry.isContainer(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
if(manageInventory(entityplayer, (TileEntityPortableTank)tileEntity))
|
||||
{
|
||||
entityplayer.inventory.markDirty();
|
||||
return true;
|
||||
}
|
||||
} else
|
||||
{
|
||||
entityplayer.openGui(Mekanism.instance, type.guiId, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case LOGISTICAL_SORTER:
|
||||
LogisticalSorterGuiMessage.openServerGui(SorterGuiPacket.SERVER, 0, world, (EntityPlayerMP)entityplayer, Coord4D.get(tileEntity), -1);
|
||||
return true;
|
||||
default:
|
||||
if(!entityplayer.isSneaking() && type.guiId != -1)
|
||||
{
|
||||
entityplayer.openGui(Mekanism.instance, type.guiId, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1106,16 +950,17 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
{
|
||||
MachineType type = MachineType.get(this, world.getBlockMetadata(x, y, z));
|
||||
|
||||
if(type == MachineType.CHARGEPAD)
|
||||
switch(type)
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.06F, 1.0F);
|
||||
}
|
||||
else if(type == MachineType.PORTABLE_TANK)
|
||||
{
|
||||
setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
|
||||
}
|
||||
else {
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
case CHARGEPAD:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.06F, 1.0F);
|
||||
break;
|
||||
case PORTABLE_TANK:
|
||||
setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 1.0F, 0.875F);
|
||||
break;
|
||||
default:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1133,15 +978,14 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
|
||||
{
|
||||
MachineType type = MachineType.get(this, world.getBlockMetadata(x, y, z));
|
||||
MachineType type = MachineType.get(blockType, world.getBlockMetadata(x, y, z));
|
||||
|
||||
if(type == MachineType.CHARGEPAD)
|
||||
switch(type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if(type == MachineType.PORTABLE_TANK)
|
||||
{
|
||||
return side == ForgeDirection.UP || side == ForgeDirection.DOWN;
|
||||
case CHARGEPAD:
|
||||
return false;
|
||||
case PORTABLE_TANK:
|
||||
return side == ForgeDirection.UP || side == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1161,42 +1005,64 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
}
|
||||
}
|
||||
|
||||
public static enum MachineBlock
|
||||
{
|
||||
MACHINE_BLOCK_1,
|
||||
MACHINE_BLOCK_2,
|
||||
MACHINE_BLOCK_3;
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case MACHINE_BLOCK_1:
|
||||
return MekanismBlocks.MachineBlock;
|
||||
case MACHINE_BLOCK_2:
|
||||
return MekanismBlocks.MachineBlock2;
|
||||
case MACHINE_BLOCK_3:
|
||||
return MekanismBlocks.MachineBlock3;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static enum MachineType
|
||||
{
|
||||
ENRICHMENT_CHAMBER(MekanismBlocks.MachineBlock, 0, "EnrichmentChamber", 3, usage.enrichmentChamberUsage*400, TileEntityEnrichmentChamber.class, true, false, true),
|
||||
OSMIUM_COMPRESSOR(MekanismBlocks.MachineBlock, 1, "OsmiumCompressor", 4, usage.osmiumCompressorUsage*400, TileEntityOsmiumCompressor.class, true, false, true),
|
||||
COMBINER(MekanismBlocks.MachineBlock, 2, "Combiner", 5, usage.combinerUsage*400, TileEntityCombiner.class, true, false, true),
|
||||
CRUSHER(MekanismBlocks.MachineBlock, 3, "Crusher", 6, usage.crusherUsage*400, TileEntityCrusher.class, true, false, true),
|
||||
DIGITAL_MINER(MekanismBlocks.MachineBlock, 4, "DigitalMiner", 2, 100000, TileEntityDigitalMiner.class, true, true, true),
|
||||
BASIC_FACTORY(MekanismBlocks.MachineBlock, 5, "BasicFactory", 11, usage.factoryUsage*3*400, TileEntityFactory.class, true, false, true),
|
||||
ADVANCED_FACTORY(MekanismBlocks.MachineBlock, 6, "AdvancedFactory", 11, usage.factoryUsage*5*400, TileEntityAdvancedFactory.class, true, false, true),
|
||||
ELITE_FACTORY(MekanismBlocks.MachineBlock, 7, "EliteFactory", 11, usage.factoryUsage*7*400, TileEntityEliteFactory.class, true, false, true),
|
||||
METALLURGIC_INFUSER(MekanismBlocks.MachineBlock, 8, "MetallurgicInfuser", 12, usage.metallurgicInfuserUsage*400, TileEntityMetallurgicInfuser.class, true, true, true),
|
||||
PURIFICATION_CHAMBER(MekanismBlocks.MachineBlock, 9, "PurificationChamber", 15, usage.purificationChamberUsage*400, TileEntityPurificationChamber.class, true, false, true),
|
||||
ENERGIZED_SMELTER(MekanismBlocks.MachineBlock, 10, "EnergizedSmelter", 16, usage.energizedSmelterUsage*400, TileEntityEnergizedSmelter.class, true, false, true),
|
||||
TELEPORTER(MekanismBlocks.MachineBlock, 11, "Teleporter", 13, 5000000, TileEntityTeleporter.class, true, false, false),
|
||||
ELECTRIC_PUMP(MekanismBlocks.MachineBlock, 12, "ElectricPump", 17, 10000, TileEntityElectricPump.class, true, true, false),
|
||||
ELECTRIC_CHEST(MekanismBlocks.MachineBlock, 13, "ElectricChest", -1, 12000, TileEntityElectricChest.class, true, true, false),
|
||||
CHARGEPAD(MekanismBlocks.MachineBlock, 14, "Chargepad", -1, 10000, TileEntityChargepad.class, true, true, false),
|
||||
LOGISTICAL_SORTER(MekanismBlocks.MachineBlock, 15, "LogisticalSorter", -1, 0, TileEntityLogisticalSorter.class, false, true, false),
|
||||
ROTARY_CONDENSENTRATOR(MekanismBlocks.MachineBlock2, 0, "RotaryCondensentrator", 7, 20000, TileEntityRotaryCondensentrator.class, true, true, false),
|
||||
CHEMICAL_OXIDIZER(MekanismBlocks.MachineBlock2, 1, "ChemicalOxidizer", 29, 20000, TileEntityChemicalOxidizer.class, true, true, true),
|
||||
CHEMICAL_INFUSER(MekanismBlocks.MachineBlock2, 2, "ChemicalInfuser", 30, 20000, TileEntityChemicalInfuser.class, true, true, false),
|
||||
CHEMICAL_INJECTION_CHAMBER(MekanismBlocks.MachineBlock2, 3, "ChemicalInjectionChamber", 31, usage.chemicalInjectionChamberUsage*400, TileEntityChemicalInjectionChamber.class, true, false, true),
|
||||
ELECTROLYTIC_SEPARATOR(MekanismBlocks.MachineBlock2, 4, "ElectrolyticSeparator", 32, 400000, TileEntityElectrolyticSeparator.class, true, true, false),
|
||||
PRECISION_SAWMILL(MekanismBlocks.MachineBlock2, 5, "PrecisionSawmill", 34, usage.precisionSawmillUsage*400, TileEntityPrecisionSawmill.class, true, false, true),
|
||||
CHEMICAL_DISSOLUTION_CHAMBER(MekanismBlocks.MachineBlock2, 6, "ChemicalDissolutionChamber", 35, 20000, TileEntityChemicalDissolutionChamber.class, true, true, true),
|
||||
CHEMICAL_WASHER(MekanismBlocks.MachineBlock2, 7, "ChemicalWasher", 36, 20000, TileEntityChemicalWasher.class, true, true, false),
|
||||
CHEMICAL_CRYSTALLIZER(MekanismBlocks.MachineBlock2, 8, "ChemicalCrystallizer", 37, 20000, TileEntityChemicalCrystallizer.class, true, true, true),
|
||||
SEISMIC_VIBRATOR(MekanismBlocks.MachineBlock2, 9, "SeismicVibrator", 39, 20000, TileEntitySeismicVibrator.class, true, true, false),
|
||||
PRESSURIZED_REACTION_CHAMBER(MekanismBlocks.MachineBlock2, 10, "PressurizedReactionChamber", 40, 20000, TileEntityPRC.class, true, true, false),
|
||||
PORTABLE_TANK(MekanismBlocks.MachineBlock2, 11, "PortableTank", 41, 0, TileEntityPortableTank.class, false, true, false),
|
||||
FLUIDIC_PLENISHER(MekanismBlocks.MachineBlock2, 12, "FluidicPlenisher", 42, 10000, TileEntityFluidicPlenisher.class, true, true, false),
|
||||
LASER(MekanismBlocks.MachineBlock2, 13, "Laser", -1, 100000, TileEntityLaser.class, true, true, false),
|
||||
LASER_AMPLIFIER(MekanismBlocks.MachineBlock2, 14, "LaserAmplifier", 44, 0, TileEntityLaserAmplifier.class, false, true, false),
|
||||
ENTANGLED_BLOCK(MekanismBlocks.MachineBlock2, 15, "EntangledBlock", 45, 0, TileEntityEntangledBlock.class, true, false, false);
|
||||
ENRICHMENT_CHAMBER(MachineBlock.MACHINE_BLOCK_1, 0, "EnrichmentChamber", 3, usage.enrichmentChamberUsage*400, TileEntityEnrichmentChamber.class, true, false, true),
|
||||
OSMIUM_COMPRESSOR(MachineBlock.MACHINE_BLOCK_1, 1, "OsmiumCompressor", 4, usage.osmiumCompressorUsage*400, TileEntityOsmiumCompressor.class, true, false, true),
|
||||
COMBINER(MachineBlock.MACHINE_BLOCK_1, 2, "Combiner", 5, usage.combinerUsage*400, TileEntityCombiner.class, true, false, true),
|
||||
CRUSHER(MachineBlock.MACHINE_BLOCK_1, 3, "Crusher", 6, usage.crusherUsage*400, TileEntityCrusher.class, true, false, true),
|
||||
DIGITAL_MINER(MachineBlock.MACHINE_BLOCK_1, 4, "DigitalMiner", 2, 100000, TileEntityDigitalMiner.class, true, true, true),
|
||||
BASIC_FACTORY(MachineBlock.MACHINE_BLOCK_1, 5, "BasicFactory", 11, usage.factoryUsage*3*400, TileEntityFactory.class, true, false, true),
|
||||
ADVANCED_FACTORY(MachineBlock.MACHINE_BLOCK_1, 6, "AdvancedFactory", 11, usage.factoryUsage*5*400, TileEntityAdvancedFactory.class, true, false, true),
|
||||
ELITE_FACTORY(MachineBlock.MACHINE_BLOCK_1, 7, "EliteFactory", 11, usage.factoryUsage*7*400, TileEntityEliteFactory.class, true, false, true),
|
||||
METALLURGIC_INFUSER(MachineBlock.MACHINE_BLOCK_1, 8, "MetallurgicInfuser", 12, usage.metallurgicInfuserUsage*400, TileEntityMetallurgicInfuser.class, true, true, true),
|
||||
PURIFICATION_CHAMBER(MachineBlock.MACHINE_BLOCK_1, 9, "PurificationChamber", 15, usage.purificationChamberUsage*400, TileEntityPurificationChamber.class, true, false, true),
|
||||
ENERGIZED_SMELTER(MachineBlock.MACHINE_BLOCK_1, 10, "EnergizedSmelter", 16, usage.energizedSmelterUsage*400, TileEntityEnergizedSmelter.class, true, false, true),
|
||||
TELEPORTER(MachineBlock.MACHINE_BLOCK_1, 11, "Teleporter", 13, 5000000, TileEntityTeleporter.class, true, false, false),
|
||||
ELECTRIC_PUMP(MachineBlock.MACHINE_BLOCK_1, 12, "ElectricPump", 17, 10000, TileEntityElectricPump.class, true, true, false),
|
||||
ELECTRIC_CHEST(MachineBlock.MACHINE_BLOCK_1, 13, "ElectricChest", -1, 12000, TileEntityElectricChest.class, true, true, false),
|
||||
CHARGEPAD(MachineBlock.MACHINE_BLOCK_1, 14, "Chargepad", -1, 10000, TileEntityChargepad.class, true, true, false),
|
||||
LOGISTICAL_SORTER(MachineBlock.MACHINE_BLOCK_1, 15, "LogisticalSorter", -1, 0, TileEntityLogisticalSorter.class, false, true, false),
|
||||
ROTARY_CONDENSENTRATOR(MachineBlock.MACHINE_BLOCK_2, 0, "RotaryCondensentrator", 7, 20000, TileEntityRotaryCondensentrator.class, true, true, false),
|
||||
CHEMICAL_OXIDIZER(MachineBlock.MACHINE_BLOCK_2, 1, "ChemicalOxidizer", 29, 20000, TileEntityChemicalOxidizer.class, true, true, true),
|
||||
CHEMICAL_INFUSER(MachineBlock.MACHINE_BLOCK_2, 2, "ChemicalInfuser", 30, 20000, TileEntityChemicalInfuser.class, true, true, false),
|
||||
CHEMICAL_INJECTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 3, "ChemicalInjectionChamber", 31, usage.chemicalInjectionChamberUsage*400, TileEntityChemicalInjectionChamber.class, true, false, true),
|
||||
ELECTROLYTIC_SEPARATOR(MachineBlock.MACHINE_BLOCK_2, 4, "ElectrolyticSeparator", 32, 400000, TileEntityElectrolyticSeparator.class, true, true, false),
|
||||
PRECISION_SAWMILL(MachineBlock.MACHINE_BLOCK_2, 5, "PrecisionSawmill", 34, usage.precisionSawmillUsage*400, TileEntityPrecisionSawmill.class, true, false, true),
|
||||
CHEMICAL_DISSOLUTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 6, "ChemicalDissolutionChamber", 35, 20000, TileEntityChemicalDissolutionChamber.class, true, true, true),
|
||||
CHEMICAL_WASHER(MachineBlock.MACHINE_BLOCK_2, 7, "ChemicalWasher", 36, 20000, TileEntityChemicalWasher.class, true, true, false),
|
||||
CHEMICAL_CRYSTALLIZER(MachineBlock.MACHINE_BLOCK_2, 8, "ChemicalCrystallizer", 37, 20000, TileEntityChemicalCrystallizer.class, true, true, true),
|
||||
SEISMIC_VIBRATOR(MachineBlock.MACHINE_BLOCK_2, 9, "SeismicVibrator", 39, 20000, TileEntitySeismicVibrator.class, true, true, false),
|
||||
PRESSURIZED_REACTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 10, "PressurizedReactionChamber", 40, 20000, TileEntityPRC.class, true, true, false),
|
||||
PORTABLE_TANK(MachineBlock.MACHINE_BLOCK_2, 11, "PortableTank", 41, 0, TileEntityPortableTank.class, false, true, false),
|
||||
FLUIDIC_PLENISHER(MachineBlock.MACHINE_BLOCK_2, 12, "FluidicPlenisher", 42, 10000, TileEntityFluidicPlenisher.class, true, true, false),
|
||||
LASER(MachineBlock.MACHINE_BLOCK_2, 13, "Laser", -1, 100000, TileEntityLaser.class, true, true, false),
|
||||
LASER_AMPLIFIER(MachineBlock.MACHINE_BLOCK_2, 14, "LaserAmplifier", 44, 0, TileEntityLaserAmplifier.class, false, true, false),
|
||||
ENTANGLED_BLOCK(MachineBlock.MACHINE_BLOCK_2, 15, "EntangledBlock", 45, 0, TileEntityEntangledBlock.class, true, false, false);
|
||||
|
||||
public Block typeBlock;
|
||||
public MachineBlock typeBlock;
|
||||
public int meta;
|
||||
public String name;
|
||||
public int guiId;
|
||||
|
@ -1206,7 +1072,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
public boolean hasModel;
|
||||
public boolean supportsUpgrades;
|
||||
|
||||
private MachineType(Block block, int i, String s, int j, double k, Class<? extends TileEntity> tileClass, boolean electric, boolean model, boolean upgrades)
|
||||
private MachineType(MachineBlock block, int i, String s, int j, double k, Class<? extends TileEntity> tileClass, boolean electric, boolean model, boolean upgrades)
|
||||
{
|
||||
typeBlock = block;
|
||||
meta = i;
|
||||
|
@ -1220,6 +1086,16 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
}
|
||||
|
||||
public static MachineType get(Block block, int meta)
|
||||
{
|
||||
if(block instanceof BlockMachine)
|
||||
{
|
||||
return get(((BlockMachine)block).blockType, meta);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MachineType get(MachineBlock block, int meta)
|
||||
{
|
||||
for(MachineType type : values())
|
||||
{
|
||||
|
@ -1250,7 +1126,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
|||
|
||||
public ItemStack getStack()
|
||||
{
|
||||
return new ItemStack(typeBlock, 1, meta);
|
||||
return new ItemStack(typeBlock.getBlock(), 1, meta);
|
||||
}
|
||||
|
||||
public static MachineType get(ItemStack stack)
|
||||
|
|
|
@ -12,6 +12,8 @@ import codechicken.multipart.MultipartGenerator;
|
|||
import codechicken.multipart.TMultiPart;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
import static mekanism.common.block.BlockMachine.MachineBlock.*;
|
||||
|
||||
public class MultipartMekanism implements IPartFactory
|
||||
{
|
||||
public MultipartMekanism()
|
||||
|
@ -123,12 +125,12 @@ public class MultipartMekanism implements IPartFactory
|
|||
|
||||
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.BasicBlock, 1, i));
|
||||
|
||||
if(!MachineType.get(MekanismBlocks.MachineBlock, i).hasModel)
|
||||
if(!MachineType.get(MACHINE_BLOCK_1, i).hasModel)
|
||||
{
|
||||
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.MachineBlock, 1, i));
|
||||
}
|
||||
|
||||
if(!MachineType.get(MekanismBlocks.MachineBlock2, i).hasModel)
|
||||
if(!MachineType.get(MACHINE_BLOCK_2, i).hasModel)
|
||||
{
|
||||
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.MachineBlock2, 1, i));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue