From 30e08401bdde4b11e90da85e8f6b5c9f91013f3d Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 4 Apr 2021 14:48:18 +0200 Subject: [PATCH] Added modifiable Gravity to EntityLiving diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java index 97591280..22289f90 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -222,6 +222,9 @@ public abstract class EntityLiving extends Entity { private float bB; private float bC; protected BehaviorController bg; + + private double gravity = 0.08D; // Spigot + // CraftBukkit start public int expToDrop; public int maxAirTicks = 300; @@ -243,6 +246,12 @@ public abstract class EntityLiving extends Entity { super.inactiveTick(); ++this.ticksFarFromPlayer; // Above all the floats } + public double getGravity() { + return this.gravity; + } + public void setGravity(double d) { + this.gravity = d; + } // Spigot end protected EntityLiving(EntityTypes entitytypes, World world) { @@ -2226,7 +2235,7 @@ public abstract class EntityLiving extends Entity { public void g(Vec3D vec3d) { if (this.doAITick() || this.cs()) { - double d0 = 0.08D; + double d0 = getGravity(); boolean flag = this.getMot().y <= 0.0D; if (flag && this.hasEffect(MobEffects.SLOW_FALLING)) { -- 2.31.1.windows.1