mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-24 11:36:53 +01:00
Fix issue when icons cannot be changed via parse.
Parser does not work with materials. Use materials directly instead.
This commit is contained in:
parent
ca32c53510
commit
3d0f01f2dd
@ -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;
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user