mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-25 14:14:32 +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;
|
return below;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pony.getMaster().setOnGround(true);
|
entity.setOnGround(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.entity.projectile.ProjectileEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
public abstract class Living<T extends LivingEntity> implements Equine<T>, Caster<T> {
|
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) {
|
if (getPhysics().isGravityNegative() && entity.getY() > entity.world.getHeight() + 64) {
|
||||||
entity.damage(DamageSource.OUT_OF_WORLD, 4.0F);
|
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();
|
enchants.tick();
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,8 +111,6 @@ public class PlayerPhysics extends EntityPhysics<Pony> implements Tickable, Moti
|
||||||
isFlyingEither = isFlyingSurvival || (creative && entity.abilities.flying);
|
isFlyingEither = isFlyingSurvival || (creative && entity.abilities.flying);
|
||||||
|
|
||||||
if (isGravityNegative()) {
|
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)) {
|
if (entity.isOnGround() || (!creative && entity.horizontalCollision)) {
|
||||||
entity.abilities.flying = false;
|
entity.abilities.flying = false;
|
||||||
isFlyingEither = false;
|
isFlyingEither = false;
|
||||||
|
|
Loading…
Reference in a new issue