mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
优化座椅
This commit is contained in:
@@ -50,7 +50,7 @@ public class BukkitSeat<O extends SeatOwner> implements Seat<O> {
|
||||
@Override
|
||||
public boolean isOccupied() {
|
||||
Entity seatEntity = getSeatEntity();
|
||||
return seatEntity != null && seatEntity.isValid();
|
||||
return seatEntity != null && seatEntity.isValid() && !seatEntity.getPassengers().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,8 +55,7 @@ public class BukkitSeatManager implements SeatManager {
|
||||
|
||||
private void handleDismount(Player player, @NotNull Entity dismounted) {
|
||||
if (!isSeatEntityType(dismounted)) return;
|
||||
Location location = dismounted.getLocation();
|
||||
this.plugin.scheduler().sync().runDelayed(() -> tryLeavingSeat(player, dismounted), player.getWorld(), location.getBlockX() >> 4, location.getBlockZ() >> 4);
|
||||
tryLeavingSeat(player, dismounted);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,7 @@ public final class LocationUtils {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user