Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build-data/paper.at
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public net.minecraft.world.entity.Display$TextDisplay setText(Lnet/minecraft/net
public net.minecraft.world.entity.Display$TextDisplay setTextOpacity(B)V
public net.minecraft.world.entity.Entity DATA_TICKS_FROZEN
public net.minecraft.world.entity.Entity FLAG_INVISIBLE
public net.minecraft.world.entity.Entity getAirDrag()F
public net.minecraft.world.entity.Entity getDefaultGravity()D
public net.minecraft.world.entity.Entity getEncodeId()Ljava/lang/String;
public net.minecraft.world.entity.Entity getFireImmuneTicks()I
public net.minecraft.world.entity.Entity getSharedFlag(I)Z
Expand Down
21 changes: 21 additions & 0 deletions paper-api/src/main/java/org/bukkit/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,27 @@ final class Holder {
*/
void setGravity(boolean gravity);

/**
* Returns the default acceleration due to gravity (in blocks per tick). Ignores {@link Entity#hasGravity()}.
*
* @return the default acceleration due to gravity
*/
double getDefaultGravity();

/**
* Returns the acceleration due to gravity (in blocks per tick). If {@link Entity#hasGravity()} is true, returns 0.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Returns the acceleration due to gravity (in blocks per tick). If {@link Entity#hasGravity()} is true, returns 0.
* Returns the acceleration due to gravity (in blocks per tick). If {@link Entity#hasGravity()} is false, returns 0.

*
* @return the acceleration due to gravity
*/
double getGravity();

/**
* Returns the air drag factor applied to this entity.
*
* @return the air drag factor
*/
float getAirDrag();

/**
* Gets the period of time (in ticks) before this entity can use a portal.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,21 @@ public void setGravity(boolean gravity) {
this.getHandle().setNoGravity(!gravity);
}

@Override
public double getDefaultGravity() {
return this.getHandle().getDefaultGravity();
}

@Override
public double getGravity() {
return this.getHandle().getGravity();
}

@Override
public float getAirDrag() {
return this.getHandle().getAirDrag();
}

@Override
public int getPortalCooldown() {
return this.getHandle().getPortalCooldown();
Expand Down
Loading