Try not to break horribly when encountering an unexpected profession (can't assume new ones won't be added later on / by mods).

This commit is contained in:
Sollace 2018-04-27 19:12:45 +02:00
parent 8118cff5b6
commit b410b988a2
2 changed files with 2 additions and 2 deletions

View file

@ -31,6 +31,6 @@ public class RenderPonyVillager extends RenderPonyMob<EntityVillager> {
@Override
protected ResourceLocation getTexture(EntityVillager entity) {
return PROFESSIONS[entity.getProfession()];
return PROFESSIONS[entity.getProfession() % PROFESSIONS.length];
}
}

View file

@ -24,7 +24,7 @@ public class RenderPonyZombieVillager extends RenderPonyMob<EntityZombieVillager
@Override
protected ResourceLocation getTexture(EntityZombieVillager entity) {
return PROFESSIONS[entity.getProfession()];
return PROFESSIONS[entity.getProfession() % PROFESSIONS.length];
}
@Override