Skip to content

Commit

Permalink
fix: ClassCastException in fabric-loot-api-v2 (23w14a) (#2999)
Browse files Browse the repository at this point in the history
* fix: ClassCastException in fabric-loot-api-v2

* change: Add skipped entries into new table

* add: Simple test case
  • Loading branch information
DrexHD authored Apr 6, 2023
1 parent 158c189 commit 965d93c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ private void applyLootTableEvents(ResourceManager resourceManager, LootManager l
return;
}

LootTable table = (LootTable) entry;
if (!(entry instanceof LootTable table)) {
// We only want to modify loot tables
newTables.put(id, entry);
return;
}

LootTableSource source = LootUtil.determineSource(id.location(), resourceManager);
// Invoke the REPLACE event for the current loot table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
}
],
"conditions": [
{
"condition": "minecraft:reference",
"name": "minecraft:match_tool_shears"
},
{
"condition": "minecraft:survives_explosion"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
}

0 comments on commit 965d93c

Please sign in to comment.