Jump to content

Recommended Posts

Posted

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!

Posted
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?

Posted
2 hours ago, diesieben07 said:

Wasn't that already an example?

 

Not really sure how to use the " NetHandlerPlayClient::getPlayerInfo " part :/ 

Posted

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).

Posted
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.

Screenshot_2.png

Posted

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).

Posted
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

Screenshot_3.png

Posted (edited)

Minecraft has not a netHandler, the netHandler is inside the player.

Edited by MCenderdragon

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Posted
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?

Posted (edited)

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 by MCenderdragon

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Posted
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.

Posted
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 xD 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.