Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ public MerchantOffer getOffer(Entity entity, RandomSource random) {
private static boolean isChestLootTable(net.minecraft.resources.ResourceLocation location) {
if (location == null) return false;
String path = location.getPath().toLowerCase(java.util.Locale.ROOT);
return path.startsWith("chests/") || path.contains("/chests/") || path.endsWith("_chest") || path.contains("chest");
// Block drop tables (blocks/chest, blocks/trapped_chest, ...) must never match
if (path.startsWith("blocks/")) return false;
// But accept chest loot tables (chests/simple_dungeon, chests/village/village_weaponsmith, mymod:structures/chests/ruins, ...)
return path.startsWith("chests/") || path.contains("/chests/");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ public void onAddReloadListeners(AddReloadListenerEvent event) {
private static boolean isChestLootTable(ResourceLocation location) {
if (location == null) return false;
String path = location.getPath().toLowerCase(java.util.Locale.ROOT);
return path.startsWith("chests/") || path.contains("/chests/") || path.endsWith("_chest") || path.contains("chest");
// Block drop tables (blocks/chest, blocks/trapped_chest, ...) must never match
if (path.startsWith("blocks/")) return false;
// But accept chest loot tables (chests/simple_dungeon, chests/village/village_weaponsmith, mymod:structures/chests/ruins, ...)
return path.startsWith("chests/") || path.contains("/chests/");
}
}