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