Java 类net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent 实例源码

项目:OreLogger    文件:Listener.java   
@SubscribeEvent
public void onConnect(ClientConnectedToServerEvent event) {
    VersionChecker.checkVersion();
    // forges api doesnt offer a listener for block breaks client side only, so we resort to dirty hacks. To understand
    // how this works,
    // you need a basic understanding of netty

    // We insert our own outbound manager inbetween forge's packet handler and minecrafts packet handler. At this point
    // decryption, decompression and deserialization are done and the data being passed is an event with which we can
    // work
    event.getManager().channel().pipeline()
            .addAfter("fml:packet_handler", "processBreaks", new BlockBreakHandler(sbCounter));
}
项目:TaleCraft    文件:SendMessage.java   
@SubscribeEvent
public void onClientConnection(ClientConnectedToServerEvent event){
    try{
        final TCVersion latest = VersionParser.getLatestVersion();
        final String current = Reference.MOD_VERSION; //to be easily changeable for debugging
        if(latest.isGreaterVersion(current)){
            final ClientProxy cproxy = TaleCraft.proxy.asClient();
            cproxy.sheduleClientTickTask(new Runnable(){
                Minecraft mc = ClientProxy.mc;
                @Override
                public void run() {
                    while(mc.player == null){}
                    String message = TextFormatting.YELLOW + "TaleCraft version is outdated! Your version is " + TextFormatting.GOLD + current + TextFormatting.YELLOW + ". The latest is " + TextFormatting.GOLD + latest.getVersion() + TextFormatting.YELLOW + ".";
                    mc.player.sendMessage(new TextComponentString(message));
                    TaleCraft.logger.warn(TextFormatting.getTextWithoutFormattingCodes(message));
                }
            });
        }
    }catch(Exception e){

    }
}
项目:Autotip    文件:HypixelListener.java   
@SubscribeEvent
public void playerLoggedIn(ClientConnectedToServerEvent event) {
    lastIp = UniversalUtil.getRemoteAddress(event).toString().toLowerCase();
    if (lastIp.contains(".hypixel.net") || lastIp.contains("209.222.115.14")) {
        Autotip.onHypixel = true;
        Tipper.waveCounter = 910;
        Autotip.THREAD_POOL.submit(new StartLogin());
    } else {
        Autotip.onHypixel = false;
    }
}
项目:UniversalRemote    文件:VanillaPacketInterceptorInjector.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onClientConnectedToServerEvent(ClientConnectedToServerEvent event)
{
    Util.logger.info("Injecting vanilla packet interceptors...");

    event.getManager().channel().pipeline().addBefore("packet_handler", "universalremote_join_game_handler", new JoinGameInterceptor(event.getManager()));
    event.getManager().channel().pipeline().addBefore("packet_handler", "universalremote_respawn_handler", new RespawnInterceptor(event.getManager()));
}
项目:DynamicSurroundings    文件:ProxyClient.java   
@Override
public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) {
    Minecraft.getMinecraft().addScheduledTask(new Runnable() {
        public void run() {
            EffectManager.register();
            GuiHUDHandler.register();
            ProxyClient.this.connectionTime = System.currentTimeMillis();
        }
    });
}
项目:blockbuster    文件:ModelHandler.java   
/**
 * Loads local models when connecting to the server
 */
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onClientConnect(ClientConnectedToServerEvent event)
{
    Blockbuster.proxy.loadModels(Blockbuster.proxy.getPack());
}
项目:SeasonsAPI    文件:WorldHandler.java   
@SubscribeEvent
public void clientConnect (ClientConnectedToServerEvent e) {
    if (e.getConnectionType().equalsIgnoreCase("vanilla")) {
        Seasons.enabled = false;
        return;
    } else
        Seasons.enabled = true;
}
项目:IngameAccountSwitcher    文件:VersionChecker.java   
@SubscribeEvent
public void onPlayerJoinClient(final ClientConnectedToServerEvent event){
    (new Thread(){
        @Override
        public void run(){
            while(FMLClientHandler.instance().getClientPlayerEntity() == null)
                try{
                    Thread.sleep(100);
                }catch(InterruptedException e){

                }
            tryNotifyClient(FMLClientHandler.instance().getClientPlayerEntity());
        }
    }).start();
}
项目:DynamicSurroundings    文件:DSurround.java   
@SubscribeEvent(priority = EventPriority.LOWEST)
public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) {
    proxy.clientConnect(event);
}
项目:DynamicSurroundings    文件:Proxy.java   
public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) {
    // NOTHING SHOULD BE HERE - OVERRIDE IN ProxyClient!
}
项目:TFC2    文件:PlayerTracker.java   
@SubscribeEvent
public void onClientConnect(ClientConnectedToServerEvent event)
{
    TFC.proxy.onClientLogin();
}
项目:morecommands    文件:ClientHandler.java   
/**
 * Invoked when the player joins a server. Starts the startup commands execution thread if
 * the server is not the integrated server.
 */
@SubscribeEvent
public void playerConnect(ClientConnectedToServerEvent event) {
    PacketHandlerClient.runStartupCommandsThread();
}
项目:TFC2    文件:PlayerTracker.java   
@SubscribeEvent
public void onClientConnect(ClientConnectedToServerEvent event)
{
    TFC.proxy.onClientLogin();
}
项目:WearableBackpacks    文件:BackpacksConfig.java   
/** Resets all synced values of the settings after disconnecting. */
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onDisconnectedFromServer(ClientConnectedToServerEvent event)
    { _connected = true; }