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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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