9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-20 15:39:22 +00:00

优化座椅

This commit is contained in:
XiaoMoMi
2025-11-01 23:17:49 +08:00
parent d8d1635448
commit c920fccd72
3 changed files with 3 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ public class BukkitSeat<O extends SeatOwner> implements Seat<O> {
@Override @Override
public boolean isOccupied() { public boolean isOccupied() {
Entity seatEntity = getSeatEntity(); Entity seatEntity = getSeatEntity();
return seatEntity != null && seatEntity.isValid(); return seatEntity != null && seatEntity.isValid() && !seatEntity.getPassengers().isEmpty();
} }
@Override @Override

View File

@@ -55,8 +55,7 @@ public class BukkitSeatManager implements SeatManager {
private void handleDismount(Player player, @NotNull Entity dismounted) { private void handleDismount(Player player, @NotNull Entity dismounted) {
if (!isSeatEntityType(dismounted)) return; if (!isSeatEntityType(dismounted)) return;
Location location = dismounted.getLocation(); tryLeavingSeat(player, dismounted);
this.plugin.scheduler().sync().runDelayed(() -> tryLeavingSeat(player, dismounted), player.getWorld(), location.getBlockX() >> 4, location.getBlockZ() >> 4);
} }
@Override @Override

View File

@@ -18,7 +18,7 @@ public final class LocationUtils {
} }
public static WorldPosition toWorldPosition(Location location) { public static WorldPosition toWorldPosition(Location location) {
return new WorldPosition(new BukkitWorld(location.getWorld()), location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); return new WorldPosition(new BukkitWorld(location.getWorld()), location.getX(), location.getY(), location.getZ(), location.getPitch(), location.getYaw());
} }
public static Object toVec(Vec3d vec) { public static Object toVec(Vec3d vec) {