-
Notifications
You must be signed in to change notification settings - Fork 49
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
Are Dragons Supposed To Do This? #35
Comments
Yup, pretty sure it's a bug. |
I think I found the issue. In EntityTameableDragon, getAltitude() (line 200) returns the distance from the world surface to the dragon. If the dragon is below any blocks, than the value returned is negative. Later in the same class is a boolean (line 268) comparing getAltitude() and ALTITUDE_FLYING_THRESHOLD for deciding whether to set the dragon's state to flying. It will always return false if getAltitude is negative, therefore stopping the dragon from flying. |
Is this workable, or a permanent issue? It is just rather annoying because
I have many floating structures in the world that are constantly forcing my
dragon to fold its wings...
…On Tue, Jan 3, 2017 at 6:44 PM, Jon Lentz ***@***.***> wrote:
I think I found the issue. In EntityTameableDragon, getAltitude() (line
200) returns the distance from the world surface to the dragon. If the
dragon is below any blocks, than the value returned is negative. Later in
the same class is a boolean (line 268) comparing getAltitude() and
ALTITUDE_FLYING_THRESHOLD for deciding whether to set the dragon's state to
flying. It will always return false if getAltitude is negative, therefore
stopping the dragon from flying.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXiZ5ovysh8RltxoLqyvkbvnpsJkZpedks5rOt1PgaJpZM4LR-La>
.
|
perhaps instead of checking to see if a solid block exists above the dragon, check to see if "X-number" of air blocks exist below the dragon...(or just that there aren't any solid blocks within X-number below or above dragon)...once air blocks below dragon < 3, have dragon fold in it's wings, this can make for a more-realistic landing as well..... |
This might work. And I *maybe* could tweak the code to check for this. Is
the source code free to access?
…On Wed, Feb 8, 2017 at 12:26 AM, usafphoenix ***@***.***> wrote:
perhaps instead of checking to see if a solid block exists above the
dragon, check to see if "X-number" of air blocks exist below the
dragon...once air blocks below dragon < 3, have dragon fold in it's wings.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXiZ5jXSnlNcS1SNiOBBdHnF1zPGGjIcks5raVH7gaJpZM4LR-La>
.
|
So I added this method to EntityTameableDragon
And I changed this line in onLivingUpdate() boolean flying = canFly() && !willLand(); This eliminates the issue of dragons landing while under blocks, but it isn't very efficient at all and makes things laggy in-game. Any suggestions to fix this while still accomplishing the same thing? |
I've noticed that for some strange reason, dragons, tamed and untamed, will close their wings if they are underneath any blocks. No matter the size, shape, and distance of the formation from the dragon. They get stuck at walking speed horizontally, but go vertically just fine, although it looks kinda silly :P Is this something to do with how air currents work in real life, or is this a genuine glitch?
The text was updated successfully, but these errors were encountered: