mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed player getting stuck on slabs and stairs when in inverted gravity
This commit is contained in:
parent
1ef7e1bf73
commit
8f75122d79
3 changed files with 5 additions and 3 deletions
|
@ -74,7 +74,7 @@ public class EntityPhysics<T extends Owned<? extends Entity>> implements Physics
|
|||
return below;
|
||||
}
|
||||
} else {
|
||||
pony.getMaster().setOnGround(true);
|
||||
entity.setOnGround(true);
|
||||
}
|
||||
|
||||
return pos;
|
||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.entity.projectile.ProjectileEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public abstract class Living<T extends LivingEntity> implements Equine<T>, Caster<T> {
|
||||
|
||||
|
@ -99,6 +100,9 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
|
|||
if (getPhysics().isGravityNegative() && entity.getY() > entity.world.getHeight() + 64) {
|
||||
entity.damage(DamageSource.OUT_OF_WORLD, 4.0F);
|
||||
}
|
||||
if (getPhysics().isGravityNegative()) {
|
||||
entity.setOnGround(!entity.world.isAir(new BlockPos(entity.getX(), Math.floor(entity.getBoundingBox().maxY + 0.25), entity.getZ())));
|
||||
}
|
||||
|
||||
enchants.tick();
|
||||
}
|
||||
|
|
|
@ -111,8 +111,6 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
|
|||
isFlyingEither = isFlyingSurvival || (creative && entity.abilities.flying);
|
||||
|
||||
if (isGravityNegative()) {
|
||||
entity.setOnGround(!entity.world.isAir(new BlockPos(entity.getX(), entity.getY() + entity.getHeight() + 0.5F, entity.getZ())));
|
||||
|
||||
if (entity.isOnGround() || (!creative && entity.horizontalCollision)) {
|
||||
entity.abilities.flying = false;
|
||||
isFlyingEither = false;
|
||||
|
|
Loading…
Reference in a new issue