feat: added support for custom Elements

This commit is contained in:
WinDanesz
2022-09-10 02:01:49 +02:00
parent b7ffd61020
commit 739a1573e1
6 changed files with 35 additions and 13 deletions
@@ -747,7 +747,8 @@ public class EntityWizard extends EntityCreature implements INpc, IMerchant, ISp
textureIndex = this.rand.nextInt(6);
if(rand.nextBoolean()){
this.setElement(Element.values()[rand.nextInt(Element.values().length - 1) + 1]);
Element[] elements = (Element[]) Arrays.stream(Element.values()).filter(Element::hasWizards).toArray();
this.setElement(elements[rand.nextInt(elements.length - 1) + 1]);
}else{
this.setElement(Element.MAGIC);
}