Пример #1
0
  @Override
  public void run(EventData data) throws BailException {
    Location loc = locationDP.get(data);
    if (loc == null) return;

    for (ModDamageItemStack item : items) item.update(data);

    Number quant = this.quantity.get(data);
    if (quant == null) return;

    int quantity = quant.intValue();

    for (int i = 0; i < quantity; i++) {
      for (ModDamageItemStack item : items) {
        ItemHolder holder = new ItemHolder(item.toItemStack());

        if (routines != null) {
          // have to copy the enchantments map because it is immutable
          routines.run(myInfo.makeChainedData(data, holder));
        }

        loc.getWorld().dropItemNaturally(loc, holder.getItem());
      }
    }
  }
Пример #2
0
 @Override
 public Boolean get(EventData data) throws BailException {
   Boolean b = bool.get(data);
   if (b == null) return true;
   return !b;
 }