Add a common class
This commit is contained in:
parent
604dc8aa1b
commit
4d610131ca
14
Common/src/main/java/com/example/examplemod/CommonClass.java
Normal file
14
Common/src/main/java/com/example/examplemod/CommonClass.java
Normal 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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.fabricmc.example;
|
||||
package com.example.examplemod;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
|
|
@ -11,6 +11,7 @@ public class ExampleMod implements ModInitializer {
|
|||
// Proceed with mild caution.
|
||||
|
||||
System.out.println("Hello Fabric world!");
|
||||
CommonClass.init();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.fabricmc.example.mixin;
|
||||
package com.example.examplemod.mixin;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"net.fabricmc.example.ExampleMod"
|
||||
"com.example.examplemod.ExampleMod"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "net.fabricmc.example.mixin",
|
||||
"package": "com.example.examplemod.mixin",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"mixins": [
|
||||
],
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public class ExampleMod {
|
|||
|
||||
LOGGER.info("HELLO FROM PREINIT");
|
||||
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
|
||||
CommonClass.init();
|
||||
}
|
||||
|
||||
private void enqueueIMC(final InterModEnqueueEvent event) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user