mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
fix: still update pose for players who had their entity type switched
(cherry picked from commit da46d07699
)
This commit is contained in:
parent
3a25d0124d
commit
f80d11d719
@ -1237,7 +1237,7 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
||||
setPose(Pose.FALL_FLYING);
|
||||
} else if (entityMeta.isSwimming()) {
|
||||
setPose(Pose.SWIMMING);
|
||||
} else if (this instanceof LivingEntity && ((LivingEntityMeta) entityMeta).isInRiptideSpinAttack()) {
|
||||
} else if (entityMeta instanceof LivingEntityMeta livingMeta && livingMeta.isInRiptideSpinAttack()) {
|
||||
setPose(Pose.SPIN_ATTACK);
|
||||
} else if (entityMeta.isSneaking()) {
|
||||
setPose(Pose.SNEAKING);
|
||||
|
@ -34,6 +34,7 @@ import net.minestom.server.coordinate.Vec;
|
||||
import net.minestom.server.effects.Effects;
|
||||
import net.minestom.server.entity.damage.DamageType;
|
||||
import net.minestom.server.entity.fakeplayer.FakePlayer;
|
||||
import net.minestom.server.entity.metadata.LivingEntityMeta;
|
||||
import net.minestom.server.entity.metadata.PlayerMeta;
|
||||
import net.minestom.server.entity.vehicle.PlayerVehicleInformation;
|
||||
import net.minestom.server.event.EventDispatcher;
|
||||
@ -819,18 +820,15 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
Pose oldPose = getPose();
|
||||
Pose newPose;
|
||||
|
||||
// If they are not a player, do nothing
|
||||
if (!getEntityType().equals(EntityType.PLAYER)) return;
|
||||
|
||||
// Figure out their expected state
|
||||
var meta = Objects.requireNonNull(getLivingEntityMeta());
|
||||
var meta = getEntityMeta();
|
||||
if (meta.isFlyingWithElytra()) {
|
||||
newPose = Pose.FALL_FLYING;
|
||||
} else if (false) { // When should they be sleeping? We don't have any in-bed state...
|
||||
newPose = Pose.SLEEPING;
|
||||
} else if (meta.isSwimming()) {
|
||||
newPose = Pose.SWIMMING;
|
||||
} else if (meta.isInRiptideSpinAttack()) {
|
||||
} else if (meta instanceof LivingEntityMeta livingMeta && livingMeta.isInRiptideSpinAttack()) {
|
||||
newPose = Pose.SPIN_ATTACK;
|
||||
} else if (isSneaking() && !isFlying()) {
|
||||
newPose = Pose.SNEAKING;
|
||||
|
Loading…
Reference in New Issue
Block a user