Search in sources :

Example 1 with ColonyStylesMessage

use of com.minecolonies.coremod.network.messages.ColonyStylesMessage in project minecolonies by Minecolonies.

the class FMLEventHandler method onPlayerLogin.

/**
 * Called when a player logs in. If the joining player is a MP-Player, sends
 * all possible styles in a message.
 *
 * @param event {@link net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent}
 */
@SubscribeEvent
public void onPlayerLogin(@NotNull final PlayerEvent.PlayerLoggedInEvent event) {
    if (event.player instanceof EntityPlayerMP) {
        MineColonies.getNetwork().sendTo(new ServerUUIDMessage(), (EntityPlayerMP) event.player);
        MineColonies.getNetwork().sendTo(new ColonyStylesMessage(), (EntityPlayerMP) event.player);
    // ColonyManager.syncAllColoniesAchievements();
    }
}
Also used : EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) ColonyStylesMessage(com.minecolonies.coremod.network.messages.ColonyStylesMessage) ServerUUIDMessage(com.minecolonies.coremod.network.messages.ServerUUIDMessage) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

ColonyStylesMessage (com.minecolonies.coremod.network.messages.ColonyStylesMessage)1 ServerUUIDMessage (com.minecolonies.coremod.network.messages.ServerUUIDMessage)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1