1.19.2 update with maven publishing and README polishing
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
# ΩConfig
|
<h1 align="center">Omega Config Ω </h1>
|
||||||
|
<p align="center">A configuration library by <a href="https://github.com/Draylar">Draylar</a></p>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*The last config library you will ever use.*
|
|
||||||
|
|
||||||
ΩConfig is a hyper-minimal config library based on [Auto Config](https://github.com/shedaniel/AutoConfig). It aims to
|
ΩConfig is a hyper-minimal config library based on [Auto Config](https://github.com/shedaniel/AutoConfig). It aims to
|
||||||
achieve the following goals:
|
achieve the following goals:
|
||||||
|
|
||||||
@@ -20,6 +19,10 @@ public class TestConfig implements Config {
|
|||||||
@Comment(value = "Hello!")
|
@Comment(value = "Hello!")
|
||||||
boolean value = false;
|
boolean value = false;
|
||||||
|
|
||||||
|
@Syncing
|
||||||
|
@Comment(value = "This value will sync to the client!")
|
||||||
|
boolean syncableValue = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFileName() {
|
public String getFileName() {
|
||||||
return "test-config";
|
return "test-config";
|
||||||
@@ -63,12 +66,12 @@ you can use the following gradle declarations:
|
|||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://maven.draylar.dev/releases' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1.19.2 version: 1.3.0+1.19.2
|
||||||
dependencies {
|
dependencies {
|
||||||
include("com.github.Draylar.omega-config:omega-config-base:${project.omega_config_version}")
|
modImplementation include("dev.draylar.omega-config:omega-config-base:${project.omega_config_version}")
|
||||||
modImplementation("com.github.Draylar.omega-config:omega-config-base:${project.omega_config_version}")
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -95,8 +98,7 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
... (including the base declarations)
|
... (including the base declarations)
|
||||||
|
|
||||||
include("com.github.Draylar.omega-config:omega-config-gui:${project.omega_config_version}")
|
modImplementation include("dev.draylar.omega-config:omega-config-gui:${project.omega_config_version}")
|
||||||
modImplementation("com.github.Draylar.omega-config:omega-config-gui:${project.omega_config_version}")
|
|
||||||
modRuntimeOnly ("com.terraformersmc:modmenu:${project.modmenu_version}") // 3.0.1 for 1.18.1
|
modRuntimeOnly ("com.terraformersmc:modmenu:${project.modmenu_version}") // 3.0.1 for 1.18.1
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -115,7 +117,7 @@ MyModInitializer.CONFIG.value=false;
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
**@Syncing** - *configuration options marked with this annotation will automatically sync to the client when they join a server.*
|
`@Syncing` - *configuration options marked with this annotation will automatically sync to the client when they join a server.*
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+15
-4
@@ -1,10 +1,10 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "fabric-loom" version "0.10-SNAPSHOT"
|
id "fabric-loom" version "1.1-SNAPSHOT"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
id "java-library"
|
id "java-library"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "draylar"
|
group = "dev.draylar"
|
||||||
archivesBaseName = "omega-config"
|
archivesBaseName = "omega-config"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
@@ -12,10 +12,21 @@ subprojects {
|
|||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
archivesBaseName = project.name
|
archivesBaseName = project.name
|
||||||
group = "draylar.${project.group}"
|
group = "dev.draylar.${project.group}"
|
||||||
|
|
||||||
// Only publish for submodules (not the root project) - add standard jar, + sources & development jar
|
// Only publish for submodules (not the root project) - add standard jar, + sources & development jar
|
||||||
publishing {
|
publishing {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "draylarRepository"
|
||||||
|
url = "https://maven.draylar.dev/releases"
|
||||||
|
credentials(PasswordCredentials)
|
||||||
|
authentication {
|
||||||
|
basic(BasicAuthentication)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
from components.java
|
from components.java
|
||||||
@@ -33,7 +44,7 @@ subprojects {
|
|||||||
allprojects {
|
allprojects {
|
||||||
apply plugin: "fabric-loom"
|
apply plugin: "fabric-loom"
|
||||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
|
||||||
version = project.mod_version + "-" + project.minecraft_version
|
version = project.mod_version + "+" + project.minecraft_version
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
|
|||||||
+6
-7
@@ -2,15 +2,14 @@
|
|||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/versions.html
|
# check these on https://fabricmc.net/versions.html
|
||||||
minecraft_version=1.18.1
|
minecraft_version=1.19.2
|
||||||
yarn_mappings=1.18.1+build.12
|
yarn_mappings=1.19.2+build.28
|
||||||
loader_version=0.12.12
|
loader_version=0.14.14
|
||||||
|
fabric_version=0.75.1+1.19.2
|
||||||
|
|
||||||
#Fabric api
|
|
||||||
fabric_version=0.45.0+1.18
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.2.3
|
mod_version=1.3.0
|
||||||
maven_group=draylar
|
maven_group=dev.draylar
|
||||||
archives_base_name=omega-config
|
archives_base_name=omega-config
|
||||||
|
|
||||||
modmenu_version=3.0.1
|
modmenu_version=3.0.1
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import net.fabricmc.api.EnvType;
|
|||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.text.TranslatableText;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -56,12 +55,12 @@ public class OmegaConfigGui {
|
|||||||
return parent -> {
|
return parent -> {
|
||||||
try {
|
try {
|
||||||
Config defaultConfig = config.getClass().getDeclaredConstructor().newInstance();
|
Config defaultConfig = config.getClass().getDeclaredConstructor().newInstance();
|
||||||
ConfigScreen screen = ConfigScreen.create(new TranslatableText(String.format("config.%s.%s", config.getModid(), config.getName())), parent);
|
ConfigScreen screen = ConfigScreen.create(Text.translatable(String.format("config.%s.%s", config.getModid(), config.getName())), parent);
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
for (Field field : config.getClass().getDeclaredFields()) {
|
for (Field field : config.getClass().getDeclaredFields()) {
|
||||||
try {
|
try {
|
||||||
screen.add(new LiteralText(field.getName()), field.get(config), () -> {
|
screen.add(Text.of(field.getName()), field.get(config), () -> {
|
||||||
try {
|
try {
|
||||||
return field.get(defaultConfig);
|
return field.get(defaultConfig);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import draylar.omegaconfiggui.OmegaConfigGui;
|
|||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
public class OmegaTestClient implements ClientModInitializer {
|
public class OmegaTestClient implements ClientModInitializer {
|
||||||
|
|
||||||
@@ -13,8 +13,8 @@ public class OmegaTestClient implements ClientModInitializer {
|
|||||||
OmegaConfigGui.registerConfigScreen(OmegaTestMain.CONFIG);
|
OmegaConfigGui.registerConfigScreen(OmegaTestMain.CONFIG);
|
||||||
|
|
||||||
HudRenderCallback.EVENT.register((stack, delta) -> {
|
HudRenderCallback.EVENT.register((stack, delta) -> {
|
||||||
MinecraftClient.getInstance().textRenderer.draw(stack, new LiteralText(String.valueOf(OmegaTestMain.CONFIG.v)), 15, 15, 0xffffff);
|
MinecraftClient.getInstance().textRenderer.draw(stack, Text.literal(String.valueOf(OmegaTestMain.CONFIG.v)), 15, 15, 0xffffff);
|
||||||
MinecraftClient.getInstance().textRenderer.draw(stack, new LiteralText(String.valueOf(OmegaTestMain.CONFIG.doubleTest)), 15, 30, 0xffffff);
|
MinecraftClient.getInstance().textRenderer.draw(stack, Text.literal(String.valueOf(OmegaTestMain.CONFIG.doubleTest)), 15, 30, 0xffffff);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user