禁止在非创造模式下互动载具部署器

This commit is contained in:
Light_Quanta 2025-06-07 02:28:27 +08:00
parent 4f087dc2ec
commit 1802b8889f
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -27,7 +27,6 @@ import org.jetbrains.annotations.Nullable;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
@SuppressWarnings("deprecation")
public class VehicleDeployerBlock extends BaseEntityBlock { public class VehicleDeployerBlock extends BaseEntityBlock {
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
@ -54,6 +53,8 @@ public class VehicleDeployerBlock extends BaseEntityBlock {
|| !(level.getBlockEntity(pos) instanceof VehicleDeployerBlockEntity blockEntity) || !(level.getBlockEntity(pos) instanceof VehicleDeployerBlockEntity blockEntity)
) return ItemInteractionResult.SUCCESS; ) return ItemInteractionResult.SUCCESS;
if (!player.isCreative()) return ItemInteractionResult.FAIL;
if (stack.getItem() != ModItems.CONTAINER.get()) { if (stack.getItem() != ModItems.CONTAINER.get()) {
player.displayClientMessage(Component.translatable("des.superbwarfare.vehicle_deployer.fail").withStyle(ChatFormatting.RED), true); player.displayClientMessage(Component.translatable("des.superbwarfare.vehicle_deployer.fail").withStyle(ChatFormatting.RED), true);
return ItemInteractionResult.FAIL; return ItemInteractionResult.FAIL;