use of com.lying.variousoddities.network.PacketSyncSpecies in project VariousOddities by Lyinginbedmon.
the class VOBusServer method onPlayerLogInEvent.
@SubscribeEvent
public static void onPlayerLogInEvent(PlayerLoggedInEvent event) {
PlayerEntity player = event.getPlayer();
PacketHandler.sendTo((ServerPlayerEntity) player, new PacketSyncSpecies(VORegistries.SPECIES));
LivingData data = LivingData.forEntity(player);
if (data != null) {
PacketHandler.sendToAll((ServerWorld) player.getEntityWorld(), new PacketSyncLivingData(player.getUniqueID(), data));
data.getAbilities().markDirty();
if (!data.hasSelectedSpecies() && ConfigVO.MOBS.selectSpeciesOnLogin.get()) {
if (!player.getEntityWorld().isRemote)
PacketHandler.sendTo((ServerPlayerEntity) player, new PacketSpeciesOpenScreen());
player.addPotionEffect(new EffectInstance(Effects.RESISTANCE, Reference.Values.TICKS_PER_MINUTE * 15, 15, true, false));
}
}
}
Aggregations