9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-04 15:41:38 +00:00

fix(block): 补一下挥手

This commit is contained in:
jhqwqmc
2025-09-12 13:41:00 +08:00
parent f724faaf86
commit c70b765a32

View File

@@ -36,12 +36,13 @@ public class SeatBlockBehavior extends BukkitBlockBehavior implements EntityBloc
@Override
public InteractionResult useWithoutItem(UseOnContext context, ImmutableBlockState state) {
BukkitServerPlayer player = (BukkitServerPlayer) context.getPlayer();
if (player == null || player.isSecondaryUseActive() || player.platformPlayer() == null) {
if (player == null || player.isSecondaryUseActive()) {
return InteractionResult.PASS;
}
CEWorld world = context.getLevel().storageWorld();
BlockEntity blockEntity = world.getBlockEntityAtIfLoaded(context.getClickedPos());
if (!(blockEntity instanceof SeatBlockEntity seatBlockEntity) || !seatBlockEntity.seatEntities().isEmpty()) {
player.swingHand(context.getHand());
return InteractionResult.PASS;
}
seatBlockEntity.spawnSeatEntityForPlayer(player.platformPlayer(), this.offset, this.yaw, this.limitPlayerRotation);