From cfcdcda458b2fe9fbe33bb81759dfd4e4fb3bcc0 Mon Sep 17 00:00:00 2001 From: inglettronald <71849533+inglettronald@users.noreply.github.com> Date: Fri, 23 Sep 2022 01:37:06 -0500 Subject: Initial commit --- src/main/java/com/example/ExampleMod.java | 13 +++++++++++++ src/main/java/com/example/mixin/MixinGuiMainMenu.java | 16 ++++++++++++++++ src/main/resources/mcmod.info | 18 ++++++++++++++++++ src/main/resources/mixins.examplemod.json | 11 +++++++++++ 4 files changed, 58 insertions(+) create mode 100644 src/main/java/com/example/ExampleMod.java create mode 100644 src/main/java/com/example/mixin/MixinGuiMainMenu.java create mode 100644 src/main/resources/mcmod.info create mode 100644 src/main/resources/mixins.examplemod.json (limited to 'src') diff --git a/src/main/java/com/example/ExampleMod.java b/src/main/java/com/example/ExampleMod.java new file mode 100644 index 0000000..0e6967a --- /dev/null +++ b/src/main/java/com/example/ExampleMod.java @@ -0,0 +1,13 @@ +package com.example; + +import net.minecraft.init.Blocks; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; + +@Mod(modid = "examplemod", version = "1.0.0") +public class ExampleMod { + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + System.out.println("Dirt: " + Blocks.dirt.getUnlocalizedName()); + } +} diff --git a/src/main/java/com/example/mixin/MixinGuiMainMenu.java b/src/main/java/com/example/mixin/MixinGuiMainMenu.java new file mode 100644 index 0000000..47eee87 --- /dev/null +++ b/src/main/java/com/example/mixin/MixinGuiMainMenu.java @@ -0,0 +1,16 @@ +package com.example.mixin; + +import net.minecraft.client.gui.GuiMainMenu; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(GuiMainMenu.class) +public class MixinGuiMainMenu { + + @Inject(method = "initGui", at = @At("HEAD")) + public void onInitGui(CallbackInfo ci) { + System.out.println("Hello from Main Menu!"); + } +} diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000..7b1a26b --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,18 @@ +[ + { + "modid": "examplemod", + "name": "Xample Mod", + "description": "A mod that is used as an example.", + "version": "1.0.0", + "mcversion": "1.8.9", + "url": "https://github.com/romangraef/Forge1.8.9Template/", + "updateUrl": "", + "authorList": [ + "You" + ], + "credits": "", + "logoFile": "", + "screenshots": [], + "dependencies": [] + } +] diff --git a/src/main/resources/mixins.examplemod.json b/src/main/resources/mixins.examplemod.json new file mode 100644 index 0000000..ee27201 --- /dev/null +++ b/src/main/resources/mixins.examplemod.json @@ -0,0 +1,11 @@ +{ + "package": "com.example.mixin", + "refmap": "mixins.examplemod.refmap.json", + "minVersion": "0.7", + "compatibilityLevel": "JAVA_8", + "mixins": [ + ], + "client": [ + "MixinGuiMainMenu" + ] +} -- cgit