Add dimension whitelist option for evil wizard spawning and restrict numbers to 1 per chunk, closes #26

This commit is contained in:
Electroblob
2018-06-03 22:22:18 +01:00
parent 5ba92e5de5
commit 9b5e5a871c
4 changed files with 27 additions and 0 deletions
@@ -265,6 +265,21 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
(NBTTagInt tag) -> Spell.get(tag.getInt()));
this.hasTower = nbt.getBoolean("hasTower");
}
@Override
public int getMaxSpawnedInChunk(){
return 1;
}
@Override
public boolean getCanSpawnHere(){
// Evil wizards can only spawn in the specified dimensions
for(int id : Wizardry.settings.evilWizardDimensions){
if(this.dimension == id) return super.getCanSpawnHere();
}
return false;
}
@Override
protected boolean canDespawn(){