28
28
import net .neoforged .neoforge .registries .DeferredHolder ;
29
29
import net .neoforged .neoforge .registries .DeferredItem ;
30
30
import net .neoforged .neoforge .registries .DeferredRegister ;
31
+ import org .polaris2023 .wild_wind .common .init .items .ModBaseItems ;
32
+ import org .polaris2023 .wild_wind .common .init .items .entity .ModMobBuckets ;
33
+ import org .polaris2023 .wild_wind .common .init .items .entity .ModSpawnEggs ;
34
+ import org .polaris2023 .wild_wind .common .init .items .foods .ModBaseFoods ;
31
35
32
36
import java .util .Collection ;
33
37
import java .util .List ;
@@ -81,7 +85,7 @@ public static void init(IEventBus bus) {
81
85
init (bus , ModBlocks .class , BLOCKS );
82
86
init (bus , ModEffects .class , EFFECTS );
83
87
init (bus , ModPotions .class , POTIONS );
84
- init (bus , ModItems .class , ITEMS );
88
+ init (bus , new Class []{ ModItems .class , ModBaseItems . class , ModBaseFoods . class , ModSpawnEggs . class , ModMobBuckets . class , ModMobBuckets . class } , ITEMS );
85
89
init (bus , ModRecipes .class , RECIPES );
86
90
init (bus , ModRecipeSerializes .class , RECIPES_SERIALIZERS );
87
91
init (bus , ModCreativeTabs .class , TABS );
@@ -99,6 +103,17 @@ public static void init(IEventBus bus, Class<?> clazz, DeferredRegister<?>... re
99
103
}
100
104
}
101
105
106
+ public static void init (IEventBus bus , Class <?>[] classes , DeferredRegister <?>... registers ) {
107
+ try {
108
+ for (Class <?> clazz : classes ) {
109
+ Class .forName (clazz .getName ());
110
+ }
111
+ } catch (ClassNotFoundException ignored ) {}
112
+ for (DeferredRegister <?> register : registers ) {
113
+ register .register (bus );
114
+ }
115
+ }
116
+
102
117
static <E extends Entity > DeferredHolder <EntityType <?>, EntityType <E >> register (String name , EntityType .EntityFactory <E > factory , MobCategory category ) {
103
118
return ENTITIES .register (name , resourceLocation -> EntityType .Builder .of (factory , category ).build (name ));
104
119
}
0 commit comments