Package net.minecraft.commands
Class CommandSourceStack
java.lang.Object
net.minecraft.commands.CommandSourceStack
- All Implemented Interfaces:
ExecutionCommandSource<CommandSourceStack>,SharedSuggestionProvider,PermissionSetSupplier,ICommandSourceStackExtension
- Direct Known Subclasses:
ClientCommandSourceStack
public class CommandSourceStack
extends Object
implements ExecutionCommandSource<CommandSourceStack>, SharedSuggestionProvider, ICommandSourceStackExtension
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.commands.SharedSuggestionProvider
SharedSuggestionProvider.ElementSuggestionType, SharedSuggestionProvider.TextCoordinates -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EntityAnchorArgument.Anchorprivate final TaskChainerprivate final Componentprivate final @Nullable Entitystatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate final ServerLevelprivate final PermissionSetprivate final CommandResultCallbackprivate final Vec2private final MinecraftServerprivate final CommandSigningContextprivate final booleanfinal CommandSourceprivate final Stringprivate final Vec3Fields inherited from interface net.minecraft.commands.SharedSuggestionProvider
MATCH_SPLITTER -
Constructor Summary
ConstructorsModifierConstructorDescriptionCommandSourceStack(CommandSource source, Vec3 worldPosition, Vec2 rotation, ServerLevel level, PermissionSet permissionLevel, String textName, Component displayName, MinecraftServer server, @Nullable Entity entity) privateCommandSourceStack(CommandSource source, Vec3 worldPosition, Vec2 rotation, ServerLevel level, PermissionSet permissions, String textName, Component displayName, MinecraftServer server, @Nullable Entity entity, boolean silent, CommandResultCallback resultCallback, EntityAnchorArgument.Anchor anchor, CommandSigningContext signingContext, TaskChainer chatMessageChainer) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbroadcastToAdmins(Component message) callback()CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> customSuggestion(com.mojang.brigadier.context.CommandContext<?> p_212324_) com.mojang.brigadier.CommandDispatcher<CommandSourceStack> facing(Entity entity, EntityAnchorArgument.Anchor anchor) @Nullable EntitygetLevel()private Optional<? extends HolderLookup<?>> getLookup(ResourceKey<? extends Registry<?>> registryKey) @Nullable ServerPlayervoidhandleError(com.mojang.brigadier.exceptions.CommandExceptionType p_307548_, com.mojang.brigadier.Message p_307613_, boolean p_307560_, @Nullable TraceCallbacks p_307654_) booleanisPlayer()booleanisSilent()levels()voidsendChatMessage(OutgoingChatMessage message, boolean shouldFilter, ChatType.Bound boundChatType) voidsendFailure(Component message) voidsendSuccess(Supplier<Component> messageSupplier, boolean allowLogging) voidsendSystemMessage(Component message) booleanshouldFilterMessageTo(ServerPlayer receiver) CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestRegistryElements(ResourceKey<? extends Registry<?>> p_212330_, SharedSuggestionProvider.ElementSuggestionType p_212331_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_212332_, com.mojang.brigadier.context.CommandContext<?> p_212333_) withCallback(CommandResultCallback p_309591_) withCallback(CommandResultCallback callback, BinaryOperator<CommandResultCallback> operator) withEntity(Entity entity) withLevel(ServerLevel level) withMaximumPermission(PermissionSet permissions) withPermission(PermissionSet permissions) withPosition(Vec3 pos) withRotation(Vec2 rotation) withSigningContext(CommandSigningContext signingContext, TaskChainer chatMessageChainer) withSource(CommandSource source) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.commands.ExecutionCommandSource
clearCallbacks, handleErrorMethods inherited from interface net.neoforged.neoforge.common.extensions.ICommandSourceStackExtension
getAdvancement, getScoreboard, getUnsidedLevelMethods inherited from interface net.minecraft.commands.SharedSuggestionProvider
getAbsoluteCoordinates, getCustomTabSugggestions, getRelevantCoordinates, getSelectedEntities, suggestRegistryElements
-
Field Details
-
ERROR_NOT_PLAYER
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_PLAYER -
ERROR_NOT_ENTITY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_ENTITY -
source
-
worldPosition
-
level
-
permissions
-
textName
-
displayName
-
server
-
silent
private final boolean silent -
entity
-
resultCallback
-
anchor
-
rotation
-
signingContext
-
chatMessageChainer
-
-
Constructor Details
-
CommandSourceStack
public CommandSourceStack(CommandSource source, Vec3 worldPosition, Vec2 rotation, ServerLevel level, PermissionSet permissionLevel, String textName, Component displayName, MinecraftServer server, @Nullable Entity entity) -
CommandSourceStack
private CommandSourceStack(CommandSource source, Vec3 worldPosition, Vec2 rotation, ServerLevel level, PermissionSet permissions, String textName, Component displayName, MinecraftServer server, @Nullable Entity entity, boolean silent, CommandResultCallback resultCallback, EntityAnchorArgument.Anchor anchor, CommandSigningContext signingContext, TaskChainer chatMessageChainer)
-
-
Method Details
-
withSource
-
withEntity
-
withPosition
-
withRotation
-
withCallback
- Specified by:
withCallbackin interfaceExecutionCommandSource<CommandSourceStack>
-
withCallback
public CommandSourceStack withCallback(CommandResultCallback callback, BinaryOperator<CommandResultCallback> operator) -
withSuppressedOutput
-
withPermission
-
withMaximumPermission
-
withAnchor
-
withLevel
-
facing
-
facing
-
withSigningContext
public CommandSourceStack withSigningContext(CommandSigningContext signingContext, TaskChainer chatMessageChainer) -
getDisplayName
-
getTextName
-
permissions
- Specified by:
permissionsin interfacePermissionSetSupplier
-
getPosition
-
getLevel
-
getEntity
-
getEntityOrException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getPlayerOrException
public ServerPlayer getPlayerOrException() throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getPlayer
-
isPlayer
public boolean isPlayer() -
getRotation
-
getServer
-
getAnchor
-
getSigningContext
-
getChatMessageChainer
-
shouldFilterMessageTo
-
sendChatMessage
public void sendChatMessage(OutgoingChatMessage message, boolean shouldFilter, ChatType.Bound boundChatType) -
sendSystemMessage
-
sendSuccess
-
broadcastToAdmins
-
sendFailure
-
callback
- Specified by:
callbackin interfaceExecutionCommandSource<CommandSourceStack>
-
getOnlinePlayerNames
- Specified by:
getOnlinePlayerNamesin interfaceSharedSuggestionProvider
-
getAllTeams
- Specified by:
getAllTeamsin interfaceSharedSuggestionProvider
-
getAvailableSounds
- Specified by:
getAvailableSoundsin interfaceSharedSuggestionProvider
-
customSuggestion
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> customSuggestion(com.mojang.brigadier.context.CommandContext<?> p_212324_) - Specified by:
customSuggestionin interfaceSharedSuggestionProvider
-
getLookup
private Optional<? extends HolderLookup<?>> getLookup(ResourceKey<? extends Registry<?>> registryKey) -
levels
- Specified by:
levelsin interfaceSharedSuggestionProvider
-
registryAccess
- Specified by:
registryAccessin interfaceSharedSuggestionProvider
-
enabledFeatures
- Specified by:
enabledFeaturesin interfaceSharedSuggestionProvider
-
dispatcher
- Specified by:
dispatcherin interfaceExecutionCommandSource<CommandSourceStack>
-
handleError
public void handleError(com.mojang.brigadier.exceptions.CommandExceptionType p_307548_, com.mojang.brigadier.Message p_307613_, boolean p_307560_, @Nullable TraceCallbacks p_307654_) - Specified by:
handleErrorin interfaceExecutionCommandSource<CommandSourceStack>
-
isSilent
public boolean isSilent()- Specified by:
isSilentin interfaceExecutionCommandSource<CommandSourceStack>
-