use of com.playmonumenta.scriptedquests.quests.InteractableEntry in project scripted-quests by TeamMonumenta.
the class InteractableManager method handleEvent.
private boolean handleEvent(Plugin plugin, Player player, ItemStack item, InteractType type, List<InteractableEntry> entries) {
boolean cancelEvent = false;
QuestContext context = new QuestContext(plugin, player, null, false, null, item);
for (InteractableEntry entry : entries) {
if (entry.interactEvent(context, type)) {
cancelEvent = true;
}
}
return cancelEvent;
}
use of com.playmonumenta.scriptedquests.quests.InteractableEntry in project scripted-quests by TeamMonumenta.
the class InteractableManager method reload.
/*
* If sender is non-null, it will be sent debugging information
*/
public void reload(Plugin plugin, CommandSender sender) {
mInteractables.clear();
QuestUtils.loadScriptedQuests(plugin, "interactables", sender, (object) -> {
InteractableEntry interactable = new InteractableEntry(object);
for (Material material : interactable.getMaterials()) {
mInteractables.computeIfAbsent(material, k -> new ArrayList<>()).add(interactable);
}
return (interactable.getMaterials().size() == 1 ? interactable.getMaterials().iterator().next() : interactable.getMaterials()) + ":" + interactable.getComponents().size();
});
}
Aggregations