Correct sheep color formatting, fixes #1828

This commit is contained in:
PikaMug 2021-11-07 23:34:12 -05:00
parent 7b7b676b8d
commit 5c166f2041

View File

@ -3147,14 +3147,19 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
+ stageNum + ".sheep-to-shear");
final List<Integer> shearAmounts = config.getIntegerList("quests." + questKey
+ ".stages.ordered." + stageNum + ".sheep-amounts");
for (final String color : sheep) {
for (String color : sheep) {
DyeColor dc = null;
if (color.equalsIgnoreCase("NULL")) {
dc = DyeColor.WHITE;
}
try {
if (dc == null) {
dc = DyeColor.valueOf(color.toUpperCase());
for (final DyeColor val : DyeColor.values()) {
if (val.name().replace("_", "").equalsIgnoreCase(color.replace("_", ""))) {
dc = val;
break;
}
}
}
} catch (final IllegalArgumentException e) {
// Fail silently