3636
3737// The value here should match an entry in the META-INF/neoforge.mods.toml file
3838@ Mod (ExampleMod .MODID )
39- public class ExampleMod
40- {
39+ public class ExampleMod {
4140 // Define mod id in a common place for everything to reference
4241 public static final String MODID = "examplemod" ;
4342 // Directly reference a slf4j logger
@@ -69,8 +68,7 @@ public class ExampleMod
6968
7069 // The constructor for the mod class is the first code that is run when your mod is loaded.
7170 // FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically.
72- public ExampleMod (IEventBus modEventBus , ModContainer modContainer )
73- {
71+ public ExampleMod (IEventBus modEventBus , ModContainer modContainer ) {
7472 // Register the commonSetup method for modloading
7573 modEventBus .addListener (this ::commonSetup );
7674
@@ -93,41 +91,38 @@ public ExampleMod(IEventBus modEventBus, ModContainer modContainer)
9391 modContainer .registerConfig (ModConfig .Type .COMMON , Config .SPEC );
9492 }
9593
96- private void commonSetup (final FMLCommonSetupEvent event )
97- {
94+ private void commonSetup (FMLCommonSetupEvent event ) {
9895 // Some common setup code
9996 LOGGER .info ("HELLO FROM COMMON SETUP" );
10097
101- if (Config .LOG_DIRT_BLOCK .getAsBoolean ())
98+ if (Config .LOG_DIRT_BLOCK .getAsBoolean ()) {
10299 LOGGER .info ("DIRT BLOCK >> {}" , BuiltInRegistries .BLOCK .getKey (Blocks .DIRT ));
100+ }
103101
104102 LOGGER .info ("{}{}" , Config .MAGIC_NUMBER_INTRODUCTION .get (), Config .MAGIC_NUMBER .getAsInt ());
105103
106104 Config .ITEM_STRINGS .get ().forEach ((item ) -> LOGGER .info ("ITEM >> {}" , item ));
107105 }
108106
109107 // Add the example block item to the building blocks tab
110- private void addCreative (BuildCreativeModeTabContentsEvent event )
111- {
112- if (event .getTabKey () == CreativeModeTabs .BUILDING_BLOCKS )
108+ private void addCreative (BuildCreativeModeTabContentsEvent event ) {
109+ if (event .getTabKey () == CreativeModeTabs .BUILDING_BLOCKS ) {
113110 event .accept (EXAMPLE_BLOCK_ITEM );
111+ }
114112 }
115113
116114 // You can use SubscribeEvent and let the Event Bus discover methods to call
117115 @ SubscribeEvent
118- public void onServerStarting (ServerStartingEvent event )
119- {
116+ public void onServerStarting (ServerStartingEvent event ) {
120117 // Do something when the server starts
121118 LOGGER .info ("HELLO from server starting" );
122119 }
123120
124121 // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
125122 @ EventBusSubscriber (modid = MODID , bus = EventBusSubscriber .Bus .MOD , value = Dist .CLIENT )
126- public static class ClientModEvents
127- {
123+ public static class ClientModEvents {
128124 @ SubscribeEvent
129- public static void onClientSetup (FMLClientSetupEvent event )
130- {
125+ public static void onClientSetup (FMLClientSetupEvent event ) {
131126 // Some client setup code
132127 LOGGER .info ("HELLO FROM CLIENT SETUP" );
133128 LOGGER .info ("MINECRAFT NAME >> {}" , Minecraft .getInstance ().getUser ().getName ());
0 commit comments