Package org.spout.api.inventory

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


    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

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.