Skip to content

Commit

Permalink
patch drop command save tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 18, 2020
1 parent f806505 commit 31a5018
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -169,7 +169,7 @@ public void execute(ScriptEntry scriptEntry) {
case DROP_EXP:
EntityTag orb = new EntityTag(location.getWorld().spawnEntity(location, EntityType.EXPERIENCE_ORB));
((ExperienceOrb) orb.getBukkitEntity()).setExperience(qty.asInt());
entityList.add(orb.toString());
entityList.addObject(orb);
break;

case DROP_ITEM:
Expand All @@ -188,7 +188,7 @@ public void execute(ScriptEntry scriptEntry) {
((Item) e.getBukkitEntity()).setPickupDelay(delay.getTicksAsInt());
}
}
entityList.add(e.toString());
entityList.addObject(e);
}
}
break;
Expand All @@ -197,7 +197,7 @@ public void execute(ScriptEntry scriptEntry) {
if (qty.asInt() > 1 && entity.isUnique()) {
Debug.echoDebug(scriptEntry, "Cannot drop multiples of this entity because it is Unique!");
entity.spawnAt(location);
entityList.add(entity.toString());
entityList.addObject(entity);
break;
}
for (int x = 0; x < qty.asInt(); x++) {
Expand All @@ -207,15 +207,15 @@ public void execute(ScriptEntry scriptEntry) {
}
EntityTag ent = new EntityTag(entity.getEntityType(), mechanisms);
ent.spawnAt(location);
entityList.add(ent.toString());
entityList.addObject(ent);
}
break;
}

// Add entities to context so that the specific entities dropped can be fetched.
scriptEntry.addObject("dropped_entities", entityList);
if (entityList.size() == 1) {
scriptEntry.addObject("dropped_entity", entityList.get(0));
scriptEntry.addObject("dropped_entity", entityList.getObject(0));
}

}
Expand Down

0 comments on commit 31a5018

Please sign in to comment.