| 1 | package net.minecraft.command;
|
| 2 |
|
| 3 | import net.minecraft.entity.Entity;
|
| 4 | import net.minecraft.util.BlockPos;
|
| 5 | import net.minecraft.util.IChatComponent;
|
| 6 | import net.minecraft.util.Vec3;
|
| 7 | import net.minecraft.world.World;
|
| 8 |
|
| 9 | public interface ICommandSender
|
| 10 | {
|
| 11 | /**
|
| 12 | * Get the name of this object. For players this returns their username
|
| 13 | */
|
| 14 | String getName();
|
| 15 |
|
| 16 | /**
|
| 17 | * Get the formatted ChatComponent that will be used for the sender's username in chat
|
| 18 | */
|
| 19 | IChatComponent getDisplayName();
|
| 20 |
|
| 21 | /**
|
| 22 | * Send a chat message to the CommandSender
|
| 23 | */
|
| 24 | void addChatMessage(IChatComponent component);
|
| 25 |
|
| 26 | /**
|
| 27 | * Returns {@code true} if the CommandSender is allowed to execute the command, {@code false} if not
|
| 28 | */
|
| 29 | boolean canCommandSenderUseCommand(int permLevel, String commandName);
|
| 30 |
|
| 31 | /**
|
| 32 | * Get the position in the world. <b>{@code null} is not allowed!</b> If you are not an entity in the world, return
|
| 33 | * the coordinates 0, 0, 0
|
| 34 | */
|
| 35 | BlockPos getPosition();
|
| 36 |
|
| 37 | /**
|
| 38 | * Get the position vector. <b>{@code null} is not allowed!</b> If you are not an entity in the world, return 0.0D,
|
| 39 | * 0.0D, 0.0D
|
| 40 | */
|
| 41 | Vec3 getPositionVector();
|
| 42 |
|
| 43 | /**
|
| 44 | * Get the world, if available. <b>{@code null} is not allowed!</b> If you are not an entity in the world, return
|
| 45 | * the overworld
|
| 46 | */
|
| 47 | World getEntityWorld();
|
| 48 |
|
| 49 | /**
|
| 50 | * Returns the entity associated with the command sender. MAY BE NULL!
|
| 51 | */
|
| 52 | Entity getCommandSenderEntity();
|
| 53 |
|
| 54 | /**
|
| 55 | * Returns true if the command sender should be sent feedback about executed commands
|
| 56 | */
|
| 57 | boolean sendCommandFeedback();
|
| 58 |
|
| 59 | void setCommandStat(CommandResultStats.Type type, int amount);
|
| 60 | }
|
| 61 |
|