mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-20 15:39:22 +00:00
优化座椅
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user