diff --git a/patches/server/CB-fixes.patch b/patches/server/CB-fixes.patch index c893d13410..e1517aec72 100644 --- a/patches/server/CB-fixes.patch +++ b/patches/server/CB-fixes.patch @@ -94,10 +94,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - return new CraftLootTable(key, registry.getLootTable(CraftNamespacedKey.toMinecraft(key))); + // Paper start - honor method contract + final ResourceLocation lootTableKey = CraftNamespacedKey.toMinecraft(key); -+ if (registry.getLootTable(lootTableKey) == net.minecraft.world.level.storage.loot.LootTable.EMPTY) { -+ return null; -+ } -+ return new CraftLootTable(key, registry.getLootTable(lootTableKey)); ++ final Optional table = registry.getElementOptional(net.minecraft.world.level.storage.loot.LootDataType.TABLE, lootTableKey); ++ return table.map(lootTable -> new CraftLootTable(key, lootTable)).orElse(null); + // Paper end }