fix: ClassCastException in fabric-loot-api-v2 (23w14a) ()

* fix: ClassCastException in fabric-loot-api-v2

* change: Add skipped entries into new table

* add: Simple test case
This commit is contained in:
Drex 2023-04-06 15:59:00 +02:00 committed by GitHub
parent 158c189089
commit 965d93c168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions
fabric-loot-api-v2/src
main/java/net/fabricmc/fabric/mixin/loot
testmod/resources/data/minecraft
loot_tables/blocks
predicates

View file

@ -69,7 +69,11 @@ abstract class LootManagerMixin {
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.

View file

@ -10,6 +10,10 @@
}
],
"conditions": [
{
"condition": "minecraft:reference",
"name": "minecraft:match_tool_shears"
},
{
"condition": "minecraft:survives_explosion"
}

View file

@ -0,0 +1,8 @@
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
}