Package dev.jorel.commandapi.exceptions
Class WrapperCommandSyntaxException
java.lang.Object
java.lang.Throwable
java.lang.Exception
dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException
- All Implemented Interfaces:
Serializable
A wrapper for the CommandSyntaxException so other developers don't have to
import Mojang's brigadier
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWrapperCommandSyntaxException(com.mojang.brigadier.exceptions.CommandSyntaxException exception) Creates a WrapperCommandSyntaxException -
Method Summary
Modifier and TypeMethodDescriptiongetCause()Returns some contextual information about where the error occurred.intReturns the cursor position.com.mojang.brigadier.exceptions.CommandSyntaxExceptionReturns the wrapped CommandSyntaxExceptiongetInput()Returns the input that caused the CommandSyntaxException.Returns the message together with the position it occurred on and some context.com.mojang.brigadier.MessageReturns the raw message, not including positional informationcom.mojang.brigadier.exceptions.CommandExceptionTypegetType()Returns the type of the exception.voidvoidvoidvoidsetStackTrace(StackTraceElement[] stackTrace) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getSuppressed, toString
-
Constructor Details
-
WrapperCommandSyntaxException
public WrapperCommandSyntaxException(com.mojang.brigadier.exceptions.CommandSyntaxException exception) Creates a WrapperCommandSyntaxException- Parameters:
exception- the exception to wrap
-
-
Method Details
-
getException
public com.mojang.brigadier.exceptions.CommandSyntaxException getException()Returns the wrapped CommandSyntaxException- Returns:
- the wrapped CommandSyntaxException
-
getMessage
Returns the message together with the position it occurred on and some context.- Overrides:
getMessagein classThrowable- Returns:
- the message together with the position it occurred on and some context
-
getCause
-
getStackTrace
- Overrides:
getStackTracein classThrowable
-
initCause
-
getLocalizedMessage
- Overrides:
getLocalizedMessagein classThrowable
-
printStackTrace
public void printStackTrace()- Overrides:
printStackTracein classThrowable
-
printStackTrace
- Overrides:
printStackTracein classThrowable
-
printStackTrace
- Overrides:
printStackTracein classThrowable
-
setStackTrace
- Overrides:
setStackTracein classThrowable
-
getRawMessage
public com.mojang.brigadier.Message getRawMessage()Returns the raw message, not including positional information- Returns:
- the raw message without any formatting or positional information
-
getContext
Returns some contextual information about where the error occurred.This is done by returning a few characters (10) of the faulty
getInput()and a pointer to where the exception happened.- Returns:
- some contextual information about where the error occurred or null if
getInput()orgetCursor()are null/0.
-
getType
public com.mojang.brigadier.exceptions.CommandExceptionType getType()Returns the type of the exception.- Returns:
- the type of the exception
-
getInput
Returns the input that caused the CommandSyntaxException.- Returns:
- the input that caused the CommandSyntaxException or null if not set
-
getCursor
public int getCursor()Returns the cursor position.- Returns:
- the cursor position or -1 if not set
-