Fixes an incorrect <Material>:CMD-<number> parsing

The issue was that it used an incorrect value for parsing Material. Instead of stripped part[0] it used whole text with CMD in it.
This commit is contained in:
BONNe 2022-05-23 23:23:22 +03:00 committed by GitHub
parent 3ab7ac8484
commit 345b9e2564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@ public class ItemParser {
// Check if there are more properties for the item stack
if (part.length == 1) {
// Parse material directly. It does not have any extra properties.
returnValue = new ItemStack(Material.valueOf(text.toUpperCase()));
returnValue = new ItemStack(Material.valueOf(part[0].toUpperCase()));
}
// Material-specific handling
else if (part[0].contains("POTION") || part[0].equalsIgnoreCase("TIPPED_ARROW")) {