Apply a #trim() to the Item-Type-Input KitEditorGUI to avoid the default

The GUI has the input set to ` ` by default which causes many players to send ` DIRT` instead.


SD-8423
This commit is contained in:
Christian Koop 2022-02-21 18:56:24 +01:00
parent 403440a684
commit d74d0bdf79
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 2 additions and 9 deletions

View File

@ -80,13 +80,6 @@
<exclude>LICENSE.**</exclude>
</excludes>
</filter>
<!--<filter>-->
<!-- <artifact>org.jetbrains:annotations</artifact>-->
<!-- <excludes>-->
<!-- <exclude>**</exclude>-->
<!-- </excludes>-->
<!--</filter>-->
</filters>
</configuration>
</execution>

View File

@ -394,9 +394,9 @@ public class KitEditorGui extends DoubleGui {
AnvilGui gui = new AnvilGui(player, this);
gui.setTitle("Enter a Material");
gui.setAction(event -> {
CompatibleMaterial compatibleMaterial = CompatibleMaterial.getMaterial(gui.getInputText());
CompatibleMaterial compatibleMaterial = CompatibleMaterial.getMaterial(gui.getInputText().trim());
if (compatibleMaterial == null) {
player.sendMessage(gui.getInputText() + " is not a valid material.");
player.sendMessage("'" + gui.getInputText().trim() + "' is not a valid material.");
} else {
Material material = compatibleMaterial.getMaterial();
KitItem newItem = new KitItem(itemStack);