@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)); }
@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){ } }
@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; } }
@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())); }
@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(); } }); }
/** * Loads local models when connecting to the server */ @SubscribeEvent @SideOnly(Side.CLIENT) public void onClientConnect(ClientConnectedToServerEvent event) { Blockbuster.proxy.loadModels(Blockbuster.proxy.getPack()); }
@SubscribeEvent public void clientConnect (ClientConnectedToServerEvent e) { if (e.getConnectionType().equalsIgnoreCase("vanilla")) { Seasons.enabled = false; return; } else Seasons.enabled = true; }
@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(); }
@SubscribeEvent(priority = EventPriority.LOWEST) public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) { proxy.clientConnect(event); }
public void clientConnect(@Nonnull final ClientConnectedToServerEvent event) { // NOTHING SHOULD BE HERE - OVERRIDE IN ProxyClient! }
@SubscribeEvent public void onClientConnect(ClientConnectedToServerEvent event) { TFC.proxy.onClientLogin(); }
/** * 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(); }
/** Resets all synced values of the settings after disconnecting. */ @SideOnly(Side.CLIENT) @SubscribeEvent public void onDisconnectedFromServer(ClientConnectedToServerEvent event) { _connected = true; }