personthecat.catlib.exception.GenericFormattedException Maven / Gradle / Ivy
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;
}
}