mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-15 00:14:28 -04:00
fix: ClassCastException in fabric-loot-api-v2 (23w14a) (#2999)
* fix: ClassCastException in fabric-loot-api-v2 * change: Add skipped entries into new table * add: Simple test case
This commit is contained in:
parent
158c189089
commit
965d93c168
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
|
@ -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.
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:reference",
|
||||
"name": "minecraft:match_tool_shears"
|
||||
},
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"condition": "minecraft:match_tool",
|
||||
"predicate": {
|
||||
"items": [
|
||||
"minecraft:shears"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue