2013-12-27 23:59:59 +01:00
|
|
|
package appeng.block.networking;
|
|
|
|
|
|
|
|
import java.util.EnumSet;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraft.item.Item;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraft.util.IIcon;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.AEBaseBlock;
|
|
|
|
import appeng.block.AEBaseItemBlockChargeable;
|
|
|
|
import appeng.client.render.BaseBlockRender;
|
|
|
|
import appeng.client.render.blocks.RenderBlockEnergyCube;
|
2014-05-26 03:58:44 +02:00
|
|
|
import appeng.client.texture.ExtraBlockTextures;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.features.AEFeature;
|
|
|
|
import appeng.tile.networking.TileEnergyCell;
|
|
|
|
import appeng.util.Platform;
|
|
|
|
|
|
|
|
public class BlockEnergyCell extends AEBaseBlock
|
|
|
|
{
|
|
|
|
|
|
|
|
public double getMaxPower()
|
|
|
|
{
|
|
|
|
return 200000.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public BlockEnergyCell(Class c) {
|
|
|
|
super( c, Material.glass );
|
|
|
|
}
|
|
|
|
|
|
|
|
public BlockEnergyCell() {
|
|
|
|
this( BlockEnergyCell.class );
|
|
|
|
setfeature( EnumSet.of( AEFeature.Core ) );
|
|
|
|
setTileEntiy( TileEnergyCell.class );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public void getSubBlocks(Item id, CreativeTabs tab, List list)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
super.getSubBlocks( id, tab, list );
|
|
|
|
|
|
|
|
ItemStack charged = new ItemStack( this, 1 );
|
|
|
|
NBTTagCompound tag = Platform.openNbtData( charged );
|
|
|
|
tag.setDouble( "internalCurrentPower", getMaxPower() );
|
|
|
|
tag.setDouble( "internalMaxPower", getMaxPower() );
|
|
|
|
list.add( charged );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected Class<? extends BaseBlockRender> getRenderer()
|
|
|
|
{
|
|
|
|
return RenderBlockEnergyCube.class;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public IIcon getIcon(int direction, int metadata)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
switch (metadata)
|
|
|
|
{
|
|
|
|
case 0:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell0.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
case 1:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell1.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
case 2:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell2.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
case 3:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell3.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
case 4:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell4.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
case 5:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell5.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
case 6:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell6.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
case 7:
|
2014-05-26 03:58:44 +02:00
|
|
|
return ExtraBlockTextures.MEEnergyCell7.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
return super.getIcon( direction, metadata );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Class getItemBlockClass()
|
|
|
|
{
|
|
|
|
return AEBaseItemBlockChargeable.class;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|