mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 09:57:45 +01:00
Fix exception when forgetting ]
This commit is contained in:
parent
c2270f8922
commit
e79b5ce41d
@ -11,6 +11,7 @@ public class ArgumentBlockState extends Argument<Block> {
|
|||||||
|
|
||||||
public static final int NO_BLOCK = 1;
|
public static final int NO_BLOCK = 1;
|
||||||
public static final int INVALID_BLOCK = 2;
|
public static final int INVALID_BLOCK = 2;
|
||||||
|
public static final int INVALID_PROPERTY = 3;
|
||||||
|
|
||||||
public ArgumentBlockState(@NotNull String id) {
|
public ArgumentBlockState(@NotNull String id) {
|
||||||
super(id);
|
super(id);
|
||||||
@ -29,6 +30,8 @@ public class ArgumentBlockState extends Argument<Block> {
|
|||||||
throw new ArgumentSyntaxException("Invalid block type", input, INVALID_BLOCK);
|
throw new ArgumentSyntaxException("Invalid block type", input, INVALID_BLOCK);
|
||||||
return block;
|
return block;
|
||||||
} else {
|
} else {
|
||||||
|
if (!input.endsWith("]"))
|
||||||
|
throw new ArgumentSyntaxException("Property list need to end with ]", input, INVALID_PROPERTY);
|
||||||
// Block state
|
// Block state
|
||||||
final String blockName = input.substring(0, nbtIndex);
|
final String blockName = input.substring(0, nbtIndex);
|
||||||
Block block = Block.fromNamespaceId(blockName);
|
Block block = Block.fromNamespaceId(blockName);
|
||||||
|
Loading…
Reference in New Issue
Block a user