Java Code Examples for com.mojang.brigadier.arguments.StringArgumentType#word()

The following examples show how to use com.mojang.brigadier.arguments.StringArgumentType#word() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StringArgumentPropertySerializer.java    From Velocity with MIT License 5 votes vote down vote up
@Override
public StringArgumentType deserialize(ByteBuf buf) {
  int type = ProtocolUtils.readVarInt(buf);
  switch (type) {
    case 0:
      return StringArgumentType.word();
    case 1:
      return StringArgumentType.string();
    case 2:
      return StringArgumentType.greedyString();
    default:
      throw new IllegalArgumentException("Invalid string argument type " + type);
  }
}
 
Example 2
Source File: StringArgument.java    From 1.13-Command-API with Apache License 2.0 4 votes vote down vote up
/**
 * A string argument for one word
 */
public StringArgument() {
	super(StringArgumentType.word());
}