Package mekanism.common.tile

Examples of mekanism.common.tile.TileEntityElectricBlock


      }
    }

    if(place && super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata))
    {
      TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);
      tileEntity.electricityStored = getEnergy(stack);

      ((ISustainedInventory)tileEntity).setInventory(getInventory(stack));
     
      if(tileEntity instanceof ISustainedData)
View Full Code Here


  @Override
  @SideOnly(Side.CLIENT)
  public void randomDisplayTick(World world, int x, int y, int z, Random random)
  {
    int metadata = world.getBlockMetadata(x, y, z);
    TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);
    if(MekanismUtils.isActive(world, x, y, z))
    {
      float xRandom = (float)x + 0.5F;
      float yRandom = (float)y + 0.0F + random.nextFloat() * 6.0F / 16.0F;
      float zRandom = (float)z + 0.5F;
View Full Code Here

  }

  @Override
  public void breakBlock(World world, int x, int y, int z, Block block, int meta)
  {
    TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);

    if(tileEntity instanceof IBoundingBlock)
    {
      ((IBoundingBlock)tileEntity).onBreak();
    }
View Full Code Here

    if(world.isRemote)
    {
      return true;
    }

    TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);
    int metadata = world.getBlockMetadata(x, y, z);

    if(entityplayer.getCurrentEquippedItem() != null)
    {
      Item tool = entityplayer.getCurrentEquippedItem().getItem();

      if(MekanismUtils.hasUsableWrench(entityplayer, x, y, z))
      {
        if(entityplayer.isSneaking())
        {
          dismantleBlock(world, x, y, z, false);
          return true;
        }

        if(ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool instanceof IToolWrench)
          ((IToolWrench)tool).wrenchUsed(entityplayer, x, y, z);

        int change = ForgeDirection.ROTATION_MATRIX[ForgeDirection.UP.ordinal()][tileEntity.facing];

        tileEntity.setFacing((short)change);
        world.notifyBlocksOfNeighborChange(x, y, z, this);
        return true;
      }
    }
View Full Code Here

  }

  @Override
  public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
  {
    TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);
    ItemStack itemStack = new ItemStack(MekanismGenerators.Generator, 1, world.getBlockMetadata(x, y, z));

    if(tileEntity == null)
    {
      return null;
    }

    IEnergizedItem electricItem = (IEnergizedItem)itemStack.getItem();
    electricItem.setEnergy(itemStack, tileEntity.electricityStored);

    ISustainedInventory inventory = (ISustainedInventory)itemStack.getItem();
    inventory.setInventory(tileEntity.getInventory(), itemStack);
   
    if(tileEntity instanceof ISustainedData)
    {
      ((ISustainedData)tileEntity).writeSustainedData(itemStack);
    }
View Full Code Here

TOP

Related Classes of mekanism.common.tile.TileEntityElectricBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.