Jump to content

Recommended Posts

Posted

Ok so I know how to get the player's pitch and yaw, but the world can't be remote (!world.isRemote). However, I want to use the players rotation to add velocity, but the player.addVelocity method won't work when the world isn't remote. How would I do this?

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

If you absolutely positively can't do it on the server, then you need packets.  Game set match.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Ok so I have my packets set up but where would I put the player.addVelocity? Would it be in the handler? And where would the player's rotation amounts be inserted? Would they be a parameter for the packet or calculated during message handling?

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted
  On 12/29/2014 at 4:32 PM, coolAlias said:

You can also change the player's motionX/Y/Z fields directly on the server, but it is usually better to handle player motion on the client.

 

Correction:

You want to do it on both.

 

If you do it client-side-only then the server will go "hey buddy, you're over here" and rubber band you back.

If you do it server-side-only the client will lag-behind and you'll rubber band the other way.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 12/29/2014 at 5:30 PM, Draco18s said:

  Quote

You can also change the player's motionX/Y/Z fields directly on the server, but it is usually better to handle player motion on the client.

 

Correction:

You want to do it on both.

 

If you do it client-side-only then the server will go "hey buddy, you're over here" and rubber band you back.

If you do it server-side-only the client will lag-behind and you'll rubber band the other way.

The rubber-band effect typically happens if you use setPosition type methods on the client, but changing motion actually works just fine. You can still get an 'illegal stance' warning if player's total motion is too high, though, whether or not you set it on the server, the client, or both.

 

Generally it is better to do things on both sides if possible, but in this case I don't think it really matters that much since the client is sending motion updates to the server anyway (see EntityClientPlayerMP#sendMotionUpdates).

Posted

Ya:

 

PacketHandler

 

  Reveal hidden contents

 

 

JetpackFlyPacket:

 

 

  Reveal hidden contents

(empty as of now)

 

KeyHandler:

 

 

  Reveal hidden contents

 

 

KeyBindings:

 

  Reveal hidden contents

 

 

Init method:

 

  Reveal hidden contents

(edited for the important parts)

 

Tell me if you need anything else

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

So what exactly is it you are wanting to do, fly? KeyInputEvent fires once when a key is pressed and once when it is released, but not at all in between, so you'll need to set some variable somewhere like 'isBoosting' then add player.motionY += 0.15D or whatever each tick if it's true. You could of course just check if the key is still pressed using the keybinding instance, but that is client side only.

Posted
  On 12/31/2014 at 12:43 PM, crackedEgg said:

You're welcome to have a look at the code for my parachute mod. I think it does something like what you want to do.

https://github.com/m1k3s/parachute

Ok so I see something is going on in method func_180426_a that might be useful. What does that method do?

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

  • 3 years later...
Posted (edited)
  On 12/31/2014 at 6:07 PM, Asweez said:

Why do they change the names?

Expand  

Most likely to make development more user friendly. I believe the original names func_xxx are a result of decompilation, and the new names are user friendly aliases for them. 

Edited by DeadPix
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I can't figure out if you're looking for help trying to steal someone elses work, or cheat at the game....
    • Title: Why Is It So Hard to Rename and Restructure Mods Like Xray or AntiXray? 🤔 Post text: Hey everyone! I’ve been digging into Minecraft modding for a while and have one big question that I can’t figure out on my own. Maybe someone with more experience could help or give me some advice. Here’s the issue: When I take a “normal” Minecraft mod — for example, one that just adds some blocks or new items — I can easily change its structure, package names, or even rebrand it entirely. It’s straightforward. But as soon as I try this with cheat-type mods like XrayMod or AntiXray, everything falls apart. Even if I just rename the classes, refactor the packages, or hide its identity somehow, the mod either breaks or stops working properly. XrayMod in particular is proving to be a nightmare to modify without losing its core function. So my question is — why is this so much harder with cheat mods like Xray? Is there something fundamentally different about how they’re coded, loaded, or protected that prevents simple renaming or restructuring? And if so, how can I actually learn to understand someone else’s cheat mod enough to safely refactor it without breaking the core features? I’ve already been spending over two months trying to figure this out and haven’t gotten anywhere. It feels like there must be some trick or knowledge I’m missing. Would really appreciate any thoughts, tips, or references — maybe there are guides or techniques for understanding cheat-mod internals? Or if you’ve successfully “disguised” a cheat mod like Xray before, I’d love to hear how you did it. Thanks in advance for any help or discussion. ✌️
    • just started making cinamatic contect check it out on my channel or check out my facebook page    Humbug City Minecraft Youtube https://www.youtube.com/watch?v=v2N6OveKwno https://www.facebook.com/profile.php?id=61575866982337  
    • Where did you get the schematic? Source/Link? And do use an own modpack or a pre-configured from curseforge? If yes, which one On a later time, I can make some tests on my own - but I need the schematic and the modpack name
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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