Add a common class

This commit is contained in:
Jared 2021-09-29 19:19:00 +02:00
parent 604dc8aa1b
commit 4d610131ca
No known key found for this signature in database
GPG Key ID: DB3BA3B9088A1BDF
6 changed files with 20 additions and 4 deletions

View File

@ -0,0 +1,14 @@
package com.example.examplemod;
import net.minecraft.core.Registry;
import net.minecraft.world.item.Items;
public class CommonClass {
public static void init() {
System.out.println("Hello from Common init!");
System.out.println("Diamond Item >> " + Registry.ITEM.getKey(Items.DIAMOND));
}
}

View File

@ -1,4 +1,4 @@
package net.fabricmc.example; package com.example.examplemod;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
@ -11,6 +11,7 @@ public class ExampleMod implements ModInitializer {
// Proceed with mild caution. // Proceed with mild caution.
System.out.println("Hello Fabric world!"); System.out.println("Hello Fabric world!");
CommonClass.init();
} }
} }

View File

@ -1,4 +1,4 @@
package net.fabricmc.example.mixin; package com.example.examplemod.mixin;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen; import net.minecraft.client.gui.screens.TitleScreen;

View File

@ -19,7 +19,7 @@
"environment": "*", "environment": "*",
"entrypoints": { "entrypoints": {
"main": [ "main": [
"net.fabricmc.example.ExampleMod" "com.example.examplemod.ExampleMod"
] ]
}, },
"mixins": [ "mixins": [

View File

@ -1,7 +1,7 @@
{ {
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "net.fabricmc.example.mixin", "package": "com.example.examplemod.mixin",
"compatibilityLevel": "JAVA_16", "compatibilityLevel": "JAVA_16",
"mixins": [ "mixins": [
], ],

View File

@ -31,6 +31,7 @@ public class ExampleMod {
LOGGER.info("HELLO FROM PREINIT"); LOGGER.info("HELLO FROM PREINIT");
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName()); LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
CommonClass.init();
} }
private void enqueueIMC(final InterModEnqueueEvent event) { private void enqueueIMC(final InterModEnqueueEvent event) {