CobbleSync Template Code

This commit is contained in:
2025-05-06 15:06:07 -04:00
commit 568907dc16
19 changed files with 851 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package co.sirblob.mixin.client;
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 ExampleClientMixin {
@Inject(at = @At("HEAD"), method = "run")
private void init(CallbackInfo info) {
// This code is injected into the start of MinecraftClient.run()V
}
}

View File

@@ -0,0 +1,9 @@
package co.sirblob
import net.fabricmc.api.ClientModInitializer
object CobbleSyncClient : ClientModInitializer {
override fun onInitializeClient() {
// This entrypoint is suitable for setting up client-specific logic, such as rendering.
}
}

View File

@@ -0,0 +1,11 @@
{
"required": true,
"package": "co.sirblob.mixin.client",
"compatibilityLevel": "JAVA_21",
"client": [
"ExampleClientMixin"
],
"injectors": {
"defaultRequire": 1
}
}

View File

@@ -0,0 +1,15 @@
package co.sirblob.mixin;
import net.minecraft.server.MinecraftServer;
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(MinecraftServer.class)
public class ExampleMixin {
@Inject(at = @At("HEAD"), method = "loadWorld")
private void init(CallbackInfo info) {
// This code is injected into the start of MinecraftServer.loadWorld()V
}
}

View File

@@ -0,0 +1,17 @@
package co.sirblob
import net.fabricmc.api.ModInitializer
import org.slf4j.LoggerFactory
import com.cobblemon.mod.common.api.*
object CobbleSync : ModInitializer {
private val logger = LoggerFactory.getLogger("cobblesync")
override fun 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!")
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,11 @@
{
"required": true,
"package": "co.sirblob.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"ExampleMixin"
],
"injectors": {
"defaultRequire": 1
}
}

View File

@@ -0,0 +1,48 @@
{
"schemaVersion": 1,
"id": "cobblesync",
"version": "${version}",
"name": "CobbleSync",
"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/cobblesync/icon.png",
"environment": "*",
"entrypoints": {
"main": [
{
"value": "co.sirblob.CobbleSync",
"adapter": "kotlin"
}
],
"client": [
{
"value": "co.sirblob.CobbleSyncClient",
"adapter": "kotlin"
}
]
},
"mixins": [
"cobblesync.mixins.json",
{
"config": "cobblesync.client.mixins.json",
"environment": "client"
}
],
"depends": {
"fabricloader": ">=0.16.14",
"minecraft": "~1.21.1",
"java": ">=21",
"fabric-api": "*",
"fabric-language-kotlin": "*"
},
"suggests": {
"another-mod": "*"
}
}