use of com.playmonumenta.scriptedquests.quests.components.QuestComponent in project scripted-quests by TeamMonumenta.
the class CodeEntry method doActionsIfCodeMatches.
public boolean doActionsIfCodeMatches(Plugin plugin, Player player, String code) {
String goodCode = getCodeForPlayer(player).toLowerCase().replaceAll("\\s", "");
code = code.toLowerCase().replaceAll("\\s", "");
if (goodCode.equals(code)) {
for (QuestComponent component : mComponents) {
component.doActionsIfPrereqsMet(new QuestContext(plugin, player, null));
}
return true;
}
return false;
}
use of com.playmonumenta.scriptedquests.quests.components.QuestComponent in project scripted-quests by TeamMonumenta.
the class ClientChatProtocol method sendPacket.
public static void sendPacket(List<QuestComponent> packet, QuestContext context) {
// implements `S->C 'actions'`
JsonObject data = JsonObjectBuilder.get().add("type", "actions").add("data", packet.stream().map(v -> v.serializeForClientAPI(context)).map(v -> v.orElse(null)).collect(Collectors.toList())).build();
sendJson(context.getPlayer(), data);
}
Aggregations