From 854eba2e998951ae30c45825e3cf3180ec77c2b7 Mon Sep 17 00:00:00 2001 From: falseresync Date: Wed, 3 Jul 2019 19:40:14 +0000 Subject: Initial commit --- src/main/java/net/fabricmc/example/ExampleMod.java | 14 ++++++++ .../net/fabricmc/example/mixin/ExampleMixin.java | 15 +++++++++ src/main/resources/assets/modid/icon.png | Bin 0 -> 453 bytes src/main/resources/fabric.mod.json | 36 +++++++++++++++++++++ src/main/resources/modid.mixins.json | 13 ++++++++ 5 files changed, 78 insertions(+) create mode 100644 src/main/java/net/fabricmc/example/ExampleMod.java create mode 100644 src/main/java/net/fabricmc/example/mixin/ExampleMixin.java create mode 100644 src/main/resources/assets/modid/icon.png create mode 100644 src/main/resources/fabric.mod.json create mode 100644 src/main/resources/modid.mixins.json (limited to 'src/main') 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..e5ed082 --- /dev/null +++ b/src/main/java/net/fabricmc/example/ExampleMod.java @@ -0,0 +1,14 @@ +package net.fabricmc.example; + +import net.fabricmc.api.ModInitializer; + +public class ExampleMod implements ModInitializer { + @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. + + System.out.println("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..0fc8f68 --- /dev/null +++ b/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java @@ -0,0 +1,15 @@ +package net.fabricmc.example.mixin; + +import net.minecraft.client.MinecraftClient; +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(MinecraftClient.class) +public class ExampleMixin { + @Inject(at = @At("HEAD"), method = "init()V") + private void init(CallbackInfo info) { + System.out.println("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 new file mode 100644 index 0000000..047b91f Binary files /dev/null and b/src/main/resources/assets/modid/icon.png differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..f37c644 --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,36 @@ +{ + "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.4.0", + "fabric": "*" + }, + "suggests": { + "flamingo": "*" + } +} diff --git a/src/main/resources/modid.mixins.json b/src/main/resources/modid.mixins.json new file mode 100644 index 0000000..e243f0a --- /dev/null +++ b/src/main/resources/modid.mixins.json @@ -0,0 +1,13 @@ +{ + "required": true, + "package": "net.fabricmc.example.mixin", + "compatibilityLevel": "JAVA_8", + "mixins": [ + ], + "client": [ + "ExampleMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} -- cgit