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

Respect Entity#setGravity(false). Closes GH-454 #469

wants to merge 1 commit into
base: master


None yet
2 participants

satoshinm commented May 2, 2017

Adds support for calling setGravity(false) to disable gravity physics on an entity. This is useful for plugins to make their own entities which don't respect gravity:

screen shot 2017-05-01 at 9 59 22 pm

Implemented by adding a getGravityAccel() accessor to complement setGravityAccel() (and getVelocity()), which returns a zero vector if !this.gravity.

@Ultros-Bot Ultros-Bot requested a review from momothereal May 2, 2017

@@ -716,6 +724,7 @@ public boolean intersects(BoundingBox box) {
* Gravity acceleration applied each tick.
protected Vector gravityAccel = new Vector(0, -0.04, 0);
private static final Vector zeroG = new Vector(0, 0, 0);

This comment has been minimized.


mastercoms May 2, 2017


This can be new Vector(), FYI.

@momothereal momothereal removed their request for review May 2, 2017


This comment has been minimized.


mastercoms commented May 2, 2017

Merged in 447c945.

@mastercoms mastercoms closed this May 2, 2017

@mastercoms mastercoms self-assigned this May 2, 2017

@satoshinm satoshinm deleted the satoshinm:setgravity branch May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment