diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/BuildWorld.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/BuildWorld.java
index ee03f364..e327c29d 100644
--- a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/BuildWorld.java
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/BuildWorld.java
@@ -88,8 +88,10 @@ public interface BuildWorld extends Displayable {
/**
* Gets the custom chunk generator used to generate the world.
+ *
+ * Only set when the world type is {@link BuildWorldType#CUSTOM} or {@link BuildWorldType#IMPORTED}.
*
- * @return The custom chunk generator used to generate the world.
+ * @return The custom chunk generator used to generate the world, or {@code null} if not set
*/
@Nullable
CustomGenerator getCustomGenerator();
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/Backup.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/Backup.java
new file mode 100644
index 00000000..1aaab91d
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/Backup.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2018-2025, Thomas Meaney
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package de.eintosti.buildsystem.api.world.backup;
+
+/**
+ * Represents a single backup of a {@link de.eintosti.buildsystem.api.world.BuildWorld}.
+ */
+public interface Backup {
+
+ /**
+ * Returns the {@link BackupProfile} that owns this backup.
+ *
+ * @return The owner of the backup.
+ */
+ BackupProfile owner();
+
+ /**
+ * Returns the timestamp when this backup was created.
+ *
+ * @return The creation time in milliseconds since the Unix epoch.
+ */
+ long creationTime();
+
+ /**
+ * Returns a unique key or identifier for this backup.
+ *
+ * @return The key of the backup.
+ */
+ String key();
+}
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/BackupProfile.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/BackupProfile.java
new file mode 100644
index 00000000..e06d0995
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/BackupProfile.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2023-2025, Thomas Meaney
+ * All rights reserved.
+ *
+ * Unauthorized copying of this file, via any medium is strictly prohibited
+ * Proprietary and confidential
+ */
+package de.eintosti.buildsystem.api.world.backup;
+
+import de.eintosti.buildsystem.api.world.BuildWorld;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import org.bukkit.entity.Player;
+
+/**
+ * Represents a profile for managing backups of a specific {@link BuildWorld}. This interface defines operations related to listing, creating, restoring, and destroying backups.
+ */
+public interface BackupProfile {
+
+ /**
+ * Asynchronously populates a list of available {@link Backup}s under this profile.
+ *
+ * @return Future that will be completed with available backups
+ */
+ CompletableFuture> listBackups();
+
+ /**
+ * Creates a backup of the {@link BuildWorld}. If the profile is at the maximum backup capacity, the oldest backup will be deleted.
+ *
+ * @return Future that completes with the created backup.
+ */
+ CompletableFuture createBackup();
+
+ /**
+ * Restores a {@link Backup}.
+ *
+ * @param backup Backup to restore
+ * @param player The player restoring the backup
+ */
+ void restoreBackup(Backup backup, Player player);
+
+ /**
+ * Removes all {@link Backup}s stored for this profile.
+ */
+ void destroy();
+}
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/BackupStorage.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/BackupStorage.java
new file mode 100644
index 00000000..7116cfc3
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/BackupStorage.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2018-2025, Thomas Meaney
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package de.eintosti.buildsystem.api.world.backup;
+
+import de.eintosti.buildsystem.api.world.BuildWorld;
+import java.io.File;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Represents a storage mechanism for managing world backups.
+ */
+public interface BackupStorage {
+
+ /**
+ * Generates a unique backup name based on a given timestamp.
+ *
+ * @param timestamp The timestamp to use for the backup name.
+ * @return A string representing the backup name (e.g., "1678886400000.zip").
+ */
+ default String getBackupName(long timestamp) {
+ return timestamp + ".zip";
+ }
+
+ /**
+ * Lists all available {@link Backup}s for a specific {@link BuildWorld}.
+ *
+ * @param buildWorld The world for which to list backups
+ * @return A future with a list of backup objects associated with the specified world
+ */
+ CompletableFuture> listBackups(BuildWorld buildWorld);
+
+ /**
+ * Creates and stores a new {@link Backup} for a given {@link BuildWorld}. The result of the operation is communicated via the provided {@link CompletableFuture}.
+ *
+ * In comparison to {@link BackupProfile#createBackup()}, a backup will always be created and no older backups will be deleted. This method is intended for immediate backup
+ * creation and storage, rather than profile management.
+ *
+ * @param buildWorld The world to be backed up
+ * @return A future that will be completed with the backup object upon successful storage, or exceptionally if an error occurs
+ */
+ CompletableFuture storeBackup(BuildWorld buildWorld);
+
+ /**
+ * Downloads a specific {@link Backup} file asynchronously.
+ *
+ * @param backup The backup object representing the backup to be downloaded
+ * @return A future that will complete with a {@link File} object pointing to the downloaded backup once the download operation is finished
+ */
+ CompletableFuture downloadBackup(Backup backup);
+
+ /**
+ * Deletes a specific {@link Backup}.
+ *
+ * @param backup The backup object representing the backup to be deleted
+ * @return A future that will complete after the deletion
+ */
+ CompletableFuture deleteBackup(Backup backup);
+
+ /**
+ * Closes the backup storage, releasing any resources.
+ */
+ void close();
+}
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/package-info.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/package-info.java
new file mode 100644
index 00000000..cafd7c5f
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/backup/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018-2025, Thomas Meaney
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * Provides interfaces and classes for managing world backups.
+ */
+package de.eintosti.buildsystem.api.world.backup;
\ No newline at end of file
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/builder/package-info.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/builder/package-info.java
new file mode 100644
index 00000000..26c9a353
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/builder/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018-2025, Thomas Meaney
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * Provides interfaces and classes for managing world builders and their associated permissions.
+ */
+package de.eintosti.buildsystem.api.world.builder;
\ No newline at end of file
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/creation/BuildWorldCreator.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/creation/BuildWorldCreator.java
index 9f474446..85565ca5 100644
--- a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/creation/BuildWorldCreator.java
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/creation/BuildWorldCreator.java
@@ -127,25 +127,26 @@ public interface BuildWorldCreator {
void importWorld(Player player, boolean teleport);
/**
- * Generates the underlying Bukkit {@link World} and applies post-generation settings.
+ * Generates the underlying Bukkit {@link World} and applies post-generation settings. Only generates the world if the world was not created in a newer Minecraft version that
+ * the server is running.
*
- * Only generates the world if the world was not created in a newer Minecraft version that the server is running.
+ * Important: This method should only be called after the world has been created and registered with the plugin.
*
- * @param buildWorld The build world to generate
* @return The generated {@link World}, or {@code null} if generation failed
*/
@Nullable
- default World generateBukkitWorld(BuildWorld buildWorld) {
- return generateBukkitWorld(buildWorld, true);
+ default World generateBukkitWorld() {
+ return generateBukkitWorld(true);
}
/**
* Generates the underlying Bukkit {@link World} and applies post-generation settings.
+ *
+ * Important: This method should only be called after the world has been created and registered with the plugin.
*
- * @param buildWorld The build world to generate
* @param checkVersion If true, verify that the world's data version is compatible
- * @return The generated {@link World}, or {@code null} if generation failed.
+ * @return The generated {@link World}, or {@code null} if generation failed
*/
@Nullable
- World generateBukkitWorld(BuildWorld buildWorld, boolean checkVersion);
+ World generateBukkitWorld(boolean checkVersion);
}
\ No newline at end of file
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/creation/package-info.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/creation/package-info.java
new file mode 100644
index 00000000..2fa2bf6a
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/creation/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018-2025, Thomas Meaney
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * Provides interfaces and classes for managing world creation and initialization.
+ */
+package de.eintosti.buildsystem.api.world.creation;
\ No newline at end of file
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/BuildWorldType.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/BuildWorldType.java
index 9362f4e6..46b16d9f 100644
--- a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/BuildWorldType.java
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/BuildWorldType.java
@@ -32,50 +32,50 @@ public enum BuildWorldType {
/**
* A standard world type, equivalent to a default Minecraft overworld with {@link Environment#NORMAL}.
*/
- NORMAL(),
+ NORMAL,
/**
* A super-flat world, ideal for creative building without terrain obstacles.
*/
- FLAT(),
+ FLAT,
/**
* A world type representing the Nether dimension, with {@link Environment#NETHER}.
*/
- NETHER(),
+ NETHER,
/**
* A world type representing the End dimension, with {@link Environment#THE_END}.
*/
- END(),
+ END,
/**
* An empty world, containing no blocks except for a single platform at spawn.
*/
- VOID(),
+ VOID,
/**
* A world created as an identical copy of an existing template world.
*/
- TEMPLATE(),
+ TEMPLATE,
/**
* A world that, by default, can only be modified by its creator.
*/
- PRIVATE(),
+ PRIVATE,
/**
* A world that was not originally created by the BuildSystem plugin but has been imported for management.
*/
- IMPORTED(),
+ IMPORTED,
/**
* A world generated using a custom {@link ChunkGenerator}.
*/
- CUSTOM(),
+ CUSTOM,
/**
* A world whose type could not be determined or is not recognized by the BuildSystem.
*/
- UNKNOWN()
+ UNKNOWN
}
\ No newline at end of file
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/WorldData.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/WorldData.java
index 7b007cd3..f788b6b9 100644
--- a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/WorldData.java
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/data/WorldData.java
@@ -19,6 +19,7 @@
import com.cryptomorin.xseries.XMaterial;
import de.eintosti.buildsystem.api.world.BuildWorld;
+import de.eintosti.buildsystem.api.world.backup.Backup;
import java.util.Map;
import org.bukkit.Difficulty;
import org.bukkit.Location;
@@ -139,6 +140,13 @@ public interface WorldData {
*/
Type privateWorld();
+ /**
+ * Gets the number of seconds that have passed since that last {@link Backup} of the {@link BuildWorld} was created.
+ *
+ * @return The number of seconds since the last backup
+ */
+ Type timeSinceBackup();
+
/**
* Retrieves a {@link Type} object representing the timestamp (in milliseconds since epoch) of the last time the {@link BuildWorld} was edited.
*
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/display/package-info.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/display/package-info.java
new file mode 100644
index 00000000..5d485e1d
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/display/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018-2025, Thomas Meaney
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * Provides interfaces and classes for managing world display and rendering.
+ */
+package de.eintosti.buildsystem.api.world.display;
\ No newline at end of file
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/util/WorldPermissions.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/util/WorldPermissions.java
index 503a7628..9a9b40a7 100644
--- a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/util/WorldPermissions.java
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/util/WorldPermissions.java
@@ -18,6 +18,7 @@
package de.eintosti.buildsystem.api.world.util;
import de.eintosti.buildsystem.api.world.BuildWorld;
+import de.eintosti.buildsystem.api.world.builder.Builder;
import de.eintosti.buildsystem.api.world.data.BuildWorldStatus;
import java.util.function.Supplier;
import org.bukkit.entity.Player;
@@ -48,13 +49,13 @@ public interface WorldPermissions {
boolean canEnter(Player player);
/**
- * Determines if the given {@link Player} can modify the {@link de.eintosti.buildsystem.api.world.BuildWorld} they are currently in.
+ * Determines if the given {@link Player} can modify the {@link BuildWorld} they are currently in.
*
* Modifications might be disallowed due to:
*
* - The world having its {@link BuildWorldStatus} set to {@link BuildWorldStatus#ARCHIVE}.
* - A world setting is enabled that specifically prohibits certain events (e.g., block placement/breaking).
- * - The world is configured to only allow designated {@link de.eintosti.buildsystem.api.world.builder.Builder}s, and the player is neither a builder nor the world's creator.
+ * - The world is configured to only allow designated {@link Builder}s, and the player is neither a builder nor the world's creator.
*
* However, a player can bypass these restrictions if:
*
diff --git a/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/util/package-info.java b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/util/package-info.java
new file mode 100644
index 00000000..a8ed32d6
--- /dev/null
+++ b/buildsystem-api/src/main/java/de/eintosti/buildsystem/api/world/util/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018-2025, Thomas Meaney
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * Provides utility classes and interfaces for managing world-related operations.
+ */
+package de.eintosti.buildsystem.api.world.util;
\ No newline at end of file
diff --git a/buildsystem-core/build.gradle.kts b/buildsystem-core/build.gradle.kts
index 960b6c1d..01c17a51 100644
--- a/buildsystem-core/build.gradle.kts
+++ b/buildsystem-core/build.gradle.kts
@@ -1,10 +1,12 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
applyCoreConfiguration()
plugins {
id("java-library")
id("com.gradleup.shadow") version "8.3.7"
+ id("de.eldoria.plugin-yml.bukkit") version "0.7.1"
}
project.description = "Core"
@@ -49,6 +51,12 @@ dependencies {
implementation(libs.fastboard)
implementation(libs.nbt) { isTransitive = false }
implementation(libs.bstats)
+ implementation(libs.aws.core) // Unable to find the dependency at runtime, so we add it here
+
+ library(libs.bundles.aws)
+ library(libs.bouncycastle)
+ library(libs.sftp)
+ library(libs.zip4j)
}
tasks.named("assemble") {
@@ -72,4 +80,152 @@ tasks.processResources {
filesMatching("plugin.yml") {
expand(props)
}
+}
+
+bukkit {
+ name = "BuildSystem"
+ version = "${project.version}"
+ description = "Powerful, easy to use system for builders"
+ author = "einTosti"
+ website = "https://buildsystem.eintosti.de"
+
+ main = "de.eintosti.buildsystem.BuildSystemPlugin"
+ apiVersion = "1.13"
+ softDepend = listOf("LuckPerms", "PlaceholderAPI", "WorldEdit", "AxiomPaper")
+
+ commands {
+ register("back") {
+ description = "Teleports you to your previous location."
+ usage = "/"
+ }
+ register("blocks") {
+ description = "Opens a menu with secret blocks."
+ usage = "/"
+ }
+ register("build") {
+ description = "Bypass build restrictions."
+ usage = "/ [player]"
+ }
+ register("buildsystem") {
+ description = "Overview of all plugin commands."
+ usage = "/"
+ }
+ register("config") {
+ description = "Reload the config."
+ usage = "/ reload"
+ }
+ register("day") {
+ description = "Set a world's time to daytime."
+ usage = "/ [world]"
+ }
+ register("explosions") {
+ description = "Toggle explosions within a world."
+ usage = "/ [world]"
+ }
+ register("gamemode") {
+ description = "Change your gamemode."
+ aliases = listOf("gm")
+ usage = "/ [player]"
+ }
+ register("night") {
+ description = "Set a world's time to nighttime."
+ usage = "/ [world]"
+ }
+ register("noai") {
+ description = "Disable all the entity AIs in a world."
+ usage = "/ [world]"
+ }
+ register("physics") {
+ description = "Toggle block physics."
+ usage = "/ [world]"
+ }
+ register("settings") {
+ description = "Manage user settings."
+ usage = "/"
+ }
+ register("setup") {
+ description = "Change the default items in used in the navigator."
+ usage = "/"
+ }
+ register("skull") {
+ description = "Receive a player's skull."
+ usage = "/ [name]"
+ }
+ register("spawn") {
+ description = "Teleport to the spawn."
+ usage = "/"
+ }
+ register("speed") {
+ description = "Change your flying/walking speed."
+ aliases = listOf("s")
+ usage = "/ [1-5]"
+ }
+ register("top") {
+ description = "Teleports you to the highest location."
+ usage = "/"
+ }
+ register("worlds") {
+ description = "Open the world menu."
+ aliases = listOf("w")
+ usage = "/"
+ }
+ }
+ permissions {
+ register("buildsystem.help") {
+ children = listOf("buildsystem.help.buildsystem", "buildsystem.help.worlds")
+ description = "Permission for help commands."
+ default = BukkitPluginDescription.Permission.Default.TRUE
+ }
+ register("buildsystem.navigator") {
+ description = "Open the worlds navigator."
+ default = BukkitPluginDescription.Permission.Default.TRUE
+ }
+ register("buildsystem.navigator.item") {
+ description = "Receive and use the navigator."
+ default = BukkitPluginDescription.Permission.Default.TRUE
+ }
+ register("buildsystem.create") {
+ children = listOf(
+ "buildsystem.create.private",
+ "buildsystem.create.type.normal",
+ "buildsystem.create.type.flat",
+ "buildsystem.create.type.nether",
+ "buildsystem.create.type.end",
+ "buildsystem.create.type.void"
+ )
+ description = "Permission for creating world types."
+ default = BukkitPluginDescription.Permission.Default.TRUE
+ }
+ register("buildsystem.setstatus") {
+ children = listOf(
+ "buildsystem.setstatus.hidden",
+ "buildsystem.setstatus.archive",
+ "buildsystem.setstatus.finished",
+ "buildsystem.setstatus.almostfinished",
+ "buildsystem.setstatus.inprogress",
+ "buildsystem.setstatus.notstarted"
+ )
+ description = "Permission for setting world status."
+ default = BukkitPluginDescription.Permission.Default.OP
+ }
+ register("buildsystem.gamemode") {
+ children = listOf("buildsystem.gamemode.survival", "buildsystem.gamemode.creative", "buildsystem.gamemode.adventure", "buildsystem.gamemode.spectator")
+ description = "Permission for changing own gamemode."
+ default = BukkitPluginDescription.Permission.Default.OP
+ }
+ register("buildsystem.gamemode.other") {
+ children =
+ listOf("buildsystem.gamemode.survival.other", "buildsystem.gamemode.creative.other", "buildsystem.gamemode.adventure.other", "buildsystem.gamemode.spectator.other")
+ description = "Permission for changing other player's gamemode."
+ default = BukkitPluginDescription.Permission.Default.OP
+ }
+ register("buildsystem.physics.message") {
+ description = "Receive the message that physics are disabled in a world."
+ default = BukkitPluginDescription.Permission.Default.TRUE
+ }
+ register("buildsystem.updates") {
+ description = "Receive update messages."
+ default = BukkitPluginDescription.Permission.Default.OP
+ }
+ }
}
\ No newline at end of file
diff --git a/buildsystem-core/src/main/java/de/eintosti/buildsystem/BuildSystemPlugin.java b/buildsystem-core/src/main/java/de/eintosti/buildsystem/BuildSystemPlugin.java
index 577fc6c0..1c3ed0f8 100644
--- a/buildsystem-core/src/main/java/de/eintosti/buildsystem/BuildSystemPlugin.java
+++ b/buildsystem-core/src/main/java/de/eintosti/buildsystem/BuildSystemPlugin.java
@@ -39,7 +39,13 @@
import de.eintosti.buildsystem.command.TimeCommand;
import de.eintosti.buildsystem.command.TopCommand;
import de.eintosti.buildsystem.command.WorldsCommand;
-import de.eintosti.buildsystem.config.ConfigValues;
+import de.eintosti.buildsystem.config.Config;
+import de.eintosti.buildsystem.config.Config.Folder;
+import de.eintosti.buildsystem.config.Config.Settings.Archive;
+import de.eintosti.buildsystem.config.Config.Settings.Builder;
+import de.eintosti.buildsystem.config.Config.World;
+import de.eintosti.buildsystem.config.Config.World.Unload;
+import de.eintosti.buildsystem.config.migration.ConfigMigrationManager;
import de.eintosti.buildsystem.expansion.luckperms.LuckPermsExpansion;
import de.eintosti.buildsystem.expansion.placeholderapi.PlaceholderApiExpansion;
import de.eintosti.buildsystem.listener.AsyncPlayerChatListener;
@@ -86,6 +92,7 @@
import de.eintosti.buildsystem.util.UpdateChecker;
import de.eintosti.buildsystem.world.SpawnManager;
import de.eintosti.buildsystem.world.WorldServiceImpl;
+import de.eintosti.buildsystem.world.backup.BackupService;
import de.eintosti.buildsystem.world.display.CustomizableIcons;
import java.io.File;
import java.util.HashMap;
@@ -115,8 +122,7 @@ public class BuildSystemPlugin extends JavaPlugin {
private SettingsManager settingsManager;
private SpawnManager spawnManager;
private WorldServiceImpl worldService;
-
- private ConfigValues configValues;
+ private BackupService backupService;
private CustomizableIcons customizableIcons;
private LuckPermsExpansion luckPermsExpansion;
@@ -126,15 +132,17 @@ public class BuildSystemPlugin extends JavaPlugin {
@Override
public void onLoad() {
- createTemplateFolder();
+ new ConfigMigrationManager(this).migrate();
+ this.getConfig().options().copyDefaults(true);
+ this.saveConfig();
+ Config.load();
+
Messages.createMessageFile();
+ createTemplateFolder();
}
@Override
public void onEnable() {
- this.getConfig().options().copyDefaults(true);
- this.saveConfig();
-
initClasses();
registerCommands();
@@ -177,6 +185,8 @@ public void onDisable() {
playerService.closeNavigator(pl);
});
+ this.backupService.getStorage().close();
+
reloadConfigData(false);
saveConfig();
saveBuildConfig();
@@ -191,7 +201,6 @@ public void onDisable() {
}
private void initClasses() {
- this.configValues = new ConfigValues(this);
this.customizableIcons = new CustomizableIcons(this);
this.armorStandManager = new ArmorStandManager();
@@ -199,6 +208,7 @@ private void initClasses() {
this.playerService = new PlayerServiceImpl(this);
this.noClipManager = new NoClipManager(this);
(this.worldService = new WorldServiceImpl(this)).init();
+ this.backupService = new BackupService(this);
this.settingsManager = new SettingsManager(this);
this.spawnManager = new SpawnManager(this);
}
@@ -264,16 +274,14 @@ private void registerListeners() {
private void registerStats() {
Metrics metrics = new Metrics(this, METRICS_ID);
- metrics.addCustomChart(new SimplePie("archive_vanish", () -> String.valueOf(configValues.isArchiveVanish())));
- metrics.addCustomChart(new SimplePie("block_world_edit", () -> String.valueOf(configValues.isBlockWorldEditNonBuilder())));
- metrics.addCustomChart(new SimplePie("join_quit_messages", () -> String.valueOf(configValues.isJoinQuitMessages())));
- metrics.addCustomChart(new SimplePie("lock_weather", () -> String.valueOf(configValues.isLockWeather())));
- metrics.addCustomChart(new SimplePie("scoreboard", () -> String.valueOf(configValues.isScoreboard())));
- metrics.addCustomChart(new SimplePie("teleport_after_creation", () -> String.valueOf(configValues.isTeleportAfterCreation())));
- metrics.addCustomChart(new SimplePie("update_checker", () -> String.valueOf(configValues.isUpdateChecker())));
- metrics.addCustomChart(new SimplePie("unload_worlds", () -> String.valueOf(configValues.isUnloadWorlds())));
- metrics.addCustomChart(new SimplePie("void_block", () -> String.valueOf(configValues.isVoidBlock())));
- metrics.addCustomChart(new AdvancedPie("navigator_type", new Callable