mirror of https://github.com/PaperMC/Paper.git
30 lines
1.6 KiB
Diff
30 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Wed, 28 Sep 2022 05:09:05 +0100
|
|
Subject: [PATCH] Add WorldUnloadResult
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/world/WorldUnloadResult.java b/src/main/java/io/papermc/paper/world/WorldUnloadResult.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..d8b190dfb44e3f4712f0b2e5677cb0b9893fe5ec
|
|
--- /dev/null
|
|
+++ b/src/main/java/io/papermc/paper/world/WorldUnloadResult.java
|
|
@@ -0,0 +1,17 @@
|
|
+package io.papermc.paper.world;
|
|
+
|
|
+import net.kyori.adventure.text.Component;
|
|
+
|
|
+import org.jetbrains.annotations.NotNull;
|
|
+
|
|
+public record WorldUnloadResult(boolean success, @NotNull Component message) {
|
|
+
|
|
+ public static final WorldUnloadResult SUCCESS = new WorldUnloadResult(true, Component.text("Success"));
|
|
+ public static final WorldUnloadResult NOT_LOADED = new WorldUnloadResult(false, Component.text("Cannot unload unloaded world"));
|
|
+ public static final WorldUnloadResult UNSUPPORTED = new WorldUnloadResult(false, Component.text("Unloading this world is not supported"));
|
|
+ public static final WorldUnloadResult NOT_EMPTY = new WorldUnloadResult(false, Component.text("Unable to load world with players!"));
|
|
+ public static final WorldUnloadResult PENDING_LOGIN = new WorldUnloadResult(false, Component.text("Unable to load world with pending login!"));
|
|
+ public static final WorldUnloadResult PLUGIN = new WorldUnloadResult(false, Component.text("World unload cancelled by plugin"));
|
|
+ public static final WorldUnloadResult NULL = new WorldUnloadResult(false, Component.text("Cannot unload null world"));
|
|
+
|
|
+}
|