Skip to content

Commit

Permalink
Prepare for 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EnnuiL committed Dec 23, 2024
1 parent 43859eb commit eb3c43b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 3 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/mod_conventions_common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ publishing {
maven {
url = uri(uploadUrl)
credentials {
System.getenv("MAVEN_UPLOAD_USERNAME")
System.getenv("MAVEN_UPLOAD_PASSWORD")
username = System.getenv("MAVEN_UPLOAD_USERNAME")
password = System.getenv("MAVEN_UPLOAD_PASSWORD")
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ neoforge = "21.4.33-beta"

fabric_api = "0.112.0+1.21.4"

modmenu = "13.0.0-beta.1"

[libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
parchment = { module = "org.parchmentmc.data:parchment-1.21.3", version.ref = "parchment" }
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }

fabric_api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric_api" }

modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu" }

# If you have multiple similar dependencies, you can declare a dependency bundle and reference it on the build script with "libs.bundles.example".
[bundles]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.github.ennuil.crooked_crooks.satire_config;

import com.mojang.logging.LogUtils;
import net.minecraft.Util;
import net.minecraft.client.gui.screens.Screen;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;

Expand Down Expand Up @@ -104,7 +106,16 @@ public static ModConfig getConfig() {
return SatireConfig.config;
}

public static Path getConfigPath() {
return SatireConfig.configPath.get();
}

public static void setConfigPath(Path path) {
SatireConfig.configPath = () -> path;
}

public static Screen wrapConfigScreen(Screen screen) {
Util.getPlatform().openPath(SatireConfig.getConfigPath());
return screen;
}
}
6 changes: 6 additions & 0 deletions mod_fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {

base.archivesName = "crooked_crooks-fabric"

repositories {
maven("https://maven.terraformersmc.com/releases")
}

dependencies {
minecraft(libs.minecraft)

Expand All @@ -15,6 +19,8 @@ dependencies {
modImplementation(libs.fabric.loader)

modImplementation(libs.fabric.api)

modImplementation(libs.modmenu)
}

loom {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.ennuil.crooked_crooks.compat.modmenu;

import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import io.github.ennuil.crooked_crooks.satire_config.SatireConfig;

public class ModModMenuCompat implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return SatireConfig::wrapConfigScreen;
}
}
3 changes: 2 additions & 1 deletion mod_fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"environment": "*",
"entrypoints": {
"main": ["io.github.ennuil.crooked_crooks.ModInit"],
"fabric-datagen": ["io.github.ennuil.crooked_crooks.datagen.ModDatagenInit"]
"fabric-datagen": ["io.github.ennuil.crooked_crooks.datagen.ModDatagenInit"],
"modmenu": ["io.github.ennuil.crooked_crooks.compat.modmenu.ModModMenuCompat"]
},
"mixins": [
"crooked_crooks.mixins.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.loading.FMLPaths;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;

@Mod(ModUtils.MOD_NAMESPACE)
public class ModInit {
public ModInit(IEventBus bus, ModContainer mod) {
SatireConfig.setConfigPath(FMLPaths.CONFIGDIR.get().resolve("crooked_crooks"));
SatireConfig.init();
mod.registerExtensionPoint(IConfigScreenFactory.class, (mod2, screen) -> SatireConfig.wrapConfigScreen(screen));
ModItems.ITEMS.register(bus);
ModAttributes.ATTRIBUTES.register(bus);
ModMobEffects.MOB_EFFECTS.register(bus);
Expand Down

0 comments on commit eb3c43b

Please sign in to comment.