Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2574

Random multiple instances of BlockPopulators

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • Mac OS X 10.11.6, Java 1.8.0_73, Worlds Managed with Multiverse 2.5 (Multiverse-Core 1.1)

    • SpigotBug

      It seems that BlockPopulators can randomly be added more than once to a World, causing them to run more than once per chunk. I have included a sample plugin demonstrating the bug (contains source).

      The console output will contain listings of currently loaded BlockPopulators in the generated world. At first, there will be only one instance. But towards the end, one can notice that there are two listed.

      Upon investigation, I found two points at which the generators are added to the world:

      in World.b():

      if (this.generator != null) {
      	getWorld().getPopulators().addAll(this.generator.getDefaultPopulators(getWorld()));
      }
      
      

      As well as in CraftServer.createWorld(WorldCreator), with the same conditions:

      if (generator != null) {
      	internal.getWorld().getPopulators().addAll(generator.getDefaultPopulators(internal.getWorld()));
      }
      

      What is worth noting, is that CraftServer.createWorld(WorldCreator) actually calls World.b() a couple of lines before.

      I believe this is what causes the bug, though I have not actually tried solving it since I'm unfamiliar with the internal codebase.

            Unassigned Unassigned
            Golui Gregory L
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: