From 74d41fbb513b1042b0bf931a57088c5ed06e2b1e Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Tue, 5 Dec 2023 00:20:21 +0900 Subject: [PATCH] Fix test --- .../server/0006-Plazma-Configurations.patch | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/patches/server/0006-Plazma-Configurations.patch b/patches/server/0006-Plazma-Configurations.patch index f12b9a594..4e5cfbaf9 100644 --- a/patches/server/0006-Plazma-Configurations.patch +++ b/patches/server/0006-Plazma-Configurations.patch @@ -259,7 +259,7 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..da05e8a339857daa96b062ee64d79655 + */ // Plazma } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b4d5bca6e3a39186a988098fb5d4cae97a776e79..8e5492bbdddb199bee021d79769ed2ee051128cf 100644 +index b4d5bca6e3a39186a988098fb5d4cae97a776e79..389322d3ca9b1f3789271936a7e6c60bd7c27893 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -301,6 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop new io.papermc.paper.util.EmptyTag()); + // paper end - testing additions + ++ // Plazma start - Fix tests ++ net.minecraft.server.MinecraftServer handle = mock(withSettings().stubOnly()); ++ when(handle.random()).thenReturn(net.minecraft.util.RandomSource.create()); ++ when(handle.getFixerUpper()).thenReturn(net.minecraft.util.datafix.DataFixers.getDataFixer()); ++ MinecraftServer.setServer(handle); ++ // Plazma end ++ + Bukkit.setServer(instance); + } catch (Throwable t) { + throw new Error(t); diff --git a/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java new file mode 100644 index 0000000000000000000000000000000000000000..c63942e2dc00ed6d6b4119f418bdaa5a64b4c0fe