禁止在非创造模式下互动载具部署器
This commit is contained in:
parent
4f087dc2ec
commit
1802b8889f
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue