..
This commit is contained in:
parent
77bcc598ab
commit
fc2d8ea1d5
1 changed files with 76 additions and 0 deletions
76
src/dark/farmtech/machines/BlockBasicFarmMachine.java
Normal file
76
src/dark/farmtech/machines/BlockBasicFarmMachine.java
Normal file
|
@ -0,0 +1,76 @@
|
|||
package dark.farmtech.machines;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockBasicFarmMachine extends BlockFT
|
||||
{
|
||||
Icon generic_side, wood_side, box_Top;
|
||||
|
||||
enum basicMachine
|
||||
{
|
||||
COMP_BOX("compostBox", TileEntityCompBox.class);
|
||||
String name;
|
||||
Class<? extends TileEntity> tile;
|
||||
|
||||
private basicMachine(String name, Class<? extends TileEntity> tile)
|
||||
{
|
||||
this.name = name;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public BlockBasicFarmMachine(String name, int blockID, Material material)
|
||||
{
|
||||
super(BlockBasicFarmMachine.class, name, material);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconReg)
|
||||
{
|
||||
super.registerIcons(iconReg);
|
||||
//this.source = iconReg.registerIcon(DarkMain.getInstance().PREFIX + "infSource");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
default:
|
||||
return this.blockIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata)
|
||||
{
|
||||
if (metadata < basicMachine.values().length)
|
||||
{
|
||||
try
|
||||
{
|
||||
return basicMachine.values()[metadata].tile.newInstance();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return super.createTileEntity(world, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue