This commit is contained in:
DarkGuardsman 2013-07-19 11:40:02 -04:00
parent 3933ce1179
commit dce6e49a69
7 changed files with 14 additions and 52 deletions

View file

@ -13,60 +13,15 @@ import cpw.mods.fml.relauncher.SideOnly;
import dark.core.api.INetworkPart;
import dark.library.machine.BlockMachine;
public class BlockAssembly extends BlockMachine
public abstract class BlockAssembly extends BlockMachine
{
public Icon machine_icon;
public BlockAssembly(int id, Material material, String name)
{
super(AssemblyLine.CONFIGURATION.getBlock(name, id).getInt(), material);
super(name, AssemblyLine.CONFIGURATION, id, material);
this.setUnlocalizedName(name);
this.setCreativeTab(TabAssemblyLine.INSTANCE);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconReg)
{
this.machine_icon = iconReg.registerIcon(AssemblyLine.PREFIX + "machine");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5)
{
return this.machine_icon;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
return this.machine_icon;
}
@Override
public void onBlockAdded(World world, int x, int y, int z)
{
super.onBlockAdded(world, x, y, z);
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity instanceof INetworkPart)
{
((INetworkPart) tileEntity).refresh();
}
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
{
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity instanceof INetworkPart)
{
((INetworkPart) tileEntity).refresh();
}
}
}

View file

@ -78,7 +78,7 @@ public class BlockManipulator extends BlockImprintable
}
@Override
public TileEntity createTileEntity(World var1, int metadata)
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityManipulator();
}

View file

@ -17,7 +17,7 @@ public class BlockRejector extends BlockImprintable
}
@Override
public TileEntity createTileEntity(World var1, int metadata)
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityRejector();
}

View file

@ -148,4 +148,11 @@ public class BlockTurntable extends BlockAssembly
}
}
}
@Override
public TileEntity createNewTileEntity(World world)
{
// TODO Auto-generated method stub
return null;
}
}

View file

@ -67,7 +67,7 @@ public class BlockCraneController extends BlockAssembly
}
@Override
public TileEntity createTileEntity(World world, int metadata)
public TileEntity createNewTileEntity(World world)
{
return new TileEntityCraneController();
}

View file

@ -134,7 +134,7 @@ public class BlockCraneFrame extends BlockAssembly
}
@Override
public TileEntity createTileEntity(World world, int metadata)
public TileEntity createNewTileEntity(World world)
{
return new TileEntityCraneRail();
}

View file

@ -77,7 +77,7 @@ public class BlockEncoder extends BlockAssembly
}
@Override
public TileEntity createTileEntity(World world, int metadata)
public TileEntity createNewTileEntity(World world)
{
return new TileEntityEncoder();
}