Package mekanism.common.tile

Examples of mekanism.common.tile.TileEntityBin


    if(this == Mekanism.BasicBlock)
    {
      if(!world.isRemote && meta == 6)
      {
        TileEntityBin bin = (TileEntityBin)world.getTileEntity(x, y, z);
        MovingObjectPosition pos = MekanismUtils.rayTrace(world, player);

        if(pos != null && pos.sideHit == bin.facing)
        {
          if(bin.bottomStack != null)
          {
            if(!player.isSneaking())
            {
              world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.removeStack().copy()));
            }
            else {
              world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.remove(1).copy()));
            }
          }
        }
      }
    }
View Full Code Here


        return true;
      }

      if(metadata == 6)
      {
        TileEntityBin bin = (TileEntityBin)world.getTileEntity(x, y, z);

        if(bin.getItemCount() < bin.MAX_STORAGE)
        {
          if(bin.addTicks == 0 && entityplayer.getCurrentEquippedItem() != null)
          {
            if(entityplayer.getCurrentEquippedItem() != null)
            {
              ItemStack remain = bin.add(entityplayer.getCurrentEquippedItem());
              entityplayer.setCurrentItemOrArmor(0, remain);
              bin.addTicks = 5;
            }
          }
          else if(bin.addTicks > 0 && bin.getItemCount() > 0)
          {
            ItemStack[] inv = entityplayer.inventory.mainInventory;

            for(int i = 0; i < inv.length; i++)
            {
              if(bin.getItemCount() == bin.MAX_STORAGE)
              {
                break;
              }

              if(inv[i] != null)
              {
                ItemStack remain = bin.add(inv[i]);
                inv[i] = remain;
                bin.addTicks = 5;
              }

              ((EntityPlayerMP)entityplayer).sendContainerAndContentsToPlayer(entityplayer.openContainer, entityplayer.openContainer.getInventory());
View Full Code Here

    if(this == Mekanism.BasicBlock)
    {
      switch(metadata)
      {
        case 6:
          return new TileEntityBin();
        case 9:
          return new TileEntityDynamicTank();
        case 10:
          return new TileEntityDynamicTank();
        case 11:
View Full Code Here

    if(this == Mekanism.BasicBlock)
    {
      if(ret.getItemDamage() == 6)
      {
        TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(x, y, z);
        InventoryBin inv = new InventoryBin(ret);

        inv.setItemCount(tileEntity.getItemCount());

        if(tileEntity.getItemCount() > 0)
        {
          inv.setItemType(tileEntity.itemType);
        }
      }
    }
View Full Code Here

    {
      if(Block.getBlockFromItem(this) == Mekanism.BasicBlock)
      {
        if(stack.getItemDamage() == 6 && stack.stackTagCompound != null)
        {
          TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(x, y, z);
          InventoryBin inv = new InventoryBin(stack);

          if(inv.getItemType() != null)
          {
            tileEntity.setItemType(inv.getItemType());
          }

          tileEntity.setItemCount(inv.getItemCount());
        }
      }
    }

    return place;
View Full Code Here

TOP

Related Classes of mekanism.common.tile.TileEntityBin

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.