public class CommandSenderWrapper extends java.lang.Object implements ICommandSender
Constructor and Description |
---|
CommandSenderWrapper(ICommandSender delegateIn,
Vec3d positionVectorIn,
BlockPos positionIn,
java.lang.Integer permissionLevelIn,
Entity entityIn,
java.lang.Boolean sendCommandFeedbackIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
canUseCommand(int permLevel,
java.lang.String commandName)
Returns
true if the CommandSender is allowed to execute the command, false if not |
CommandSenderWrapper |
computePositionVector() |
static CommandSenderWrapper |
create(ICommandSender sender) |
Entity |
getCommandSenderEntity()
Returns the entity associated with the command sender.
|
ITextComponent |
getDisplayName()
Get the formatted ChatComponent that will be used for the sender's username in chat
|
World |
getEntityWorld()
Get the world, if available.
|
java.lang.String |
getName()
Get the name of this object.
|
BlockPos |
getPosition()
Get the position in the world.
|
Vec3d |
getPositionVector()
Get the position vector.
|
MinecraftServer |
getServer()
Get the Minecraft server instance
|
boolean |
sendCommandFeedback()
Returns true if the command sender should be sent feedback about executed commands
|
void |
sendMessage(ITextComponent component)
Send a chat message to the CommandSender
|
void |
setCommandStat(CommandResultStats.Type type,
int amount) |
CommandSenderWrapper |
withEntity(Entity entityIn,
Vec3d p_193997_2_) |
CommandSenderWrapper |
withPermissionLevel(int level) |
CommandSenderWrapper |
withSendCommandFeedback(boolean sendCommandFeedbackIn) |
public CommandSenderWrapper(ICommandSender delegateIn, Vec3d positionVectorIn, BlockPos positionIn, java.lang.Integer permissionLevelIn, Entity entityIn, java.lang.Boolean sendCommandFeedbackIn)
public static CommandSenderWrapper create(ICommandSender sender)
public CommandSenderWrapper withEntity(Entity entityIn, Vec3d p_193997_2_)
public CommandSenderWrapper withPermissionLevel(int level)
public CommandSenderWrapper withSendCommandFeedback(boolean sendCommandFeedbackIn)
public CommandSenderWrapper computePositionVector()
public java.lang.String getName()
getName
in interface ICommandSender
public ITextComponent getDisplayName()
getDisplayName
in interface ICommandSender
public void sendMessage(ITextComponent component)
sendMessage
in interface ICommandSender
public boolean canUseCommand(int permLevel, java.lang.String commandName)
true
if the CommandSender is allowed to execute the command, false
if notcanUseCommand
in interface ICommandSender
public BlockPos getPosition()
null
is not allowed! If you are not an entity in the world, return
the coordinates 0, 0, 0getPosition
in interface ICommandSender
public Vec3d getPositionVector()
null
is not allowed! If you are not an entity in the world, return 0.0D,
0.0D, 0.0DgetPositionVector
in interface ICommandSender
public World getEntityWorld()
null
is not allowed! If you are not an entity in the world, return
the overworldgetEntityWorld
in interface ICommandSender
public Entity getCommandSenderEntity()
getCommandSenderEntity
in interface ICommandSender
public boolean sendCommandFeedback()
sendCommandFeedback
in interface ICommandSender
public void setCommandStat(CommandResultStats.Type type, int amount)
setCommandStat
in interface ICommandSender
public MinecraftServer getServer()
getServer
in interface ICommandSender