diff --git a/rpgregions/src/main/java/net/islandearth/rpgregions/gui/RegionCreateGUI.java b/rpgregions/src/main/java/net/islandearth/rpgregions/gui/RegionCreateGUI.java index e073861..2d133c3 100644 --- a/rpgregions/src/main/java/net/islandearth/rpgregions/gui/RegionCreateGUI.java +++ b/rpgregions/src/main/java/net/islandearth/rpgregions/gui/RegionCreateGUI.java @@ -65,7 +65,7 @@ public class RegionCreateGUI extends RPGRegionsGUI { .withLore("&7Set the material & custom model data of the icon.", "", "&e&lClick &7to set material and icon model.") .build(); model.addItem(new GuiItem(modelItem, event -> { - new ReturnValueConversationPreset(player, "Enter the material and model, split using ':'. Example: TOTEM_OF_UNDYING:1", input -> { + new ReturnValueConversationPreset(player, "Enter the material and/or model, split using ':'. Example: TOTEM_OF_UNDYING:1", input -> { final String[] split = input.split(":"); try { final Optional materialOptional = Enums.getIfPresent(Material.class, split[0]); @@ -75,8 +75,10 @@ public class RegionCreateGUI extends RPGRegionsGUI { return; } - final int potentialModel = Integer.parseInt(split[1]); - region.setIconModel(potentialModel); + try { + final int potentialModel = Integer.parseInt(split[1]); + region.setIconModel(potentialModel); + } catch (IndexOutOfBoundsException ignored) {} region.setIcon(materialOptional.get()); } catch (NumberFormatException e) { player.sendMessage(ChatColor.RED + "'" + split[1] + "' is not a valid number.");