Skip to content

Commit 514e490

Browse files
Update MDK with new output from mod generator (#4)
* Update MDK with new output from mod generator * Update MDK with new output from mod generator * Update MDK with new output from mod generator --------- Co-authored-by: NeoForge MDK Automation <173375039+neoforge-mdk-automation[bot]@users.noreply.github.com>
1 parent 586e6ba commit 514e490

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'java-library'
33
id 'maven-publish'
4-
id 'net.neoforged.moddev' version '2.0.96'
4+
id 'net.neoforged.moddev' version '2.0.99'
55
id 'idea'
66
}
77

src/main/java/com/example/examplemod/ExampleMod.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import com.mojang.logging.LogUtils;
66

7-
import net.minecraft.client.Minecraft;
87
import net.minecraft.core.registries.BuiltInRegistries;
98
import net.minecraft.core.registries.Registries;
109
import net.minecraft.network.chat.Component;
@@ -20,10 +19,12 @@
2019
import net.neoforged.api.distmarker.Dist;
2120
import net.neoforged.bus.api.IEventBus;
2221
import net.neoforged.bus.api.SubscribeEvent;
23-
import net.neoforged.fml.ModLoadingContext;
2422
import net.neoforged.fml.common.Mod;
2523
import net.neoforged.fml.config.ModConfig;
24+
import net.neoforged.fml.ModLoadingContext;
25+
import net.neoforged.fml.common.Mod.EventBusSubscriber;
2626
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
27+
import net.minecraft.client.Minecraft;
2728
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
2829
import net.neoforged.neoforge.common.NeoForge;
2930
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
@@ -39,7 +40,7 @@ public class ExampleMod {
3940
// Define mod id in a common place for everything to reference
4041
public static final String MODID = "examplemod";
4142
// Directly reference a slf4j logger
42-
private static final Logger LOGGER = LogUtils.getLogger();
43+
public static final Logger LOGGER = LogUtils.getLogger();
4344
// Create a Deferred Register to hold Blocks which will all be registered under the "examplemod" namespace
4445
public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(MODID);
4546
// Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace
@@ -118,10 +119,10 @@ public void onServerStarting(ServerStartingEvent event) {
118119
}
119120

120121
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
121-
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
122-
public static class ClientModEvents {
122+
@EventBusSubscriber(modid = ExampleMod.MODID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
123+
static class ClientModEvents {
123124
@SubscribeEvent
124-
public static void onClientSetup(FMLClientSetupEvent event) {
125+
static void onClientSetup(FMLClientSetupEvent event) {
125126
// Some client setup code
126127
LOGGER.info("HELLO FROM CLIENT SETUP");
127128
LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName());

0 commit comments

Comments
 (0)