Posted February 27, 20178 yr Tried things like finding the net-handler, but did not succeed. What's the best way to do so in 1.11.2? (Ping to the server I'm currently connected to) Thanks!
February 28, 20178 yr Author 15 hours ago, diesieben07 said: NetHandlerPlayClient::getPlayerInfo(Minecraft.getMinecraft().player.getGameProfile().getId()) will give you a NetworkPlayerInfo instance, which has getResponseTime. Is there an example code I can see somewhere?
February 28, 20178 yr Author 2 hours ago, diesieben07 said: Wasn't that already an example? Not really sure how to use the " NetHandlerPlayClient::getPlayerInfo " part
February 28, 20178 yr NetHandlerPlayClient::getPlayerInfo , you get the netHandler from the EntityPlayerSP (this is inside Minecraft.class) and then you call the getPlayerInfo() methode catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
March 1, 20178 yr Author 23 hours ago, MCenderdragon said: NetHandlerPlayClient::getPlayerInfo , you get the netHandler from the EntityPlayerSP (this is inside Minecraft.class) and then you call the getPlayerInfo() methode Can't find it.
March 1, 20178 yr NetHandlerPlayClient != EntityPlayerSP you wont find getPlayerInfo inside the wrong class. also just look at the fields in the EntityPlayer and check what is a NetHandler catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
March 1, 20178 yr Author 14 minutes ago, MCenderdragon said: NetHandlerPlayClient != EntityPlayerSP you wont find getPlayerInfo inside the wrong class. also just look at the fields in the EntityPlayer and check what is a NetHandler Still can't find it
March 1, 20178 yr Minecraft has not a netHandler, the netHandler is inside the player. Edited March 1, 20178 yr by MCenderdragon catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
March 1, 20178 yr Author 1 minute ago, MCenderdragon said: Minecraft has not a netHandler, the netHandler is inside the player. So how can I access it if it's not by using mc.player?
March 1, 20178 yr just look at the fields in side the playerSP class there IS somewhere the net handler. if the field is not public there IS somewhere a getter. Edited March 1, 20178 yr by MCenderdragon catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
March 1, 20178 yr Author 2 hours ago, diesieben07 said: It is via Minecraft::player. Sorry, what does the :: mean? is it like the Minecraft.getMinecraft(); thing? 2 hours ago, MCenderdragon said: just look at the fields in side the playerSP class there IS somewhere the net handler. if the field is not public there IS somewhere a getter. Is there a playerSP class? could find only the playercontrollerMP class but not this one.
March 1, 20178 yr 10 minutes ago, Bets said: Sorry, what does the :: mean? is it like the Minecraft.getMinecraft(); thing? It means it is a non static field in Minecraft... You can also use # but diesieben likes it more... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
March 3, 20178 yr Author 13 hours ago, diesieben07 said: EntityPlayerSP player = Minecraft.getMinecraft().player; NetworkPlayerInfo npi = player.connection.getPlayerInfo(player.getGameProfile().getId()); And now you need to go learn Java. Seriously. Oh so this is what you mean, yeah I used that before in my code. I just did not under stand what the :: and # stuff means Thank you!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.