diff options
author | Shane Freeder <[email protected]> | 2022-09-28 05:20:20 +0100 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2022-09-28 05:20:20 +0100 |
commit | b571694de8879926f24d891fc27c5fef4da3829e (patch) | |
tree | 1e8ac946969d7e9fb054bf58d4b303273e51bb3c | |
parent | 557d7c048bc4c1a6a56fc8d3fc55fae831cb7d01 (diff) | |
download | Paper-b571694de8879926f24d891fc27c5fef4da3829e.tar.gz Paper-b571694de8879926f24d891fc27c5fef4da3829e.zip |
fix annotations, convert to recordfeat/WorldUnloadResult
-rw-r--r-- | patches/api/0398-Add-WorldUnloadResult.patch | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/patches/api/0398-Add-WorldUnloadResult.patch b/patches/api/0398-Add-WorldUnloadResult.patch index 1ada5657c1..841e3a3f74 100644 --- a/patches/api/0398-Add-WorldUnloadResult.patch +++ b/patches/api/0398-Add-WorldUnloadResult.patch @@ -6,15 +6,17 @@ 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..5fb077e0ab5ad238763adb2a1d2a6cc95cf0f1e4 +index 0000000000000000000000000000000000000000..d8b190dfb44e3f4712f0b2e5677cb0b9893fe5ec --- /dev/null +++ b/src/main/java/io/papermc/paper/world/WorldUnloadResult.java -@@ -0,0 +1,30 @@ +@@ -0,0 +1,17 @@ +package io.papermc.paper.world; + +import net.kyori.adventure.text.Component; + -+public class WorldUnloadResult { ++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")); @@ -24,19 +26,4 @@ index 0000000000000000000000000000000000000000..5fb077e0ab5ad238763adb2a1d2a6cc9 + 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")); + -+ private final boolean success; -+ private final Component message; -+ -+ public WorldUnloadResult(boolean success, Component message) { -+ this.success = success; -+ this.message = message; -+ } -+ -+ public boolean isSuccess() { -+ return success; -+ } -+ -+ public Component message() { -+ return message; -+ } +} |