fix: 错误的stopride调用

This commit is contained in:
叁玖领域 2026-03-03 00:53:59 +08:00
parent 8317afd584
commit e0487ac8ba
2 changed files with 6 additions and 4 deletions

View File

@ -26,7 +26,9 @@ import org.jetbrains.annotations.Nullable;
import top.r3944realms.eroticdungeongame.api.EroticDungeonGameApi;
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
import top.r3944realms.eroticdungeongame.content.block.ISeatBlock;
import top.r3944realms.eroticdungeongame.content.block.blockentity.BaseSeatBlockEntity;
import top.r3944realms.eroticdungeongame.content.util.FurnitureHelper;
import top.r3944realms.eroticdungeongame.util.IEDGEntity;
import top.r3944realms.lib39.core.sync.CachedSyncManager;
import java.util.HashMap;
@ -85,8 +87,8 @@ public class DungeonDataSyncManager extends CachedSyncManager<UUID, AbstractPlay
public static void logout(@NotNull Player player) {
player.getCapability(EroticDungeonGameApi.PLAYER_DUNGEON_DATA_CAP).ifPresent(
cap -> {
if (cap.getDeviceMainBlockPos() != null) {
player.stopRiding();
if (cap.getDeviceMainBlockPos() != null && player.level().getBlockEntity(cap.getDeviceMainBlockPos()) instanceof BaseSeatBlockEntity seat) {
((IEDGEntity)player).releaseEntityFromEDGDevice(seat.getLockCode());
FurnitureHelper.setSeatOccupied(player.level(), cap.getDeviceMainBlockPos(), false);
}
}

View File

@ -152,8 +152,8 @@ public class SeatService {
return seat;
}
}
} else if (deviceMainBlockPos != null) {
player.stopRiding();
} else if (deviceMainBlockPos != null && player.level().getBlockEntity(cap.getDeviceMainBlockPos()) instanceof BaseSeatBlockEntity seat) {
((IEDGEntity)player).releaseEntityFromEDGDevice(seat.getLockCode());
try {
if (bindPlayerToSeat(player, deviceMainBlockPos)) {
return player.getVehicle();