Package thaumic.tinkerer.common.block.tile

Examples of thaumic.tinkerer.common.block.tile.TileFunnel


    }
  }

  @Override
  public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
    TileFunnel funnel = (TileFunnel) par1World.getTileEntity(par2, par3, par4);

    if (funnel != null) {
      for (int j1 = 0; j1 < funnel.getSizeInventory(); ++j1) {
        ItemStack itemstack = funnel.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;
View Full Code Here


    super.breakBlock(par1World, par2, par3, par4, par5, par6);
  }

  @Override
  public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
    TileFunnel funnel = (TileFunnel) par1World.getTileEntity(par2, par3, par4);
    ItemStack stack = funnel.getStackInSlot(0);

    if (stack == null) {
      ItemStack playerStack = par5EntityPlayer.getCurrentEquippedItem();
      if (funnel.canInsertItem(0, playerStack, 1)) {
        funnel.setInventorySlotContents(0, playerStack.splitStack(1));

        if (playerStack.stackSize <= 0)
          par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
        funnel.markDirty();
        return true;
      }
    } else {
      if (!par5EntityPlayer.inventory.addItemStackToInventory(stack))
        par5EntityPlayer.dropPlayerItemWithRandomChoice(stack, false);

      funnel.setInventorySlotContents(0, null);
      funnel.markDirty();
      return true;
    }

    return false;
  }
View Full Code Here

    return false;
  }

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

  BlockJarRenderer jarRenderer = new BlockJarRenderer();
  ItemJarFilledRenderer jarRenderer1 = new ItemJarFilledRenderer();

  @Override
  public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
    TileFunnel funnel = (TileFunnel) tileentity;
    ItemStack stack = funnel.getStackInSlot(0);
    if (stack != null) {
      GL11.glPushMatrix();
      GL11.glTranslated(d0 + 0.5, d1 + 0.365, d2 + 0.5);
      //if(Block.getBlockFromItem(stack.getItem())== ConfigBlocks.blockJar) {
      //  GL11.glTranslatef(0F, 0.25F, 0F);
View Full Code Here

TOP

Related Classes of thaumic.tinkerer.common.block.tile.TileFunnel

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.