Fix formatting and add comments back.

pull/10/head
SmushyTaco 3 years ago
parent 9c0fe3af68
commit 5f1477e069

@ -12,8 +12,8 @@ buildscript {
plugins { java }
apply { plugin("fabric-loom") }
base {
val archivesBaseNameTwo: String by project
archivesBaseName = archivesBaseNameTwo
val realArchivesBaseName: String by project
archivesBaseName = realArchivesBaseName
}
val modVersion: String by project
version = modVersion
@ -24,6 +24,7 @@ repositories {
maven("https://storage.googleapis.com/devan-maven/") { name = "HalfOf2" }
}
dependencies {
//In order to change the versions see the gradle.properties file.
val minecraftVersion: String by project
"minecraft"("com.mojang:minecraft:$minecraftVersion")
val plasmaBuild: String by project
@ -32,12 +33,16 @@ dependencies {
"modImplementation"("io.github.minecraft-cursed-legacy:cursed-fabric-loader:$loaderVersion") {
isTransitive = false
}
// You technically don't need the API, but it's extremely useful for not having to write the same code in every mod.
val apiVersion: String by project
"modImplementation"("io.github.minecraft-cursed-legacy:cursed-legacy-api:$apiVersion")
}
tasks {
val javaVersion = JavaVersion.VERSION_1_8.toString()
withType<JavaCompile> {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
options.encoding = "UTF-8"
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
@ -51,6 +56,9 @@ tasks {
}
from(sourceSets["main"].resources.srcDirs) { exclude("fabric.mod.json") }
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
val sourcesJar by creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)

@ -7,4 +7,4 @@ apiVersion=1.1.0
# Mod Properties
modVersion = 1.0.0
mavenGroup = io.github.minecraftcursedlegacy.example
archivesBaseNameTwo = cursed-legacy-example-mod
realArchivesBaseName = cursed-legacy-example-mod

@ -1,14 +1,23 @@
package io.github.minecraftcursedlegacy.example;
import io.github.minecraftcursedlegacy.api.config.Configs;
import io.github.minecraftcursedlegacy.api.registry.Id;
import net.fabricmc.api.ModInitializer;
import tk.valoeghese.zoesteriaconfig.api.container.WritableConfig;
import tk.valoeghese.zoesteriaconfig.api.template.ConfigTemplate;
import java.io.IOException;
public class ExampleMod implements ModInitializer {
@Override
public void 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.
System.out.println("Hello Fabric world!");
// example config
try {
config = Configs.loadOrCreate(new Id("modid", "example"),
ConfigTemplate.builder()
@ -17,7 +26,9 @@ public class ExampleMod implements ModInitializer {
} catch (IOException e) {
throw new RuntimeException(e);
}
System.out.println(config.getDoubleValue("exampleContainer.someData"));
}
private static WritableConfig config;
}
}

@ -1,13 +1,16 @@
package io.github.minecraftcursedlegacy.example.mixin;
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;
import net.minecraft.client.gui.screen.TitleScreen;
@Mixin(TitleScreen.class)
public class ExampleMixin {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
private void init(CallbackInfo info) {
System.out.println("This line is printed by an example mod mixin!");
}
}
Loading…
Cancel
Save