first
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
plugins {
|
||||
`multiloader-loader`
|
||||
id("org.quiltmc.loom.remap")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:${commonMod.minecraft_version}")
|
||||
mappings(loom.layered {
|
||||
officialMojangMappings()
|
||||
commonMod.propOrNull("parchment")?.let { parchmentVersion ->
|
||||
if (parchmentVersion != "") parchment("org.parchmentmc.data:parchment-${commonMod.minecraft_version}:$parchmentVersion@zip")
|
||||
}
|
||||
})
|
||||
|
||||
modImplementation("org.quiltmc:quilt-loader:${commonMod.prop("quilt_loader_version")}")
|
||||
modApi("org.quiltmc:qsl:${commonMod.prop("qsl_version")}")
|
||||
commonMod.propOrNull("quilted_fabric_api_version")?.let {
|
||||
modApi("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${it}")
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath =
|
||||
common.project.file("../../src/main/resources/accesswideners/${commonMod.minecraft_version}-${mod.id}.accesswidener")
|
||||
|
||||
runs {
|
||||
getByName("client") {
|
||||
client()
|
||||
configName = "Quilt Client"
|
||||
ideConfigGenerated(true)
|
||||
}
|
||||
getByName("server") {
|
||||
server()
|
||||
configName = "Quilt Server"
|
||||
ideConfigGenerated(true)
|
||||
}
|
||||
}
|
||||
|
||||
mods {
|
||||
// This should match your mod id.
|
||||
create(mod.id) {
|
||||
// Tell Loom about each source set used by your mod here. This ensures that your mod's classes are properly transformed by Loader.
|
||||
sourceSet("main")
|
||||
// If you shade (directly include classes, not JiJ) a dependency into your mod, include it here using one of these methods:
|
||||
// dependency("com.example.shadowedmod:1.2.3")
|
||||
// configuration("exampleShadedConfigurationName")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named<ProcessResources>("processResources") {
|
||||
val awFile = project(":common").file("src/main/resources/accesswideners/${commonMod.minecraft_version}-${mod.id}.accesswidener")
|
||||
|
||||
from(awFile.parentFile) {
|
||||
include(awFile.name)
|
||||
rename(awFile.name, "${mod.id}.accesswidener")
|
||||
into("")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
loader=quiltmc
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.example.examplemod;
|
||||
|
||||
import org.quiltmc.loader.api.ModContainer;
|
||||
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
|
||||
|
||||
public class ExampleMod implements ModInitializer
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onInitialize(ModContainer mod) {
|
||||
|
||||
// This method is invoked by the Quilt mod loader when it is ready
|
||||
// to load your mod. You can access Quilt and Common code in this
|
||||
// project.
|
||||
|
||||
// Use Quilt to bootstrap the Common mod.
|
||||
Constants.LOG.info("Hello Quilt world!");
|
||||
CommonClass.init();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.example.examplemod.mixin;
|
||||
|
||||
import com.example.examplemod.Constants;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
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(TitleScreen.class)
|
||||
public class MixinTitleScreen
|
||||
{
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "init()V")
|
||||
private void init(CallbackInfo info) {
|
||||
|
||||
Constants.LOG.info("This line is printed by an example mod mixin from Quilt!");
|
||||
Constants.LOG.info("MC Version: {}", Minecraft.getInstance().getVersionType());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.example.examplemod.platform;
|
||||
|
||||
import com.example.examplemod.platform.services.IPlatformHelper;
|
||||
import org.quiltmc.loader.api.QuiltLoader;
|
||||
|
||||
public class QuiltPlatformHelper implements IPlatformHelper
|
||||
{
|
||||
|
||||
@Override
|
||||
public String getPlatformName() {
|
||||
return "QuiltMC";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModLoaded(String modId) {
|
||||
|
||||
return QuiltLoader.isModLoaded(modId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDevelopmentEnvironment() {
|
||||
|
||||
return QuiltLoader.isDevelopmentEnvironment();
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
com.example.examplemod.platform.QuiltPlatformHelper
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "com.example.examplemod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [],
|
||||
"client": [
|
||||
"MixinTitleScreen"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"quilt_loader": {
|
||||
"group": "${group}",
|
||||
"id": "${mod_id}",
|
||||
"version": "${version}",
|
||||
"metadata": {
|
||||
"name": "${mod_name}",
|
||||
"description": "${description}",
|
||||
"contributors": {
|
||||
"${mod_author}": "Owner"
|
||||
},
|
||||
"contact": {
|
||||
"homepage": "https://example.com/",
|
||||
"issues": "https://github.com/QuiltMC/quilt-template-mod/issues",
|
||||
"sources": "https://github.com/QuiltMC/quilt-template-mod"
|
||||
},
|
||||
"icon": "${mod_id}.png",
|
||||
"license": "${license}"
|
||||
},
|
||||
"intermediate_mappings": "net.fabricmc:intermediary",
|
||||
"entrypoints": {
|
||||
"init": "com.example.examplemod.ExampleMod"
|
||||
},
|
||||
"depends": [
|
||||
{
|
||||
"id": "quilt_loader",
|
||||
"versions": ">=${quilt_loader_version}"
|
||||
},
|
||||
{
|
||||
"id": "quilted_fabric_api",
|
||||
"versions": "*"
|
||||
},
|
||||
{
|
||||
"id": "minecraft",
|
||||
"versions": "~${minecraft_version}"
|
||||
},
|
||||
{
|
||||
"id": "java",
|
||||
"versions": ">=${java_version}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"mixin": [
|
||||
"${mod_id}.mixins.json",
|
||||
"${mod_id}.quiltmc.mixins.json"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user