Examples of addAmount()


Examples of org.spout.api.inventory.Slot.addAmount()

    if (inv != null && inv.get() != null && type.equals(Action.RIGHT_CLICK) && clickedFace.equals(BlockFace.TOP) && block.translate(BlockFace.TOP).isMaterial(VanillaMaterials.AIR)) {
      if (inv.get().isMaterial(VanillaMaterials.CARROT)) {
        block.translate(clickedFace).setMaterial(VanillaMaterials.CARROT_CROP);
        if (!(PlayerUtil.isCostSuppressed(entity))) {
          inv.addAmount(-1);
        }
      }

      if (inv.get().isMaterial(VanillaMaterials.POTATO)) {
        block.translate(clickedFace).setMaterial(VanillaMaterials.POTATO_CROP);
View Full Code Here

Examples of org.spout.api.inventory.Slot.addAmount()

      }

      if (inv.get().isMaterial(VanillaMaterials.POTATO)) {
        block.translate(clickedFace).setMaterial(VanillaMaterials.POTATO_CROP);
        if (!(PlayerUtil.isCostSuppressed(entity))) {
          inv.addAmount(-1);
        }
      }
    }
  }
}
View Full Code Here

Examples of org.spout.api.inventory.Slot.addAmount()

    super.onInteractBy(entity, block, type, clickedFace);
    Slot inv = PlayerUtil.getHeldSlot(entity);

    if (inv != null && inv.get() != null && inv.get().isMaterial(Dye.BONE_MEAL) && type.equals(Action.RIGHT_CLICK)) {
      if (!PlayerUtil.isCostSuppressed(entity)) {
        inv.addAmount(-1);
      }
      final Random random = GenericMath.getRandom();
      // Minecraft does grass growing by Bone Meal as follows. Keep in mind the radius is 8.
      // - Tall Grass is placed 9/10 times.
      // - If Tall Grass fails, place Dandelion 2/3 times (within the 1/10 window Tall Grass failed on)
View Full Code Here

Examples of org.spout.vanilla.inventory.block.BrewingStandInventory.addAmount()

            return;
          }
        }
        input = inventory.getInput(); // Store input just in case it is later removed during the brewing process
        setBrewTime(1);
        inventory.addAmount(BrewingStandInventory.INPUT_SLOT, -1);
      }
    } else {
      // Continue brewing
      float newBrewTime = getBrewTime() + dt;
      if (newBrewTime > BREW_TIME_INCREMENT) {
View Full Code Here

Examples of org.spout.vanilla.inventory.block.FurnaceInventory.addAmount()

      } else {
        result = event.getResult();
        if (inventory.getOutput().getMaterial().getId() != result.getMaterial().getId()) {
          throw new UnsupportedOperationException("Smelt result must be the same material as the output slot.");
        }
        inventory.addAmount(FurnaceInventory.OUTPUT_SLOT, result.getAmount());
      }
      inventory.addAmount(FurnaceInventory.INGREDIENT_SLOT, -1);
    }

    setMaxSmeltTime(-1);
View Full Code Here

Examples of org.spout.vanilla.inventory.block.FurnaceInventory.addAmount()

        if (inventory.getOutput().getMaterial().getId() != result.getMaterial().getId()) {
          throw new UnsupportedOperationException("Smelt result must be the same material as the output slot.");
        }
        inventory.addAmount(FurnaceInventory.OUTPUT_SLOT, result.getAmount());
      }
      inventory.addAmount(FurnaceInventory.INGREDIENT_SLOT, -1);
    }

    setMaxSmeltTime(-1);
    setSmeltTime(-1);
  }
View Full Code Here

Examples of org.spout.vanilla.inventory.block.FurnaceInventory.addAmount()

          return;
        }
        newFuel = event.getBurnTime();
        setMaxFuel(newFuel);
        setFuel(newFuel);
        inventory.addAmount(FurnaceInventory.FUEL_SLOT, -1);
        setBurning(true);
        return;
      }

      setBurning(false);
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.