All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.blockproperty.exception.BlockPropertyNotFoundException Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.blockproperty.exception;

import cn.nukkit.api.PowerNukkitOnly;
import cn.nukkit.api.Since;
import cn.nukkit.blockproperty.BlockProperties;

import java.util.NoSuchElementException;

@PowerNukkitOnly
@Since("1.5.0.0-PN")
public class BlockPropertyNotFoundException extends NoSuchElementException {
    private final String propertyName;

    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public BlockPropertyNotFoundException(String propertyName) {
        super("The property \""+propertyName+"\" was not found.");
        this.propertyName = propertyName;
    }

    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public BlockPropertyNotFoundException(String propertyName, String details) {
        super(propertyName+": " + details);
        this.propertyName = propertyName;
    }

    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public BlockPropertyNotFoundException(String propertyName, BlockProperties properties) {
        super("The property \""+propertyName+"\" was not found. Valid properties: " + properties.getNames());
        this.propertyName = propertyName;
    }

    @PowerNukkitOnly
    @Since("1.5.0.0-PN")
    public String getPropertyName() {
        return propertyName;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy