Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.

Commit f06bb99

Browse files
committed
Updated example mod
1 parent b3dd9f2 commit f06bb99

File tree

14 files changed

+158
-222
lines changed

14 files changed

+158
-222
lines changed

build.gradle

Lines changed: 0 additions & 149 deletions
This file was deleted.

build.gradle.kts

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
import com.smushytaco.lwjgl_gradle.Module
2+
3+
plugins {
4+
// id 'fabric-loom' version '1.10-SNAPSHOT' // TODO Fork Fabric Loom for Quantum Voxel instead of Minecraft
5+
id("maven-publish")
6+
id("java")
7+
id("java-library")
8+
id("com.smushytaco.lwjgl3") version "1.0.0"
9+
}
10+
11+
version = property("mod_version").toString()
12+
group = property("maven_group").toString()
13+
14+
base {
15+
archivesName.set(property("archives_base_name").toString())
16+
}
17+
18+
lwjgl {
19+
version = "3.4.0-SNAPSHOT"
20+
usePredefinedPlatforms = true
21+
api(Module.OPENGL, Module.OPENAL, Module.STB)
22+
}
23+
24+
repositories {
25+
// Add repositories to retrieve artifacts from in here.
26+
// You should only use this when depending on other mods because
27+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
28+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
29+
// for more information about repositories.
30+
mavenCentral()
31+
32+
maven("https://maven.ultreon.dev/releases")
33+
maven("https://maven.ultreon.dev/snapshots")
34+
maven("https://maven.fabricmc.net/")
35+
maven("https://jitpack.io")
36+
37+
maven("https://oss.sonatype.org/content/repositories/snapshots/")
38+
maven("https://oss.sonatype.org/content/repositories/releases/")
39+
}
40+
41+
dependencies {
42+
// To change the versions see the gradle.properties file
43+
api("dev.ultreon.qvoxel:client:0.1.0-alpha.2025.11.29")
44+
api("dev.ultreon.qvoxel:server:0.1.0-alpha.2025.11.29")
45+
46+
runtimeOnly("dev.ultreon.qvoxel:gameprovider:0.1.0-alpha.2025.11.29")
47+
}
48+
49+
tasks {
50+
processResources {
51+
inputs.property("version", project.version.toString())
52+
53+
filesMatching("fabric.mod.json") {
54+
expand(inputs.properties)
55+
}
56+
}
57+
58+
withType<ProcessResources>() {
59+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
60+
}
61+
62+
withType<JavaCompile>().configureEach {
63+
options.release = 25
64+
}
65+
}
66+
67+
java {
68+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
69+
// if it is present.
70+
// If you remove this line, sources will not be generated.
71+
withSourcesJar()
72+
73+
sourceCompatibility = JavaVersion.VERSION_25
74+
targetCompatibility = JavaVersion.VERSION_25
75+
76+
toolchain {
77+
languageVersion = JavaLanguageVersion.of(25)
78+
}
79+
}
80+
81+
tasks.register<JavaExec>("runClient") {
82+
dependsOn("classes")
83+
mainClass = "net.fabricmc.loader.impl.launch.knot.KnotClient"
84+
classpath = sourceSets.main.get().runtimeClasspath + sourceSets.main.get().output
85+
86+
if (System.getProperty("os.name").contains("Mac")) {
87+
jvmArgs("-XstartOnFirstThread", "-Dfabric.development=true")
88+
}
89+
90+
workingDir = file("run")
91+
}
92+
93+
tasks.register<JavaExec>("runServer") {
94+
dependsOn("classes")
95+
mainClass = "net.fabricmc.loader.impl.launch.knot.KnotServer"
96+
classpath = sourceSets.main.get().runtimeClasspath + sourceSets.main.get().output
97+
98+
workingDir = file("run")
99+
}
100+
101+
tasks.jar {
102+
inputs.property("archivesName", project.base.archivesName)
103+
104+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
105+
106+
from("LICENSE") {
107+
rename { "${it}_${inputs.properties["archivesName"]}" }
108+
}
109+
}
110+
111+
// configure the maven publication
112+
publishing {
113+
publications {
114+
create<MavenPublication>("mavenJava") {
115+
artifactId = project.property("archives_base_name").toString()
116+
from(components.named("java").get())
117+
}
118+
}
119+
120+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
121+
repositories {
122+
// Add repositories to publish to here.
123+
// Notice: This block does NOT have the same function as the block in the top level.
124+
// The repositories here will be used for publishing your artifact, not for
125+
// retrieving dependencies.
126+
}
127+
}
128+
129+
mkdir("run")

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ systemProp.gradle.internal.repository.retry.initialBackoff=2000
66

77
# Fabric Properties
88
# check these on https://fabricmc.net/develop
9-
quantum_version=0.0.5-SNAPSHOT
10-
loader_version=0.16.10
9+
quantum_version=0.1.0-alpha.2025.11.29
10+
loader_version=0.18.1
1111

1212
# Mod Properties
1313
mod_version=1.0.0

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/com/example/ExampleMod.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package com.example;
22

3-
import dev.ultreon.quantum.Logger;
4-
import dev.ultreon.quantum.LoggerFactory;
53
import net.fabricmc.api.ModInitializer;
4+
import org.slf4j.Logger;
5+
import org.slf4j.LoggerFactory;
66

77
public class ExampleMod implements ModInitializer {
88
public static final String MOD_ID = "modid";
99

1010
// This logger is used to write text to the console and the log file.
1111
// It is considered best practice to use your mod id as the logger's name.
1212
// That way, it's clear which mod wrote info, warnings, and errors.
13-
public static final Logger LOGGER = LoggerFactory.Companion.get(MOD_ID);
13+
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
1414

1515
@Override
1616
public void onInitialize() {
File renamed without changes.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package com.example.mixin;
22

33
import com.example.ExampleMod;
4-
import dev.ultreon.quantum.registry.Registries;
4+
import dev.ultreon.qvoxel.registry.Registries;
55
import org.spongepowered.asm.mixin.Mixin;
66
import org.spongepowered.asm.mixin.injection.At;
77
import org.spongepowered.asm.mixin.injection.Inject;
88
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
99

1010
@Mixin(Registries.class)
1111
public class ExampleMixin {
12-
@Inject(at = @At("RETURN"), method = "<init>")
13-
private void init(CallbackInfo info) {
14-
// This code is injected into the start of Dimension.<init>()V
12+
@Inject(at = @At("RETURN"), method = "<clinit>")
13+
private static void init(CallbackInfo info) {
14+
// This code is injected into the start of Registries.<clinit>()V
1515
ExampleMod.LOGGER.info("Hello World from Quantum Voxel!");
1616
}
1717
}

src/client/java/com/example/mixin/client/ExampleClientMixin.java renamed to src/main/java/com/example/mixin/client/ExampleClientMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package com.example.mixin.client;
22

33
import com.example.ExampleMod;
4-
import dev.ultreon.quantum.client.QuantumVoxel;
4+
import dev.ultreon.qvoxel.client.QuantumClient;
55
import org.spongepowered.asm.mixin.Mixin;
66
import org.spongepowered.asm.mixin.injection.At;
77
import org.spongepowered.asm.mixin.injection.Inject;
88
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
99

10-
@Mixin(QuantumVoxel.class)
10+
@Mixin(QuantumClient.class)
1111
public class ExampleClientMixin {
12-
@Inject(at = @At("RETURN"), method = "create")
12+
@Inject(at = @At("RETURN"), method = "<init>")
1313
private void init(CallbackInfo info) {
14-
// This code is injected into the start of QuantumVoxel.render()V
14+
// This code is injected into the start of QuantumClient.<init>()V
1515
ExampleMod.LOGGER.info("Hello World from Quantum Voxel!");
1616
}
1717
}

src/main/resources/fabric.mod.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,12 @@
2727
{
2828
"config": "modid.client.mixins.json",
2929
"environment": "client"
30-
},
31-
{
32-
"config": "modid.server.mixins.json",
33-
"environment": "server"
3430
}
3531
],
3632
"depends": {
37-
"fabricloader": ">=0.16.10",
38-
"quantum": ">=0.0.5-SNAPSHOT",
39-
"java": ">=17"
33+
"fabricloader": ">=0.17.0",
34+
"quantum": ">=0.1.0-alpha.2025.11.29",
35+
"java": ">=25"
4036
},
4137
"suggests": {
4238
"another-mod": "*"

src/client/resources/modid.client.mixins.json renamed to src/main/resources/modid.client.mixins.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"package": "com.example.mixin.client",
44
"compatibilityLevel": "JAVA_11",
55
"client": [
6-
"ExampleClientMixin"
76
],
87
"injectors": {
98
"defaultRequire": 1

0 commit comments

Comments
 (0)