9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00

Fix Jade Protocol (#264)

This commit is contained in:
violetc
2024-07-22 14:10:49 +08:00
parent 6ed67711ba
commit 2ac91754c3

View File

@@ -124,10 +124,10 @@ index 30d0133a42ce990352f5c492fcf9beb105364848..1ab2eab686b3a89d406f127a6036c0e2
protected CompositeLootItemCondition(List<LootItemCondition> terms, Predicate<LootContext> 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<ResourceLocation, IJadeProvider> priorities;
+ private static List<Block> shearableBlocks = List.of();
+ private static List<Block> 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");
+ }
+ }