use of com.lying.variousoddities.network.PacketSyncAir in project VariousOddities by Lyinginbedmon.
the class VOBusServer method onChangeDimensionEvent.
@SubscribeEvent
public static void onChangeDimensionEvent(EntityTravelToDimensionEvent event) {
Entity entity = event.getEntity();
if (!entity.getEntityWorld().isRemote && entity.getType() == EntityType.PLAYER) {
PlayerEntity player = (PlayerEntity) entity;
LivingData data = LivingData.forEntity(player);
if (data != null) {
PacketHandler.sendTo((ServerPlayerEntity) player, new PacketSyncAir(data.getAir()));
data.getAbilities().markDirty();
}
}
if (entity instanceof LivingEntity && ((LivingEntity) entity).isPotionActive(VOPotions.ANCHORED))
event.setCanceled(true);
}
Aggregations