Infinidoge / nix-minecraft

An attempt to better support Minecraft-related content for the Nix ecosystem
MIT License
172 stars 18 forks source link

Getting error when trying to set up datapack #74

Open Alexnortung opened 1 week ago

Alexnortung commented 1 week ago

Hello, I was trying to install a datapack as discussed in this issue.

The server starts normally without the symlink, but as soon as i add it, the server does not start and i get an error when checking the tmux socket.

config

      block-busters-1-21-test = {
        enable = true;
        package = inputs.minecraft-servers.legacyPackages.${system}.vanillaServers.vanilla-1_21;
        jvmOpts = "-Xms2G -Xmx8G";
        serverProperties = {
          server-ip = "0.0.0.0";
          enable-query = false;
          enable-jmx-monitoring = false;
          motd = "Block Busters";
          "query.port" = 25565;
          texture-pack = "";
          network-compression-threshold = 256;
          rate-limit = 0;
          max-tick-time = -1;
          require-resource-pack = false;
          resource-pack-sha1 = "";
          generator-settings = "";
          use-native-transport = true;
          enable-status = true;
          enable-command-block = false;
          gamemode = "survival";
          force-gamemode = false;
          level-name = "world";
          pvp = true;
          generate-structures = true;
          difficulty = "hard";
          max-players = 12;
          online-mode = true;
          allow-flight = false;
          view-distance = 18;
          max-build-height = 256;
          allow-nether = true;
          server-port = 25565;
          op-permission-level = 4;
          player-idle-timeout = 0;
          debug = false;
          hardcore = false;
          white-list = true;
          broadcast-console-to-ops = true;
          boradcast-rcon-to-ops = true;
          spawn-npcs = true;
          spawn-animals = true;
          snooper-enabled = true;
          text-filtering-config = "";
          function-permission-level = 2;
          level-type = "default";
          spawn-monsters = true;
          spawn-protection = 0;
          max-world-size = 29999984;
          sync-chunk-writes = true;
          prevent-proxy-connection = false;
          entity-broadcast-range-percentage = 100;
          level-seed = "2529419826";
          server-port = 25566;
        };

        symlinks = {
          "world/datapacks/Deactivate-Portals.zip" = pkgs.fetchurl {
            url = "https://cdn.modrinth.com/data/L83JDWD9/versions/bOGaf8Q5/Deactivate-Portals.zip";
            sha256 = "sha256-14sYSQAmixq1i6UP98eKQ4X5EqilQtWaFXKigsKERWw=";
          };
        };
      };

Error message:

[23:42:39] [ServerMain/WARN]: Did not find udev library in operating system. Some features may not work.

image

Infinidoge commented 1 week ago

The udev error is unrelated, but is annoying. I'm not quite sure how to resolve it. With regards to datapacks, that is actually a recent Minecraft ""feature"" which prevents loading words with symlinks in them. Thank you for bringing it up, as this is something that could easily be automated in terms of working around it. See the 1.20 pre-release 7 change log and corresponding help article for more information.

This should work to get Minecraft to shut up: (Written without testing so might need to be modified to work properly)

symlinks = {
  "allowed_symlinks.txt" = pkgs.writeText "allowed_symlinks.txt" "/nix/store";
};