Program: 177388
Project: 177388
Buggy source:
public void startTickRun(int stage,long delta){
  boolean visibleToPlayers=this.entityManager.getPlayers().size() > 0;
  if (!visibleToPlayers) {
    int bx=getBlockX();
    int by=getBlockY();
    int bz=getBlockZ();
    int half=BLOCKS.SIZE / 2;
    Point center=new Point(getWorld(),bx + half,by + half,bz + half);
    visibleToPlayers=getWorld().getNearbyPlayers(center,BLOCKS.SIZE).size() > 0;
  }
switch (stage) {
case 0:
{
      taskManager.heartbeat(delta);
      float dt=delta / 1000.f;
      for (      SpoutEntity ent : entityManager.getAll()) {
        try {
          if (visibleToPlayers || (ent.getController() != null && isImportant(ent.getController()))) {
            ent.tick(dt);
          }
        }
 catch (        Exception e) {
          Spout.getEngine().getLogger().severe("String_Node_Str" + ent.toString());
          e.printStackTrace();
        }
      }
synchronized (lightDirtyChunks) {
        if (!lightDirtyChunks.isEmpty()) {
          int key;
          int x, y, z;
          TIntIterator iter=lightDirtyChunks.iterator();
          while (iter.hasNext()) {
            key=iter.next();
            x=TByteTripleHashSet.key1(key);
            y=TByteTripleHashSet.key2(key);
            z=TByteTripleHashSet.key3(key);
            SpoutChunk chunk=this.getChunk(x,y,z,LoadOption.NO_LOAD);
            if (chunk == null || !chunk.isLoaded()) {
              iter.remove();
              continue;
            }
            if (chunk.lightingCounter.incrementAndGet() > LIGHT_SEND_TICK_DELAY) {
              chunk.lightingCounter.set(-1);
              if (SpoutConfiguration.LIVE_LIGHTING.getBoolean()) {
                chunk.setLightDirty(true);
              }
              iter.remove();
            }
          }
        }
      }
      for (int i=0; i < POPULATE_PER_TICK; i++) {
        SpoutChunk toPopulate=populationQueue.poll();
        if (toPopulate == null) {
          break;
        }
        toPopulate.setNotQueuedForPopulation();
        if (toPopulate.isLoaded()) {
          toPopulate.populate();
        }
 else {
          i--;
        }
      }
      Chunk toUnload=unloadQueue.poll();
      if (toUnload != null) {
        boolean do_unload=true;
        if (ChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0) {
          ChunkUnloadEvent event=Spout.getEngine().getEventManager().callEvent(new ChunkUnloadEvent(toUnload));
          if (event.isCancelled()) {
            do_unload=false;
          }
        }
        if (do_unload) {
          toUnload.unload(true);
        }
      }
      break;
    }
case 1:
{
    break;
  }
default :
{
  throw new IllegalStateException("String_Node_Str");
}
}
}

Fixed version (ground truth):
public void startTickRun(int stage,long delta){
  boolean visibleToPlayers=this.entityManager.getPlayers().size() > 0;
  if (!visibleToPlayers) {
    int bx=getBlockX();
    int by=getBlockY();
    int bz=getBlockZ();
    int half=BLOCKS.SIZE / 2;
    Point center=new Point(getWorld(),bx + half,by + half,bz + half);
    visibleToPlayers=getWorld().getNearbyPlayers(center,BLOCKS.SIZE).size() > 0;
  }
switch (stage) {
case 0:
{
      taskManager.heartbeat(delta);
      float dt=delta / 1000.f;
      for (      SpoutEntity ent : entityManager.getAll()) {
        try {
          if (visibleToPlayers) {
            ent.tick(dt);
          }
        }
 catch (        Exception e) {
          Spout.getEngine().getLogger().severe("String_Node_Str" + ent.toString());
          e.printStackTrace();
        }
      }
synchronized (lightDirtyChunks) {
        if (!lightDirtyChunks.isEmpty()) {
          int key;
          int x, y, z;
          TIntIterator iter=lightDirtyChunks.iterator();
          while (iter.hasNext()) {
            key=iter.next();
            x=TByteTripleHashSet.key1(key);
            y=TByteTripleHashSet.key2(key);
            z=TByteTripleHashSet.key3(key);
            SpoutChunk chunk=this.getChunk(x,y,z,LoadOption.NO_LOAD);
            if (chunk == null || !chunk.isLoaded()) {
              iter.remove();
              continue;
            }
            if (chunk.lightingCounter.incrementAndGet() > LIGHT_SEND_TICK_DELAY) {
              chunk.lightingCounter.set(-1);
              if (SpoutConfiguration.LIVE_LIGHTING.getBoolean()) {
                chunk.setLightDirty(true);
              }
              iter.remove();
            }
          }
        }
      }
      for (int i=0; i < POPULATE_PER_TICK; i++) {
        SpoutChunk toPopulate=populationQueue.poll();
        if (toPopulate == null) {
          break;
        }
        toPopulate.setNotQueuedForPopulation();
        if (toPopulate.isLoaded()) {
          toPopulate.populate();
        }
 else {
          i--;
        }
      }
      Chunk toUnload=unloadQueue.poll();
      if (toUnload != null) {
        boolean do_unload=true;
        if (ChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0) {
          ChunkUnloadEvent event=Spout.getEngine().getEventManager().callEvent(new ChunkUnloadEvent(toUnload));
          if (event.isCancelled()) {
            do_unload=false;
          }
        }
        if (do_unload) {
          toUnload.unload(true);
        }
      }
      break;
    }
case 1:
{
    break;
  }
default :
{
  throw new IllegalStateException("String_Node_Str");
}
}
}