CobbleSync Template Code
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
9
src/client/kotlin/co/sirblob/CobbleSyncClient.kt
Normal file
9
src/client/kotlin/co/sirblob/CobbleSyncClient.kt
Normal 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.
|
||||
}
|
||||
}
|
||||
11
src/client/resources/cobblesync.client.mixins.json
Normal file
11
src/client/resources/cobblesync.client.mixins.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "co.sirblob.mixin.client",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"ExampleClientMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
15
src/main/java/co/sirblob/mixin/ExampleMixin.java
Normal file
15
src/main/java/co/sirblob/mixin/ExampleMixin.java
Normal 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
|
||||
}
|
||||
}
|
||||
17
src/main/kotlin/co/sirblob/CobbleSync.kt
Normal file
17
src/main/kotlin/co/sirblob/CobbleSync.kt
Normal 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!")
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/cobblesync/icon.png
Normal file
BIN
src/main/resources/assets/cobblesync/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
11
src/main/resources/cobblesync.mixins.json
Normal file
11
src/main/resources/cobblesync.mixins.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "co.sirblob.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"ExampleMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
48
src/main/resources/fabric.mod.json
Normal file
48
src/main/resources/fabric.mod.json
Normal 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": "*"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user