Class WorldConfiguration

    • Method Detail

      • fromWorld

        @NotNull
        public static @NotNull WorldConfiguration fromWorld​(@NotNull
                                                            @NotNull org.bukkit.World world)
        Create a world configuration from a World instance. The generator name will be inferred from the ChunkGenerator instance
        Parameters:
        world - World instance
        Returns:
        The constructed configuration instance
      • fromFile

        @Nullable
        public static @Nullable WorldConfiguration fromFile​(@NotNull
                                                            @NotNull Path path)
        Construct a configuration instance from a given file
        Parameters:
        path - File path
        Returns:
        Constructed configuration instance
      • getName

        @NotNull
        public @NotNull String getName()
        Get the world name
        Returns:
        World name
      • getType

        @NotNull
        public @NotNull WorldType getType()
        Get the world type
        Returns:
        World type
      • getSettings

        @NotNull
        public @NotNull String getSettings()
        Get the world setting string This is primarily used by the flat world generator
        Returns:
        Setting string
      • getSeed

        public long getSeed()
        Get the world seed
        Returns:
        World seed
      • isGenerateStructures

        public boolean isGenerateStructures()
        Check if the world should generate structured
        Returns:
        Structure generation status
      • getGenerator

        public String getGenerator()
        Get the world generator name
        Returns:
        World generator name
      • getGeneratorArg

        public String getGeneratorArg()
        Get the world generator ID
        Returns:
        World generator ID
      • getFlags

        @NotNull
        public @NotNull Map<String,​String> getFlags()
        Get an internal map containing all configured flags
        Returns:
        All configured world flags
      • setFlagValue

        public void setFlagValue​(@NotNull
                                 @NotNull String flag,
                                 @Nullable
                                 @Nullable String flagValue)
        Update a flag value internally
        Parameters:
        flag - Flag name
        flagValue - Flag value
      • isLoaded

        public boolean isLoaded()
        Check whether a world is supposed to be loaded
        Returns:
        World load status
      • setLoaded

        public void setLoaded​(boolean loaded)
        Set whether a world is supposed to be loaded
        Parameters:
        loaded - World load status
      • writeToFile

        public void writeToFile​(@NotNull
                                @NotNull Path path)
        Write this configuration to a file
        Parameters:
        path - File to write to