Search in sources :

Example 1 with Capture

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;
        });
    });
}
Also used : GuardianPlayerEntry(com.ichorpowered.guardian.entry.GuardianPlayerEntry) Capture(com.ichorpowered.guardianapi.detection.capture.Capture)

Aggregations

GuardianPlayerEntry (com.ichorpowered.guardian.entry.GuardianPlayerEntry)1 Capture (com.ichorpowered.guardianapi.detection.capture.Capture)1