use of jackiecrazy.wardance.networking.UpdateAfflictionPacket in project WarDance by Jackiecrazy.
the class Mark method update.
@Override
public void update() {
final LivingEntity ticker = dude.get();
if (ticker == null)
return;
final Collection<SkillData> active = new ArrayList<>(getActiveMarks().values());
for (SkillData cd : active) {
if (cd.getSkill().markTick(cd.getCaster(ticker.level), ticker, cd))
sync = true;
}
if (sync && ticker instanceof ServerPlayerEntity) {
CombatChannel.INSTANCE.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) ticker), new UpdateAfflictionPacket(ticker.getId(), this.write()));
sync = false;
}
if (sync && EntityHandler.mustUpdate.containsValue(ticker)) {
CombatChannel.INSTANCE.send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> ticker), new UpdateAfflictionPacket(ticker.getId(), this.write()));
sync = false;
}
}
Aggregations