Repository: PaperMC/Paper
File: paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftVault.java (Java)

Code before:
        super(world, tileEntity);
    }

    protected CraftVault(CraftVault state, @Nullable Location location) {
        super(state, location);
    }

    @Override
    public CraftVault copy() {
        return new CraftVault(this, null);
    }

    @Override
    public CraftVault copy(Location location) {
        return new CraftVault(this, location);
    }

    @Override
    public double getActivationRange() {
        return this.getSnapshot().getConfig().activationRange();
    }

    @Override
    public void setActivationRange(final double activationRange) {
        Preconditions.checkArgument(Double.isFinite(activationRange), "deactivation range must not be NaN or infinite");
        Preconditions.checkArgument(activationRange <= getDeactivationRange(), "New activation range (%f) must be less or equal to deactivation range (%f)".formatted(activationRange, getDeactivationRange()));

        final VaultConfig config = this.getSnapshot().getConfig();
        this.getSnapshot().setConfig(new VaultConfig(config.lootTable(), activationRange, config.deactivationRange(), config.keyItem(), config.overrideLootTableToDisplay()));
    }

    @Override
    public double getDeactivationRange() {
        return this.getSnapshot().getConfig().deactivationRange();
    }

    @Override
    public void setDeactivationRange(final double deactivationRange) {
        Preconditions.checkArgument(Double.isFinite(deactivationRange), "deactivation range must not be NaN or infinite");
        Preconditions.checkArgument(deactivationRange >= getActivationRange(), "New deactivation range (%f) must be more or equal to activation range (%f)".formatted(deactivationRange, getActivationRange()));

        final VaultConfig config = this.getSnapshot().getConfig();
        this.getSnapshot().setConfig(new VaultConfig(config.lootTable(), config.activationRange(), deactivationRange, config.keyItem(), config.overrideLootTableToDisplay()));
    }

    @Override
    public ItemStack getKeyItem() {
        return this.getSnapshot().getConfig().keyItem().asBukkitCopy();
    }

    @Override

Review comment (suggestion):
```suggestion
        Preconditions.checkArgument(activationRange <= this.getDeactivationRange(), "New activation range (%s) must be less or equal to deactivation range (%s)", activationRange, this.getDeactivationRange());
```
Not sure if change but Preconditions support format then not sure why need use the String format.

Code after:
    public CraftVault(World world, VaultBlockEntity tileEntity) {
        super(world, tileEntity);
    }

    protected CraftVault(CraftVault state, @Nullable Location location) {
        super(state, location);
    }

    @Override
    public CraftVault copy() {
        return new CraftVault(this, null);
    }

    @Override
    public CraftVault copy(Location location) {
        return new CraftVault(this, location);
    }

    @Override
    public double getActivationRange() {
        return this.getSnapshot().getConfig().activationRange();
    }

    @Override
    public void setActivationRange(final double activationRange) {
        Preconditions.checkArgument(Double.isFinite(activationRange), "activation range must not be NaN or infinite");
        Preconditions.checkArgument(activationRange <= this.getDeactivationRange(), "New activation range (%s) must be less or equal to deactivation range (%s)", activationRange, this.getDeactivationRange());

        final VaultConfig config = this.getSnapshot().getConfig();
        this.getSnapshot().setConfig(new VaultConfig(config.lootTable(), activationRange, config.deactivationRange(), config.keyItem(), config.overrideLootTableToDisplay()));
    }

    @Override
    public double getDeactivationRange() {
        return this.getSnapshot().getConfig().deactivationRange();
    }

    @Override
    public void setDeactivationRange(final double deactivationRange) {
        Preconditions.checkArgument(Double.isFinite(deactivationRange), "deactivation range must not be NaN or infinite");
        Preconditions.checkArgument(deactivationRange >= this.getActivationRange(), "New deactivation range (%s) must be more or equal to activation range (%s)", deactivationRange, this.getActivationRange());

        final VaultConfig config = this.getSnapshot().getConfig();
        this.getSnapshot().setConfig(new VaultConfig(config.lootTable(), config.activationRange(), deactivationRange, config.keyItem(), config.overrideLootTableToDisplay()));
    }

    @Override
    public ItemStack getKeyItem() {
        return this.getSnapshot().getConfig().keyItem().asBukkitCopy();
    }