Added infos on power store block

This commit is contained in:
LemADEC 2014-08-17 11:35:01 +02:00
parent ae82ba885f
commit bf65eda81e

View file

@ -1,8 +1,10 @@
package cr0s.WarpDrive.machines;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
@ -31,4 +33,22 @@ public class BlockPowerStore extends WarpBlockContainer {
public void registerIcons(IconRegister par1IconRegister) {
iconBuffer = par1IconRegister.registerIcon("warpdrive:powerStore");
}
/**
* Called upon block activation (right click on the block.)
*/
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
return false;
}
WarpEnergyTE te = (WarpEnergyTE)par1World.getBlockTileEntity(par2, par3, par4);
if (te != null && (par5EntityPlayer.getHeldItem() == null)) {
par5EntityPlayer.addChatMessage(te.getStatus());
return true;
}
return false;
}
}