Solar Panel & Heat Collector energy storage info

This commit is contained in:
Ellpeck 2015-10-10 15:29:02 +02:00
parent 4555edb18f
commit 23ae640286
2 changed files with 28 additions and 0 deletions

View file

@ -18,11 +18,13 @@ import ellpeck.actuallyadditions.util.IActAddItemOrBlock;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -37,6 +39,18 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IActAddItem
this.setBlockBounds(0F, 0F, 0F, 1F, 3F/16F, 1F); this.setBlockBounds(0F, 0F, 0F, 1F, 3F/16F, 1F);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityFurnaceSolar generator = (TileEntityFurnaceSolar)world.getTileEntity(x, y, z);
if(generator != null){
player.addChatComponentMessage(new ChatComponentText(generator.storage.getEnergyStored()+"/"+generator.storage.getMaxEnergyStored()+" RF"));
}
return true;
}
return true;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityFurnaceSolar(); return new TileEntityFurnaceSolar();

View file

@ -18,10 +18,12 @@ import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -48,6 +50,18 @@ public class BlockHeatCollector extends BlockContainerBase implements IActAddIte
return side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon); return side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon);
} }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
if(!world.isRemote){
TileEntityHeatCollector generator = (TileEntityHeatCollector)world.getTileEntity(x, y, z);
if(generator != null){
player.addChatComponentMessage(new ChatComponentText(generator.storage.getEnergyStored()+"/"+generator.storage.getMaxEnergyStored()+" RF"));
}
return true;
}
return true;
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){