![JAR search and dependency download from the Maven repository](/logo.png)
cn.nukkit.blockproperty.exception.InvalidBlockPropertyValueException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.blockproperty.exception;
import cn.nukkit.blockproperty.BlockProperty;
import lombok.Getter;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNullableByDefault;
import java.io.Serializable;
@ParametersAreNullableByDefault
@Getter
public class InvalidBlockPropertyValueException extends InvalidBlockPropertyException {
private static final long serialVersionUID = -1087431932428639175L;
@Nullable
private final Serializable currentValue;
@Nullable
private final Serializable invalidValue;
public InvalidBlockPropertyValueException(@Nonnull BlockProperty> property, Serializable currentValue, Serializable invalidValue) {
super(property, buildMessage(currentValue, invalidValue));
this.currentValue = currentValue;
this.invalidValue = invalidValue;
}
public InvalidBlockPropertyValueException(@Nonnull BlockProperty> property, Serializable currentValue, Serializable invalidValue, String message) {
super(property, buildMessage(currentValue, invalidValue)+". "+message);
this.currentValue = currentValue;
this.invalidValue = invalidValue;
}
public InvalidBlockPropertyValueException(@Nonnull BlockProperty> property, Serializable currentValue, Serializable invalidValue, String message, Throwable cause) {
super(property, buildMessage(currentValue, invalidValue)+". "+message, cause);
this.currentValue = currentValue;
this.invalidValue = invalidValue;
}
public InvalidBlockPropertyValueException(@Nonnull BlockProperty> property, Serializable currentValue, Serializable invalidValue, Throwable cause) {
super(property, buildMessage(currentValue, invalidValue), cause);
this.currentValue = currentValue;
this.invalidValue = invalidValue;
}
private static String buildMessage(Object currentValue, Object invalidValue) {
return "Current Value: "+currentValue+", Invalid Value: "+invalidValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy