Skip to content

Commit

Permalink
Fix some components
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulu13022002 committed Nov 21, 2024
1 parent 55475f0 commit 9b85c3b
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 116 deletions.
9 changes: 2 additions & 7 deletions patches/server/0009-MC-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4691,10 +4691,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..e85e544506b4c762503a1cb490e6c0f5b1d563f4
index 0000000000000000000000000000000000000000..da6e73e78616ade91c5b3356256ef617dfb9c1d5
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -0,0 +1,220 @@
@@ -0,0 +1,215 @@
+package io.papermc.paper.util;
+
+import com.google.common.collect.Collections2;
Expand Down Expand Up @@ -4896,11 +4896,6 @@ index 0000000000000000000000000000000000000000..e85e544506b4c762503a1cb490e6c0f5
+ return CraftNamespacedKey.fromMinecraft(key.location());
+ }
+
+ public static Holder<SoundEvent> keyToSound(Key key) {
+ ResourceLocation soundId = PaperAdventure.asVanilla(key);
+ return BuiltInRegistries.SOUND_EVENT.wrapAsHolder(BuiltInRegistries.SOUND_EVENT.getOptional(soundId).orElse(SoundEvent.createVariableRangeEvent(soundId)));
+ }
+
+ public static <A, M> List<A> transformUnmodifiable(final List<? extends M> nms, final Function<? super M, ? extends A> converter) {
+ return Collections.unmodifiableList(Lists.transform(nms, converter::apply));
+ }
Expand Down
Loading

0 comments on commit 9b85c3b

Please sign in to comment.