Skip to content

Commit

Permalink
Fix Jade Protocol (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jul 22, 2024
1 parent 6ed6771 commit 2ac9175
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions patches/server/0038-Jade-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
+
Expand Down Expand Up @@ -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");
+ }
+ }
Expand Down

0 comments on commit 2ac9175

Please sign in to comment.