guysvur.blogg.se

1.11.2 more player models
1.11.2 more player models









If I use my original method, which was changing EntityPlayer#capability.allowFlying I'm mainly worried about whether or not this is ok to do and also no idea how this will affect other mods that use this for flight.

1.11.2 more player models

I'm wondering how I should go about making sure players don't get kicked for using my mods levitation and not have to allow flight in the server properties. Then when the player turns off the levitation or runs out of mana or whatever disables their levitation I change EntityPlayer#capability.allowFlying = false and again I only do this on the server. What I was doing before I looked into SimplyJetpacks2 source was go to change EntityPlayer#capability.allowFlying = true which is how you give a player creative flight but I would only set this on the server and NOT the client, this ensured the player didn't get kicked for flying but also didn't give the player actual creative flight on the client, although it still disables fall damage but that's not a big deal. I looked into SimplyJetpacks2 source and it looks like they use reflection to access the floatingTickCount and reset it to 0. To get around this you can allow flight from the server properties, but I do believe this leaves the server vulnerable to hacked clients being able to fly around, also I don't want users to have to change this setting for my mod as other flight mods, like with jetpacks, don't require this.

1.11.2 more player models

I understand that there is a private floatingTickCount variable in NetHandlerPlayServer that will kick a player for floating for 80 ticks. I made my own form of levitation for my mod and when using it the server kicks the player for flying.











1.11.2 more player models