Esempio n. 1
0
 private static List getSpawnableList(
     World w, BiomeGenBase par1BiomeGenBase, EnumCreatureType par2EnumCreatureType) {
   List list2 = par1BiomeGenBase.getSpawnableList(par2EnumCreatureType);
   List list = new ArrayList();
   for (Object o : list2) {
     SpawnListEntry s = (SpawnListEntry) o;
     String str = (String) (classToStringMapping.get(s.entityClass));
     if (EntityLiving.allow(str, w.provider.dimensionId)) {
       list.add(s);
     }
   }
   return list;
 }
Esempio n. 2
0
 private static SpawnListEntry spawnRandomCreature(
     World w, EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) {
   if (w instanceof FakeWorldServer) {
     return null;
   }
   List list2 = w.getChunkProvider().getPossibleCreatures(par1EnumCreatureType, par2, par3, par4);
   List list = new ArrayList();
   for (Object o : list2) {
     SpawnListEntry s = (SpawnListEntry) o;
     String str = (String) (classToStringMapping.get(s.entityClass));
     if (EntityLiving.allow(str, w.provider.dimensionId)) {
       list.add(s);
     }
   }
   if (list == null || list.isEmpty()) {
     return null;
   }
   return (SpawnListEntry) WeightedRandom.getRandomItem(w.rand, list);
 }