File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
java/com/almostreliable/lootjs Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 11package com .almostreliable .lootjs .core .entry ;
22
33import com .almostreliable .lootjs .core .filters .ItemFilter ;
4+ import com .almostreliable .lootjs .mixin .SetComponentsFunctionAccessor ;
45import com .almostreliable .lootjs .util .DebugInfo ;
56import com .almostreliable .lootjs .util .Utils ;
67import net .minecraft .core .component .DataComponentPatch ;
1516import net .minecraft .world .level .storage .loot .entries .LootPoolEntryType ;
1617import net .minecraft .world .level .storage .loot .entries .LootPoolSingletonContainer ;
1718import net .minecraft .world .level .storage .loot .functions .LootItemFunction ;
18- import net .minecraft .world .level .storage .loot .functions .SetComponentsFunction ;
1919import net .minecraft .world .level .storage .loot .predicates .LootItemCondition ;
2020import net .minecraft .world .level .storage .loot .providers .number .ConstantValue ;
2121import net .minecraft .world .level .storage .loot .providers .number .NumberProvider ;
@@ -46,7 +46,8 @@ public ItemLootEntry(ItemStack itemStack) {
4646 builder .set (Utils .cast (component .type ()), component .value ());
4747 }
4848
49- getFunctions ().addFunction (new SetComponentsFunction (new ArrayList <>(), builder .build ()));
49+ var function = SetComponentsFunctionAccessor .lootjs$create (new ArrayList <>(), builder .build ());
50+ getFunctions ().addFunction (function );
5051 }
5152 }
5253
Original file line number Diff line number Diff line change 1+ package com .almostreliable .lootjs .mixin ;
2+
3+ import net .minecraft .core .component .DataComponentPatch ;
4+ import net .minecraft .world .level .storage .loot .functions .SetComponentsFunction ;
5+ import net .minecraft .world .level .storage .loot .predicates .LootItemCondition ;
6+ import org .spongepowered .asm .mixin .Mixin ;
7+ import org .spongepowered .asm .mixin .gen .Invoker ;
8+ import org .spongepowered .asm .mixin .throwables .MixinException ;
9+
10+ import java .util .List ;
11+
12+ @ Mixin (SetComponentsFunction .class )
13+ public interface SetComponentsFunctionAccessor {
14+
15+ @ Invoker ("<init>" )
16+ static SetComponentsFunction lootjs$create (List <LootItemCondition > condition , DataComponentPatch components ) {
17+ throw new MixinException ("Invoker not found" );
18+ }
19+ }
Original file line number Diff line number Diff line change 1717 " LootPoolMixin" ,
1818 " LootTableMixin" ,
1919 " ReloadableServerRegistriesMixin" ,
20+ " SetComponentsFunctionAccessor" ,
2021 " SkeletonMixin" ,
2122 " WitherBossMixin" ,
2223 " ZombieMixin" ,
You can’t perform that action at this time.
0 commit comments