Examples of addAmount()


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

      return;
    }
    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);
      }
      if (GenericMath.getRandom().nextDouble() < 0.4D) {
        final BlockMaterial mushroomType = block.getMaterial();
        final VariableHeightObject mushroom;
        if (mushroomType == VanillaMaterials.RED_MUSHROOM) {
View Full Code Here

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

  public void onInteractBy(Entity entity, Block block, Action type, BlockFace clickedFace) {
    super.onInteractBy(entity, block, type, clickedFace);
    Slot inv = PlayerUtil.getHeldSlot(entity);
    if (inv != null && inv.get() != null && type.equals(Action.RIGHT_CLICK)) {
      if (grow(block, inv.get().getMaterial()) && !PlayerUtil.isCostSuppressed(entity)) {
        inv.addAmount(-1);
      }
    }
  }

  @Override
View Full Code Here

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

    if (material == null) {
      return;
    }
    block.setMaterial(material);
    if (!PlayerUtil.isCostSuppressed(entity)) {
      selected.addAmount(-1);
    }
  }

  @Override
  public void initialize() {
View Full Code Here

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

  @Override
  public void onInteractBy(Entity entity, Block block, Action type, BlockFace clickedFace) {
    Slot inv = PlayerUtil.getHeldSlot(entity);
    if (inv != null && inv.get() != null && type.equals(Action.RIGHT_CLICK)) {
      if (grow(block, inv.get().getMaterial()) && !PlayerUtil.isCostSuppressed(entity)) {
        inv.addAmount(-1);
      }
    }
  }
}
View Full Code Here

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

      Slot inv = PlayerUtil.getHeldSlot(entity);
      if (inv != null && inv.get() != null) {
        // get color from holding item
        sheep.setColor(Wool.WoolColor.getById((short) (0xF - inv.get().getData())));
        if (!PlayerUtil.isCostSuppressed(entity)) {
          inv.addAmount(-1);
        }
      }
    }
  }
View Full Code Here

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

          //TODO Subtract from inventory component
          // Subtract item
          Slot inv = PlayerUtil.getHeldSlot(entity);
          if (inv != null && !PlayerUtil.isCostSuppressed(entity)) {
            inv.addAmount(-1);
          }
        }
        break;
      }
    }
View Full Code Here

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

        }
        sound.playGlobal(placedBlock.getPosition(), 0.8f, 0.8f);

        // Remove block from inventory
        if (!PlayerUtil.isCostSuppressed(player) && holdingMat == (currentSlot.get() != null ? currentSlot.get().getMaterial() : null)) {
          currentSlot.addAmount(-1);
        }
      }

      refreshClient(player, clickedBlock, clickedFace, rm);
    }
View Full Code Here

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

        entity.get(PlayerInventory.class).getQuickbar().add(fullbottle);
        if (!fullbottle.isEmpty()) {
          entity.get(PlayerInventory.class).getMain().add(fullbottle);
        }
        if (fullbottle.isEmpty() && !PlayerUtil.isCostSuppressed(entity)) {
          slot.addAmount(-1);
        }
      }
    }
  }
}
View Full Code Here

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

    }
    Slot slot = PlayerUtil.getHeldSlot(entity);
    if (slot == null || slot.get() == null || !slot.get().isMaterial(this)) {
      return;
    }
    slot.addAmount(-1);
  }
}
View Full Code Here

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

        // Default ender eye placement
        if (!VanillaMaterials.END_PORTAL_FRAME.hasEyeOfTheEnder(block)) {
          VanillaMaterials.END_PORTAL_FRAME.setEyeOfTheEnder(block, true);
          Slot held = PlayerUtil.getHeldSlot(entity);
          if (held != null && !PlayerUtil.isCostSuppressed(entity)) {
            held.addAmount(-1);
          }
        }
      }
    }
  }
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.