diff options
author | xX_MinecraftGamer123_Xx <73876072+Maximusbarcz@users.noreply.github.com> | 2022-09-28 21:53:41 +0200 |
---|---|---|
committer | xX_MinecraftGamer123_Xx <73876072+Maximusbarcz@users.noreply.github.com> | 2022-09-28 21:53:41 +0200 |
commit | caae62f9978b4c40e8cabcb45a76a8b92b6b2615 (patch) | |
tree | 1c123804f474fcfc440d3392a500759fc1cbede3 /src | |
download | ygasi-caae62f9978b4c40e8cabcb45a76a8b92b6b2615.tar.gz ygasi-caae62f9978b4c40e8cabcb45a76a8b92b6b2615.tar.bz2 ygasi-caae62f9978b4c40e8cabcb45a76a8b92b6b2615.zip |
Initial commit
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/fabricmc/example/ExampleMod.java | 21 | ||||
-rw-r--r-- | src/main/java/net/fabricmc/example/mixin/ExampleMixin.java | 16 | ||||
-rw-r--r-- | src/main/resources/assets/modid/icon.png | bin | 0 -> 453 bytes | |||
-rw-r--r-- | src/main/resources/fabric.mod.json | 38 | ||||
-rw-r--r-- | src/main/resources/modid.mixins.json | 14 |
5 files changed, 89 insertions, 0 deletions
diff --git a/src/main/java/net/fabricmc/example/ExampleMod.java b/src/main/java/net/fabricmc/example/ExampleMod.java new file mode 100644 index 0000000..a964189 --- /dev/null +++ b/src/main/java/net/fabricmc/example/ExampleMod.java @@ -0,0 +1,21 @@ +package net.fabricmc.example; + +import net.fabricmc.api.ModInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ExampleMod implements ModInitializer { + // This logger is used to write text to the console and the log file. + // It is considered best practice to use your mod id as the logger's name. + // That way, it's clear which mod wrote info, warnings, and errors. + public static final Logger LOGGER = LoggerFactory.getLogger("modid"); + + @Override + public void onInitialize() { + // This code runs as soon as Minecraft is in a mod-load-ready state. + // However, some things (like resources) may still be uninitialized. + // Proceed with mild caution. + + LOGGER.info("Hello Fabric world!"); + } +} diff --git a/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java b/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java new file mode 100644 index 0000000..356cb38 --- /dev/null +++ b/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java @@ -0,0 +1,16 @@ +package net.fabricmc.example.mixin; + +import net.fabricmc.example.ExampleMod; +import net.minecraft.client.gui.screen.TitleScreen; +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(TitleScreen.class) +public class ExampleMixin { + @Inject(at = @At("HEAD"), method = "init()V") + private void init(CallbackInfo info) { + ExampleMod.LOGGER.info("This line is printed by an example mod mixin!"); + } +} diff --git a/src/main/resources/assets/modid/icon.png b/src/main/resources/assets/modid/icon.png Binary files differnew file mode 100644 index 0000000..047b91f --- /dev/null +++ b/src/main/resources/assets/modid/icon.png diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..3428658 --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,38 @@ +{ + "schemaVersion": 1, + "id": "modid", + "version": "${version}", + + "name": "Example Mod", + "description": "This is an example description! Tell everyone what your mod is about!", + "authors": [ + "Me!" + ], + "contact": { + "homepage": "https://fabricmc.net/", + "sources": "https://github.com/FabricMC/fabric-example-mod" + }, + + "license": "CC0-1.0", + "icon": "assets/modid/icon.png", + + "environment": "*", + "entrypoints": { + "main": [ + "net.fabricmc.example.ExampleMod" + ] + }, + "mixins": [ + "modid.mixins.json" + ], + + "depends": { + "fabricloader": ">=0.14.9", + "fabric-api": "*", + "minecraft": "~1.19", + "java": ">=17" + }, + "suggests": { + "another-mod": "*" + } +} diff --git a/src/main/resources/modid.mixins.json b/src/main/resources/modid.mixins.json new file mode 100644 index 0000000..7c42cb4 --- /dev/null +++ b/src/main/resources/modid.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "net.fabricmc.example.mixin", + "compatibilityLevel": "JAVA_17", + "mixins": [ + ], + "client": [ + "ExampleMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} |