Fix issue when icons cannot be changed via parse.

Parser does not work with materials. Use materials directly instead.
This commit is contained in:
BONNe 2019-01-23 20:31:26 +02:00
parent ca32c53510
commit 3d0f01f2dd
2 changed files with 8 additions and 8 deletions

View File

@ -384,18 +384,18 @@ public class EditChallengeGUI extends CommonGUI
this.user.getPlayer(),
this.challenge.getIcon().getType().name(),
(player, reply) -> {
ItemStack newIcon = ItemParser.parse(reply);
Material material = Material.getMaterial(reply);
if (newIcon != null)
if (material != null)
{
this.challenge.setIcon(newIcon);
this.challenge.setIcon(new ItemStack(material));
this.build();
}
else
{
this.user.sendMessage("challenges.errors.wrong-icon", "[value]", reply);
}
this.build();
return reply;
});

View File

@ -331,18 +331,18 @@ public class EditLevelGUI extends CommonGUI
this.user.getPlayer(),
this.challengeLevel.getIcon().getType().name(),
(player, reply) -> {
ItemStack newIcon = ItemParser.parse(reply);
Material material = Material.getMaterial(reply);
if (newIcon != null)
if (material != null)
{
this.challengeLevel.setIcon(newIcon);
this.challengeLevel.setIcon(new ItemStack(material));
this.build();
}
else
{
this.user.sendMessage("challenges.errors.wrong-icon", "[value]", reply);
}
this.build();
return reply;
});