Examples of tryPlaceItemIntoWorld()


Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

        // force the block to be air block, in case it's just a soft
        // block which replacement is not straightforward
        context.world().setBlock(x, y, z, Blocks.air, 0, 3);

        stack.tryPlaceItemIntoWorld(
            BuildCraftAPI.proxy.getBuildCraftPlayer(context.world()),
            context.world(), x, y, z, 1, 0.0f, 0.0f, 0.0f);
      }
    } else {
      context.world().setBlock(x, y, z, Blocks.air, 0, 3);
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

      int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)).size();

      if(entities == 0) {
        ItemStack stackToPlace = new ItemStack(Blocks.dirt);
        stackToPlace.tryPlaceItemIntoWorld(player, world, x, y, z, 0, 0F, 0F, 0F);

        if(stackToPlace.stackSize == 0) {
          ManaItemHandler.requestManaExact(stack, player, COST * 2, true);
          for(int i = 0; i < 6; i++)
            Botania.proxy.sparkleFX(world, x + Math.random(), y + Math.random(), z + Math.random(), 0.35F, 0.2F, 0.05F, 1F, 5);
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

  public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
    if(ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, false) && !par3World.provider.isHellWorld) {
      ForgeDirection dir = ForgeDirection.getOrientation(par7);

      ItemStack stackToPlace = new ItemStack(Blocks.flowing_water);
      stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);

      if(stackToPlace.stackSize == 0) {
        ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, true);
        for(int i = 0; i < 6; i++)
          Botania.proxy.sparkleFX(par3World, par4 + dir.offsetX + Math.random(), par5 + dir.offsetY + Math.random(), par6 + dir.offsetZ + Math.random(), 0.2F, 0.2F, 1F, 1F, 5);
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

      ForgeDirection dir = ForgeDirection.getOrientation(par7);
      int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size();

      if(entities == 0) {
        ItemStack stackToPlace = new ItemStack(Blocks.dirt);
        stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);

        if(stackToPlace.stackSize == 0) {
          ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, true);
          for(int i = 0; i < 6; i++)
            Botania.proxy.sparkleFX(par3World, par4 + dir.offsetX + Math.random(), par5 + dir.offsetY + Math.random(), par6 + dir.offsetZ + Math.random(), 0.35F, 0.2F, 0.05F, 1F, 5);
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

  }

  @Override
  public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
    ItemStack stackToPlace = new ItemStack(ModBlocks.buriedPetals, 1, par1ItemStack.getItemDamage());
    stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);

    if(stackToPlace.stackSize == 0) {
      if(!par2EntityPlayer.capabilities.isCreativeMode)
        par1ItemStack.stackSize--;
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

        // force the block to be air block, in case it's just a soft
        // block which replacement is not straightforward
        context.world().setBlock(x, y, z, Blocks.air, 0, 3);

        stack.tryPlaceItemIntoWorld(
            BuildCraftAPI.proxy.getBuildCraftPlayer((WorldServer) context.world()).get(),
            context.world(), x, y, z, 1, 0.0f, 0.0f, 0.0f);
      }
    } else {
      context.world().setBlock(x, y, z, Blocks.air, 0, 3);
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

        // force the block to be air block, in case it's just a soft
        // block which replacement is not straightforward
        context.world().setBlock(x, y, z, Blocks.air, 0, 3);

        stack.tryPlaceItemIntoWorld(
            BuildCraftAPI.proxy.getBuildCraftPlayer((WorldServer) context.world()).get(),
            context.world(), x, y, z, 1, 0.0f, 0.0f, 0.0f);
      }
    } else {
      context.world().setBlock(x, y, z, Blocks.air, 0, 3);
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

          stack.stackSize = 0;
        }
      }
    } else if (stack.getItem() instanceof ItemBlock) {
      if (getWorld().getBlock((int) p.x, (int) p.y, (int) p.z) == Blocks.air) {
        stack.tryPlaceItemIntoWorld(
            player,
          getWorld(), (int) p.x, (int) p.y, (int) p.z, 1, 0.0f, 0.0f,
          0.0f);
      }
    } else {
View Full Code Here

Examples of net.minecraft.item.ItemStack.tryPlaceItemIntoWorld()

            player,
          getWorld(), (int) p.x, (int) p.y, (int) p.z, 1, 0.0f, 0.0f,
          0.0f);
      }
    } else {
      stack.tryPlaceItemIntoWorld(
          player,
          getWorld(), (int) p.x, (int) p.y, (int) p.z, 1, 0.0f, 0.0f,
          0.0f);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.