docs: @SubscribeEvent
      public void onGetPotentialSpawns(PotentialSpawns ps)
      {
          // Decide whether or not to allow spawning.
          // We shouldn't allow spawning unless it has been specifically turned on - whether
          // a mission is running or not. (Otherwise spawning may happen in between missions.)
          boolean allowSpawning = false;
          if (currentMissionInit() != null && currentMissionInit().getMission() != null)
          {
              // There is a mission running - does it allow spawning?
              ServerSection ss = currentMissionInit().getMission().getServerSection();
              ServerInitialConditions sic = (ss != null) ? ss.getServerInitialConditions() : null;
              if (sic != null)
                  allowSpawning = (sic.isAllowSpawning() == Boolean.TRUE);
  
              if (allowSpawning && sic.getAllowedMobs() != null && !sic.getAllowedMobs().isEmpty())
              {
                  // Spawning is allowed, but restricted to our list:
                  Iterator<SpawnListEntry> it = ps.getList().iterator();
                  while (it.hasNext())
                  {
                      // Is this on our list?
                      SpawnListEntry sle = it.next();
                      net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(sle.entityClass);
                      String mobName = entry == null ? null : entry.getName();
                      boolean allowed = false;
                      for (EntityTypes mob : sic.getAllowedMobs())
                      {
                          if (mob.value().equals(mobName))
                              allowed = true;
                      }
                      if (!allowed)
                          it.remove();
                  }
              }
          }
          // Cancel spawn event:
          if (!allowSpawning)
              ps.setCanceled(true);
      }