예제 #1
0
 @SubscribeEvent
 public void onChunkUnload(ChunkEvent.Unload event) {
   List[] entityLists = event.getChunk().entityLists;
   for (List entityList : entityLists) {
     for (Object thing : entityList) {
       MobPicker.removeMobInstance((Entity) thing);
     }
   }
 }
예제 #2
0
  @SubscribeEvent
  public void onChunkUnload(ChunkEvent.Unload event) {
    if (event.world.isRemote) {
      @SuppressWarnings("unchecked")
      Map<ChunkPosition, TileEntity> tiles = event.getChunk().chunkTileEntityMap;

      for (TileEntity light : tiles.values()) {
        if (light instanceof TileEntityLight) {
          ClientProxy.lights.remove(light);
        }
      }
    }
  }