Fixes some incorrect class casts
All checks were successful
KnarCraft/DynmapCitizens/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2024-01-07 05:22:32 +01:00
parent 2ca73252cc
commit 459c25c5cd

View File

@ -8,6 +8,7 @@ import net.citizensnpcs.api.npc.NPCRegistry;
import net.knarcraft.dynmapcitizens.util.QuestsHelper;
import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
@ -70,7 +71,7 @@ public class QuestStagesInfoGenerator {
StringBuilder questInfo = new StringBuilder();
int mobTypes = stage.getMobsToKill().size();
for (int i = 0; i < mobTypes; i++) {
questInfo.append("<li>Kill ").append(QuestsHelper.normalizeName(((DyeColor) stage.getMobsToKill().get(i)).name()));
questInfo.append("<li>Kill ").append(QuestsHelper.normalizeName(((EntityType) stage.getMobsToKill().get(i)).name()));
questInfo.append(" x ").append(stage.getMobNumToKill().get(i));
if (stage.getKillNames().size() > i) {
questInfo.append(" at ").append(stage.getKillNames().get(i));
@ -124,7 +125,7 @@ public class QuestStagesInfoGenerator {
int mobTamingEntries = stage.getMobsToTame().size();
for (int i = 0; i < mobTamingEntries; i++) {
questInfo.append("<li>Tame ").append(stage.getMobNumToTame().get(i)).append(" ").append(
QuestsHelper.normalizeName(((DyeColor) stage.getMobsToTame().get(i)).name())).append("</li>");
QuestsHelper.normalizeName(((EntityType) stage.getMobsToTame().get(i)).name())).append("</li>");
}
return questInfo.toString();