Comments cleanup

This commit is contained in:
themode 2020-10-06 21:03:00 +02:00
parent d03354fe24
commit f811f1efef
3 changed files with 14 additions and 11 deletions

View File

@ -3,21 +3,21 @@ package net.minestom.server.command;
import net.minestom.server.entity.Player;
/**
* Represent a simple command which give you the whole string representation
* Represents a simple command which give you the whole string representation
*/
public interface CommandProcessor {
/**
* Get the main command's name
* Get the main command's name.
*
* @return the main command's name
*/
String getCommandName();
/**
* Get the command's aliases
* Get the command's aliases.
* <p>
* Can be null or empty
* Can be null or empty.
*
* @return the command aliases
*/
@ -34,7 +34,7 @@ public interface CommandProcessor {
boolean process(CommandSender sender, String command, String[] args);
/**
* Called to know if a player has access to the command
* Called to know if a player has access to the command.
* <p>
* Right now it is only used to know if the player should see the command in auto-completion
* Conditions still need to be checked in {@link #process(CommandSender, String, String[])}
@ -45,22 +45,25 @@ public interface CommandProcessor {
boolean hasAccess(Player player);
/**
* Disabling it will deactivate the {@link #onWrite(String)} callback
* Enabling it will result in a degression of performance
* Needed to enable {@link #onWrite(String)} callback
* <p>
* Be aware that enabling it can cost some performance because of how often it will be called.
*
* @return true to enable writing tracking (and server auto completion)
* @see #onWrite(String)
*/
default boolean enableWritingTracking() {
return false;
}
/**
* Allow for tab auto completion, this is called everytime the player press a key in the chat
* Allow for tab auto completion, this is called everytime the player press a key in the chat.
* <p>
* WARNING: {@link #enableWritingTracking()} needs to return true, you need to override it by default
* WARNING: {@link #enableWritingTracking()} needs to return true, you need to override it by default.
*
* @param text the whole player text
* @return the array containing all the suggestion for the current arg (split " ")
* @see #enableWritingTracking()
*/
default String[] onWrite(String text) {
return null;

View File

@ -10,7 +10,7 @@ import java.util.Collection;
import java.util.List;
/**
* Represent a command which have suggestion/auto-completion
* Represents a command which have suggestion/auto-completion
*/
public class Command {

View File

@ -626,7 +626,7 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta
* @param blockPosition the block position
* @param actionId
* @param actionParam
* @see <a href="https://wiki.vg/Protocol#Block_Action">Packet information</a> for the action id &amp; param
* @see <a href="https://wiki.vg/Protocol#Block_Action">BlockActionPacket</a> for the action id &amp; param
*/
public void sendBlockAction(BlockPosition blockPosition, byte actionId, byte actionParam) {
final short blockStateId = getBlockStateId(blockPosition);