From 2ac91754c394bc919fbe83e902d2f42697234bf2 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:10:49 +0800 Subject: [PATCH] Fix Jade Protocol (#264) --- patches/server/0038-Jade-Protocol.patch | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/patches/server/0038-Jade-Protocol.patch b/patches/server/0038-Jade-Protocol.patch index cda051a9..6e7816f0 100644 --- a/patches/server/0038-Jade-Protocol.patch +++ b/patches/server/0038-Jade-Protocol.patch @@ -124,10 +124,10 @@ index 30d0133a42ce990352f5c492fcf9beb105364848..1ab2eab686b3a89d406f127a6036c0e2 protected CompositeLootItemCondition(List terms, Predicate predicate) { diff --git a/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..0f40d3b95de7cefbf1318109cb45d13732f25534 +index 0000000000000000000000000000000000000000..f82b3adedee90c8d2de0f0588a61bfb813d16d0d --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java -@@ -0,0 +1,397 @@ +@@ -0,0 +1,398 @@ +package org.leavesmc.leaves.protocol.jade; + +import io.netty.buffer.ByteBuf; @@ -225,7 +225,7 @@ index 0000000000000000000000000000000000000000..0f40d3b95de7cefbf1318109cb45d137 +public class JadeProtocol { + + public static PriorityStore priorities; -+ private static List shearableBlocks = List.of(); ++ private static List shearableBlocks = null; + + public static final String PROTOCOL_ID = "jade"; + @@ -308,9 +308,10 @@ index 0000000000000000000000000000000000000000..0f40d3b95de7cefbf1318109cb45d137 + + try { + shearableBlocks = Collections.unmodifiableList(LootTableMineableCollector.execute( -+ MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.LOOT_TABLE), -+ Items.SHEARS.getDefaultInstance())); ++ MinecraftServer.getServer().reloadableRegistries().get().registryOrThrow(Registries.LOOT_TABLE), ++ Items.SHEARS.getDefaultInstance())); + } catch (Throwable ignore) { ++ shearableBlocks = List.of(); + LeavesLogger.LOGGER.severe("Failed to collect shearable blocks"); + } + }