personthecat.catlib.exception.GenericFormattedException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of catlib-quilt Show documentation
Show all versions of catlib-quilt Show documentation
Utilities for serialization, commands, noise generation, IO, and some new data types.
The newest version!
package personthecat.catlib.exception;
import net.minecraft.class_2561;
import net.minecraft.class_2585;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class GenericFormattedException extends FormattedException {
private final class_2561 tooltip;
public GenericFormattedException(final Throwable cause) {
super(cause);
this.tooltip = null;
}
public GenericFormattedException(final Throwable cause, final String tooltip) {
super(cause);
this.tooltip = new class_2585(tooltip);
}
@Override
public @NotNull class_2561 getDisplayMessage() {
return new class_2585(createMsg(this.getCause()));
}
@Override
public @Nullable class_2561 getTooltip() {
return this.tooltip;
}
}