mirror of https://github.com/PikaMug/Quests.git
Fix loading of underscored mobs-to-tame, fixes #2084
This commit is contained in:
parent
3c8acea21a
commit
e5322074b8
|
@ -3413,18 +3413,18 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||||
final List<Integer> mobAmounts = config.getIntegerList("quests." + questKey + ".stages.ordered."
|
final List<Integer> mobAmounts = config.getIntegerList("quests." + questKey + ".stages.ordered."
|
||||||
+ stageNum + ".mob-tame-amounts");
|
+ stageNum + ".mob-tame-amounts");
|
||||||
for (final String mob : mobs) {
|
for (final String mob : mobs) {
|
||||||
if (mob != null) {
|
final EntityType type = MiscUtil.getProperMobType(mob);
|
||||||
final Class<? extends Entity> ec = EntityType.valueOf(mob.toUpperCase())
|
if (type != null) {
|
||||||
.getEntityClass();
|
final Class<? extends Entity> ec = type.getEntityClass();
|
||||||
if (ec != null && Tameable.class.isAssignableFrom(ec)) {
|
if (ec != null && Tameable.class.isAssignableFrom(ec)) {
|
||||||
oStage.addMobToTame(EntityType.valueOf(mob.toUpperCase()));
|
oStage.addMobToTame(type);
|
||||||
oStage.addMobNumToTame(mobAmounts.get(mobs.indexOf(mob)));
|
oStage.addMobNumToTame(mobAmounts.get(mobs.indexOf(mob)));
|
||||||
} else {
|
} else {
|
||||||
throw new StageFormatException("mobs-to-tame has invalid tameable mob " + mob,
|
throw new StageFormatException("mobs-to-tame has invalid tameable mob " + mob,
|
||||||
quest, stageNum);
|
quest, stageNum);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new StageFormatException("mobs-to-tame has invalid mob", quest, stageNum);
|
throw new StageFormatException("mobs-to-tame has invalid mob name " + mob, quest, stageNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue