aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0009-MC-Utils.patch
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-10-25 17:08:48 +0200
committerBjarne Koll <[email protected]>2024-10-25 17:20:41 +0200
commitbb124f40217e336a6a1575a9b4334762cd796553 (patch)
tree29570f8489e9272bff01c0c636ad8aa347da6d3b /patches/server/0009-MC-Utils.patch
parent918ca965d919fc3ed4d11e09317b1dd91be774ff (diff)
downloadPaper-bb124f40217e336a6a1575a9b4334762cd796553.tar.gz
Paper-bb124f40217e336a6a1575a9b4334762cd796553.zip
Compiler issues v4
Diffstat (limited to 'patches/server/0009-MC-Utils.patch')
-rw-r--r--patches/server/0009-MC-Utils.patch18
1 files changed, 16 insertions, 2 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch
index 1adc5ed577..310d5c2f29 100644
--- a/patches/server/0009-MC-Utils.patch
+++ b/patches/server/0009-MC-Utils.patch
@@ -4077,10 +4077,10 @@ index 0000000000000000000000000000000000000000..197224e31175252d8438a8df585bbb65
+}
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
new file mode 100644
-index 0000000000000000000000000000000000000000..0449d4619e3a0752dea0981fb149542e23076c52
+index 0000000000000000000000000000000000000000..422bc104e5bdd4ae786b14d97eb779dc76bfad69
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
-@@ -0,0 +1,176 @@
+@@ -0,0 +1,190 @@
+package io.papermc.paper.util;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
@@ -4098,11 +4098,14 @@ index 0000000000000000000000000000000000000000..0449d4619e3a0752dea0981fb149542e
+import java.util.function.Supplier;
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.Vec3i;
++import net.minecraft.resources.ResourceKey;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.world.level.ChunkPos;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.phys.Vec3;
+import org.bukkit.Location;
++import org.bukkit.NamespacedKey;
++import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.craftbukkit.util.Waitable;
+
+public final class MCUtil {
@@ -4256,6 +4259,17 @@ index 0000000000000000000000000000000000000000..0449d4619e3a0752dea0981fb149542e
+ public static void scheduleAsyncTask(Runnable run) {
+ asyncExecutor.execute(run);
+ }
++
++ public static <T> ResourceKey<T> toResourceKey(
++ final ResourceKey<? extends net.minecraft.core.Registry<T>> registry,
++ final NamespacedKey namespacedKey
++ ) {
++ return ResourceKey.create(registry, CraftNamespacedKey.toMinecraft(namespacedKey));
++ }
++
++ public static NamespacedKey fromResourceKey(final ResourceKey<?> key) {
++ return CraftNamespacedKey.fromMinecraft(key.location());
++ }
+}
diff --git a/src/main/java/io/papermc/paper/util/StackWalkerUtil.java b/src/main/java/io/papermc/paper/util/StackWalkerUtil.java
new file mode 100644