-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player got fall damage when reach the station #53
Comments
By edit Do you have better idea about fix it in future update? |
Hey, The current method for dismounts should normally search for the nearest solid block under the player and gently put him there, but there seems to be a problem with that. I'll try to fix it in the next version! |
@Phiwa I'm also always thinking that a possible to replace dragon to some silence mob. And... better travel (not flight) fly algorithm? The last thing is over all mob(dragon) head direction. So my idea is basically extent the plugin into a general purpose Since I only do C and C++ and C# Python PowerShell Javascript, Sorry about post these under a maybe unrelated issue. |
I'll try to answer your points one after the other.
The idea of DragonTravel as a "general purpose air traffic management plugin" already came up in the past, but due to the issues listed above, we sadly never got there... |
@Phiwa The I'll take it. First thing first is a decent IDE and other Minecraft related development environment. I have zero knowledge about Java and Minecraft development. In order to "Actually start working on this". |
Sounds good, feel free to dive into DragonTravel! Some tips:
|
@Phiwa I've ready the JDK and Maven and VSCode environment, Since I have submitted a issue about "player falling damage bug", For example, the temporary workaround solution is manually lower height to (-5),
After that there were only very few situation the player would get falling damage. If that was true, I need to know where to modify or insert this fix. So if you have a better idea I'll try turn them from human language to code as my first step in minecraft dev world. |
@Phiwa I got an idea that to calculate forward direction for the dragon that use x, y , x+5, y+5 to calculate a 360 degrees, let the dragon face to the player face direction by first, then track new position to old position angle in realtime and update dragon face angle IF THAT WAS POSSIBLE. |
I calculate a safe dismount location in method getSafeLandingLoc(Location loc) in class DragonManager. About the direction the dragon is facing: |
A hint to myself: |
Currently, dismount location relates to player's position on the mob, searching downwards for the next solid block. This means, as long as the player is not riding a mob "in the ground", he should always be over the surface and therefore the next position should be the surface. |
@Phiwa I'm sorry for "it's looks like someone is spamming a repository" |
@Phiwa I see the code, though I didn't have learn Java yet It doesn't have any logical error at all. This can understand, when he is riding something, A game achievement "When Pig Fly" can use this to kill a pig. |
Even though I do not completemy understand what you mean with your last paragraph: The dismount location is calculated from the player's location after "dismounting" him (and then searching for a block below him). |
The latest situation:
In config, a station height is 71, and by the code |
Referring to this |
The latest situation:
None of them can change the value as I thought. |
Referring to this:
This is so Java. |
The situation:
This will work. And,
Not gonna to work. |
Well actually... the subtract did work. But,
I never think I should check the initial |
@Phiwa I was failed to fix this after 4 hours. Second is execute a A setVelocity(new Ventor(0, 0, 0)) before teleport also doesn't prevent fall damage. The last thing I searched is "cancel the falling damage event", |
Here is the latest status: |
Yet, adjust the value saved in station database config file directly is worked. From my understand the "dismount process" doesn't contains any related code. |
I just took a look at your PR and I'm sorry, but I do not think the workaround is the correct way to solve the problem. |
Let's keep this issue open and keep seeking for a proper solution to the problem. |
@Phiwa I later ask for help in spigot community. They should have a api to recover a falling player... |
@Phiwa I have got some advice about available API.
So now the question is, we know a tradition program is single thread, I do can listen to an event and cancel the damage for the one triggered it, The idea is I can set an event to listen just before dismount instead of all the flying stage, Result in: A boolean variable record currently event listen is registered or not.
An array of player property to record currently traveling status.
A method to dynamic register or cancel the event.
This is my current thinking and might keep search in the next few days. |
Got one: How to unregister events |
Got one: Fire a no wait method call |
@ZizzyZizzy I did this at the very beginning but it wasn't have the effect that it should. |
Very odd that noDamageTicks won't work inside the NMS java classes. I tried and had the same result. NMS is wonky. Anyway, I did find that it works perfectly in DragonManager.java:
Can't justify forking and putting in a PR for a one-liner. I just tested it and it works fine on 1.15.2. |
Thank you! Finally, we got a solution and it' so simply... :) |
Glad to help! |
Did one last test before release and figured out, players still receive damage, but only when dismounting after the first ride. Further rides do not lead to any damage. |
Phiwa/DragonTravel#53 Turn on this for a hack that lower station Y axis a little bit to avoid dismount damage
Phiwa/DragonTravel#53 Turn on this for a hack that lower station Y axis a little bit to avoid dismount damage
Phiwa/DragonTravel#53 Turn on this for a hack that lower station Y axis a little bit to avoid dismount damage
Phiwa/DragonTravel#53 Turn on this for a hack that lower station Y axis a little bit to avoid dismount damage
The dragon won't dismount player at correct height,
it dismount player at about 3 block height to the ground.
Result in everyone got falling damage.
And if I replace station block as water,
the dragon seems dismount player to neatest block
around the water instead dismount player into the water.
Add slime block also have the affect like water.
Maybe I should place more water there?
By checking positions it shows... When I stand in a center of a block,
the xyz is x 0.5, y 64, z 0.5, instead of 0 64 0.
This is really strange.
Do a
/dt showstations
printed my station at 0 64 0,this may be the question is.
Spigot MC server 1.12.2
DragonTravel v01.007.02
The text was updated successfully, but these errors were encountered: