Gamerules (probably level.dat) not saved correctly

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None
    • git-Spigot-f16400e-8a3d3f4 (MC: 1.14.3 Pre-Release 4) (Implementing API version 1.14.3-pre4-SNAPSHOT)
    • Yes

      Changes to gamerules are not saved when unloading a world.

      This issues affects the latest 1.14.2 and 1.14.3-pre4 builds.

      Example plugin code:

      @Override
      public void onEnable() {
         World test = Bukkit.createWorld(new WorldCreator("test"));
         System.out.println(test.getGameRuleValue(GameRule.DO_DAYLIGHT_CYCLE));
         test.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false);
         System.out.println(test.getGameRuleValue(GameRule.DO_DAYLIGHT_CYCLE));
      
         test.save(); //Doesn't matter if I call this before unload.
         Bukkit.unloadWorld(test, true);
      
         test = Bukkit.createWorld(new WorldCreator("test"));
         System.out.println(test.getGameRuleValue(GameRule.DO_DAYLIGHT_CYCLE));
      }
      

      Output:

      ...
      true
      false
      ...
      true

      A binary of the plugin is in the attachments.

            Assignee:
            Unassigned
            Reporter:
            Gero Cammans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: