File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/main/java/com/example/examplemod Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11package com .example .examplemod ;
22
3- import net .minecraft .resources .ResourceLocation ;
3+ import net .minecraft .resources .Identifier ;
44import net .minecraft .world .item .Item ;
55import net .minecraftforge .common .ForgeConfigSpec ;
66import net .minecraftforge .eventbus .api .listener .SubscribeEvent ;
@@ -43,7 +43,7 @@ public class Config {
4343 public static Set <Item > items ;
4444
4545 private static boolean validateItemName (final Object obj ) {
46- return obj instanceof final String itemName && ForgeRegistries .ITEMS .containsKey (ResourceLocation .tryParse (itemName ));
46+ return obj instanceof final String itemName && ForgeRegistries .ITEMS .containsKey (Identifier .tryParse (itemName ));
4747 }
4848
4949 @ SubscribeEvent
@@ -54,7 +54,7 @@ static void onLoad(final ModConfigEvent event) {
5454
5555 // convert the list of strings into a set of items
5656 items = ITEM_STRINGS .get ().stream ()
57- .map (itemName -> ForgeRegistries .ITEMS .getValue (ResourceLocation .tryParse (itemName )))
57+ .map (itemName -> ForgeRegistries .ITEMS .getValue (Identifier .tryParse (itemName )))
5858 .collect (Collectors .toSet ());
5959 }
6060}
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public ExampleMod(FMLJavaModLoadingContext context) {
8787 CREATIVE_MODE_TABS .register (modBusGroup );
8888
8989 // Register the item to a creative tab
90- BuildCreativeModeTabContentsEvent .getBus ( modBusGroup ) .addListener (ExampleMod ::addCreative );
90+ BuildCreativeModeTabContentsEvent .BUS .addListener (ExampleMod ::addCreative );
9191
9292 // Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
9393 context .registerConfig (ModConfig .Type .COMMON , Config .SPEC );
You can’t perform that action at this time.
0 commit comments