Search in sources :

Example 1 with TileEntityPileFuel

use of com.hbm.tileentity.machine.pile.TileEntityPileFuel in project Hbm-s-Nuclear-Tech-GIT by HbmMods.

the class BlockGraphiteFuel method onScrew.

@Override
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
    if (!world.isRemote) {
        if (tool == ToolType.SCREWDRIVER) {
            int meta = world.getBlockMetadata(x, y, z) & 3;
            if (side == meta * 2 || side == meta * 2 + 1) {
                world.setBlock(x, y, z, ModBlocks.block_graphite_drilled, meta, 3);
                this.ejectItem(world, x, y, z, ForgeDirection.getOrientation(side), new ItemStack(ModItems.pile_rod_uranium));
            }
        }
        if (tool == ToolType.HAND_DRILL) {
            TileEntityPileFuel pile = (TileEntityPileFuel) world.getTileEntity(x, y, z);
            player.addChatComponentMessage(new ChatComponentText("CP1 FUEL ASSEMBLY " + x + " " + y + " " + z).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
            player.addChatComponentMessage(new ChatComponentText("HEAT: " + pile.heat + "/" + pile.maxHeat).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
            player.addChatComponentMessage(new ChatComponentText("DEPLETION: " + pile.progress + "/" + pile.maxProgress).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
            player.addChatComponentMessage(new ChatComponentText("FLUX: " + pile.lastNeutrons).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
        }
    }
    return true;
}
Also used : ChatStyle(net.minecraft.util.ChatStyle) TileEntityPileFuel(com.hbm.tileentity.machine.pile.TileEntityPileFuel) ItemStack(net.minecraft.item.ItemStack) ChatComponentText(net.minecraft.util.ChatComponentText)

Aggregations

TileEntityPileFuel (com.hbm.tileentity.machine.pile.TileEntityPileFuel)1 ItemStack (net.minecraft.item.ItemStack)1 ChatComponentText (net.minecraft.util.ChatComponentText)1 ChatStyle (net.minecraft.util.ChatStyle)1