public class CommandSource extends java.lang.Object implements ISuggestionProvider
ISuggestionProvider.Coordinates
Modifier and Type | Field and Description |
---|---|
private ITextComponent |
displayName |
private Entity |
entity |
private EntityAnchorArgument.Type |
entityAnchorType |
private boolean |
feedbackDisabled |
private java.lang.String |
name |
private int |
permissionLevel |
private Vec3d |
pos |
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType |
REQUIRES_ENTITY_EXCEPTION_TYPE |
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType |
REQUIRES_PLAYER_EXCEPTION_TYPE |
private com.mojang.brigadier.ResultConsumer<CommandSource> |
resultConsumer |
private Vec2f |
rotation |
private MinecraftServer |
server |
private ICommandSource |
source |
private ServerWorld |
world |
Modifier | Constructor and Description |
---|---|
|
CommandSource(ICommandSource sourceIn,
Vec3d posIn,
Vec2f rotationIn,
ServerWorld worldIn,
int permissionLevelIn,
java.lang.String nameIn,
ITextComponent displayNameIn,
MinecraftServer serverIn,
Entity entityIn) |
protected |
CommandSource(ICommandSource sourceIn,
Vec3d posIn,
Vec2f rotationIn,
ServerWorld worldIn,
int permissionLevelIn,
java.lang.String nameIn,
ITextComponent displayNameIn,
MinecraftServer serverIn,
Entity entityIn,
boolean feedbackDisabledIn,
com.mojang.brigadier.ResultConsumer<CommandSource> resultConsumerIn,
EntityAnchorArgument.Type entityAnchorTypeIn) |
Modifier and Type | Method and Description |
---|---|
ServerPlayerEntity |
asPlayer() |
Entity |
assertIsEntity() |
ITextComponent |
getDisplayName() |
Entity |
getEntity() |
EntityAnchorArgument.Type |
getEntityAnchorType() |
java.lang.String |
getName() |
java.util.Collection<java.lang.String> |
getPlayerNames() |
Vec3d |
getPos() |
java.util.stream.Stream<ResourceLocation> |
getRecipeResourceLocations() |
Vec2f |
getRotation() |
MinecraftServer |
getServer() |
java.util.Collection<ResourceLocation> |
getSoundResourceLocations() |
java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> |
getSuggestionsFromServer(com.mojang.brigadier.context.CommandContext<ISuggestionProvider> context,
com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder) |
java.util.Collection<java.lang.String> |
getTeamNames() |
ServerWorld |
getWorld() |
boolean |
hasPermissionLevel(int level) |
private void |
logFeedback(ITextComponent message) |
void |
onCommandComplete(com.mojang.brigadier.context.CommandContext<CommandSource> context,
boolean success,
int result) |
void |
sendErrorMessage(ITextComponent message) |
void |
sendFeedback(ITextComponent message,
boolean allowLogging) |
CommandSource |
withEntity(Entity entityIn) |
CommandSource |
withEntityAnchorType(EntityAnchorArgument.Type entityAnchorTypeIn) |
CommandSource |
withFeedbackDisabled() |
CommandSource |
withMinPermissionLevel(int level) |
CommandSource |
withPermissionLevel(int level) |
CommandSource |
withPos(Vec3d posIn) |
CommandSource |
withResultConsumer(com.mojang.brigadier.ResultConsumer<CommandSource> resultConsumerIn) |
CommandSource |
withResultConsumer(com.mojang.brigadier.ResultConsumer<CommandSource> resultConsumerIn,
java.util.function.BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSource>> resultConsumerSelector) |
CommandSource |
withRotation(Entity entityIn,
EntityAnchorArgument.Type anchorType) |
CommandSource |
withRotation(Vec2f pitchYawIn) |
CommandSource |
withRotation(Vec3d lookPos) |
CommandSource |
withWorld(ServerWorld worldIn) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
func_201725_a, func_209000_a, func_210511_a, func_210512_a, func_210514_a, func_211269_a, func_212476_a, func_217293_r, func_217294_q, getTargetedEntity, suggest, suggest, suggest, suggestIterable, suggestIterable
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType REQUIRES_PLAYER_EXCEPTION_TYPE
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType REQUIRES_ENTITY_EXCEPTION_TYPE
private final ICommandSource source
private final Vec3d pos
private final ServerWorld world
private final int permissionLevel
private final java.lang.String name
private final ITextComponent displayName
private final MinecraftServer server
private final boolean feedbackDisabled
@Nullable private final Entity entity
private final com.mojang.brigadier.ResultConsumer<CommandSource> resultConsumer
private final EntityAnchorArgument.Type entityAnchorType
private final Vec2f rotation
public CommandSource(ICommandSource sourceIn, Vec3d posIn, Vec2f rotationIn, ServerWorld worldIn, int permissionLevelIn, java.lang.String nameIn, ITextComponent displayNameIn, MinecraftServer serverIn, @Nullable Entity entityIn)
protected CommandSource(ICommandSource sourceIn, Vec3d posIn, Vec2f rotationIn, ServerWorld worldIn, int permissionLevelIn, java.lang.String nameIn, ITextComponent displayNameIn, MinecraftServer serverIn, @Nullable Entity entityIn, boolean feedbackDisabledIn, com.mojang.brigadier.ResultConsumer<CommandSource> resultConsumerIn, EntityAnchorArgument.Type entityAnchorTypeIn)
public CommandSource withEntity(Entity entityIn)
public CommandSource withPos(Vec3d posIn)
public CommandSource withRotation(Vec2f pitchYawIn)
public CommandSource withResultConsumer(com.mojang.brigadier.ResultConsumer<CommandSource> resultConsumerIn)
public CommandSource withResultConsumer(com.mojang.brigadier.ResultConsumer<CommandSource> resultConsumerIn, java.util.function.BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSource>> resultConsumerSelector)
public CommandSource withFeedbackDisabled()
public CommandSource withPermissionLevel(int level)
public CommandSource withMinPermissionLevel(int level)
public CommandSource withEntityAnchorType(EntityAnchorArgument.Type entityAnchorTypeIn)
public CommandSource withWorld(ServerWorld worldIn)
public CommandSource withRotation(Entity entityIn, EntityAnchorArgument.Type anchorType) throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public CommandSource withRotation(Vec3d lookPos) throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public ITextComponent getDisplayName()
public java.lang.String getName()
public boolean hasPermissionLevel(int level)
hasPermissionLevel
in interface ISuggestionProvider
public Vec3d getPos()
public ServerWorld getWorld()
@Nullable public Entity getEntity()
public Entity assertIsEntity() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public ServerPlayerEntity asPlayer() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public Vec2f getRotation()
public MinecraftServer getServer()
public EntityAnchorArgument.Type getEntityAnchorType()
public void sendFeedback(ITextComponent message, boolean allowLogging)
private void logFeedback(ITextComponent message)
public void sendErrorMessage(ITextComponent message)
public void onCommandComplete(com.mojang.brigadier.context.CommandContext<CommandSource> context, boolean success, int result)
public java.util.Collection<java.lang.String> getPlayerNames()
getPlayerNames
in interface ISuggestionProvider
public java.util.Collection<java.lang.String> getTeamNames()
getTeamNames
in interface ISuggestionProvider
public java.util.Collection<ResourceLocation> getSoundResourceLocations()
getSoundResourceLocations
in interface ISuggestionProvider
public java.util.stream.Stream<ResourceLocation> getRecipeResourceLocations()
getRecipeResourceLocations
in interface ISuggestionProvider
public java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> getSuggestionsFromServer(com.mojang.brigadier.context.CommandContext<ISuggestionProvider> context, com.mojang.brigadier.suggestion.SuggestionsBuilder suggestionsBuilder)
getSuggestionsFromServer
in interface ISuggestionProvider