Package mekanism.common.tile

Examples of mekanism.common.tile.TileEntityEnergyCube


    if(world.isRemote)
    {
      return true;
    }

    TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getTileEntity(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[side][tileEntity.facing];

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


  }

  @Override
  public TileEntity createNewTileEntity(World world, int meta)
  {
    TileEntityEnergyCube tile = new TileEntityEnergyCube();
    return tile;
  }
View Full Code Here

  }

  @Override
  public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
  {
    TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getTileEntity(x, y, z);
    ItemStack itemStack = new ItemStack(Mekanism.EnergyCube);

    IEnergyCube energyCube = (IEnergyCube)itemStack.getItem();
    energyCube.setEnergyCubeTier(itemStack, tileEntity.tier);
View Full Code Here

  }

  @Override
  public int getComparatorInputOverride(World world, int x, int y, int z, int par5)
  {
    TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getTileEntity(x, y, z);
    return tileEntity.getRedstoneLevel();
  }
View Full Code Here

  {
    boolean place = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);

    if(place)
    {
      TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getTileEntity(x, y, z);
      tileEntity.tier = ((IEnergyCube)stack.getItem()).getEnergyCubeTier(stack);
      tileEntity.electricityStored = getEnergy(stack);

      ((ISustainedInventory)tileEntity).setInventory(getInventory(stack));

      if(!world.isRemote)
      {
        Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tileEntity)));
      }
    }

    return place;
  }
View Full Code Here

TOP

Related Classes of mekanism.common.tile.TileEntityEnergyCube

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.