use of com.ichorpowered.guardianapi.detection.capture.Capture in project guardian by ichorpowered.
the class GuardianSequenceManager method tickScheduler.
private void tickScheduler() {
Sponge.getServer().getOnlinePlayers().forEach(player -> {
final GuardianPlayerEntry entityEntry = GuardianPlayerEntry.of(player, player.getUniqueId());
this.updateSchedulerIf(SequenceContext.builder().id(entityEntry.getUniqueId()).custom(CommonContextKeys.ENTITY_ENTRY, entityEntry).build(), sequence -> {
final GuardianSequence guardianSequence = (GuardianSequence) sequence;
// Update captures.
if (guardianSequence.getState().equals(Sequence.State.ACTIVE)) {
for (Capture capture : guardianSequence.getCaptureRegistry()) {
capture.update(entityEntry, guardianSequence.getCaptureRegistry().getContainer());
}
return true;
}
return false;
});
});
}
Aggregations