use of mods.railcraft.common.util.network.PacketShuntingAura in project Railcraft by Railcraft.
the class ShuntingAuraTickHandler method tick.
@SubscribeEvent
public void tick(PlayerEvent.LivingUpdateEvent event) {
EntityLivingBase entity = event.getEntityLiving();
if (Game.isClient(entity.worldObj))
return;
clock++;
if (clock % 16 != 0)
return;
if (entity instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP) entity;
if (ItemGoggles.isPlayerWearing(player)) {
ItemStack goggles = ItemGoggles.getGoggles(player);
ItemGoggles.GoggleAura aura = ItemGoggles.getCurrentAura(goggles);
if (aura == ItemGoggles.GoggleAura.SHUNTING) {
List<EntityMinecart> carts = EntitySearcher.findMinecarts().around(player, 32F).at(player.worldObj);
PacketShuntingAura pkt = new PacketShuntingAura(carts);
PacketDispatcher.sendToPlayer(pkt.getPacket(), player);
}
}
}
}
Aggregations