GeezerVison is showing github.com — hello · Intiiii/OneConfigExampleMod@eb8a645
File treeExpand file treeCollapse file tree Open diff view settings java/cc/polyfrost/example
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: build.gradle.kts +5-18Lines changed: 5 additions & 18 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 36 | 36 | noServerRunConfigs() | 37 | 37 | if (project.platform.isLegacyForge) { | 38 | 38 | launchConfigs.named("client") { | 39 | | - property("fml.coreMods.load", "cc.polyfrost.oneconfig.plugin.LoadingPlugin") | | 39 | + arg("--tweakClass", "cc.polyfrost.oneconfigwrapper.OneConfigWrapper") | 40 | 40 | property("mixin.debug.export", "true") | 41 | 41 | } | 42 | 42 | } | @@ -48,10 +48,6 @@ loom { | 48 | 48 | mixin.defaultRefmapName.set("mixins.${mod_id}.refmap.json") | 49 | 49 | } | 50 | 50 |
| 51 | | -repositories { | 52 | | - maven("https://repo.woverflow.cc/") | 53 | | -} | 54 | | - | 55 | 51 | val shade: Configuration by configurations.creating { | 56 | 52 | configurations.implementation.get().extendsFrom(this) | 57 | 53 | } | @@ -63,19 +59,12 @@ sourceSets { | 63 | 59 | } | 64 | 60 |
| 65 | 61 | repositories { | 66 | | - mavenCentral() | 67 | | - maven { | 68 | | - url = uri("https://repo.polyfrost.cc/private") | 69 | | - credentials(PasswordCredentials::class) | 70 | | - authentication { | 71 | | - create<BasicAuthentication>("basic") | 72 | | - } | 73 | | - } | 74 | | - maven("https://repo.woverflow.cc/") | | 62 | + maven("https://repo.polyfrost.cc/releases") | 75 | 63 | } | 76 | 64 |
| 77 | 65 | dependencies { | 78 | | - implementation("cc.polyfrost:oneconfig-1.8.9-forge:0.1.0") | | 66 | + compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.1.0-alpha26") | | 67 | + shade("cc.polyfrost:oneconfig-wrapper-1.8.9-forge:1.0.0-alpha6") | 79 | 68 | } | 80 | 69 |
| 81 | 70 | tasks.processResources { | @@ -147,9 +136,7 @@ tasks { | 147 | 136 | "ForceLoadAsMod" to true, | 148 | 137 | "TweakOrder" to "0", | 149 | 138 | "MixinConfigs" to "mixins.${mod_id}.json", | 150 | | - "FMLCorePlugin" to "cc.polyfrost.oneconfig.plugin.LoadingPlugin", | 151 | | - "TweakClass" to "org.spongepowered.asm.launch.MixinTweaker", | 152 | | - "FMLCorePluginContainsFMLMod" to "lol" | | 139 | + "TweakClass" to "cc.polyfrost.oneconfigwrapper.OneConfigWrapper" | 153 | 140 | ) | 154 | 141 | ) | 155 | 142 | } | |
Collapse file Copy file name to clipboardExpand all lines: settings.gradle.kts +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,10 +2,11 @@ pluginManagement { | 2 | 2 | repositories { | 3 | 3 | gradlePluginPortal() | 4 | 4 | mavenCentral() | 5 | | - maven("https://repo.woverflow.cc") | | 5 | + maven("https://repo.polyfrost.cc/releases") | | 6 | + maven("https://maven.architectury.dev/") | 6 | 7 | } | 7 | 8 | plugins { | 8 | | - val egtVersion = "0.1.8" | | 9 | + val egtVersion = "0.1.10" | 9 | 10 | id("gg.essential.multi-version.root") version egtVersion | 10 | 11 | } | 11 | 12 | resolutionStrategy { | |
Collapse file Copy file name to clipboardExpand all lines: src/main/java/cc/polyfrost/example/ExampleMod.java +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | */ | 10 | 10 | @net.minecraftforge.fml.common.Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION) | 11 | 11 | public class ExampleMod { | 12 | | - @net.minecraftforge.fml.common.Mod.Instance(MODID) | 13 | | - public static ExampleMod INSTANCE; | 14 | 12 | public static final String MODID = "@ID@"; | 15 | 13 | public static final String NAME = "@NAME@"; | 16 | 14 | public static final String VERSION = "@VER@"; | | 15 | + @net.minecraftforge.fml.common.Mod.Instance(MODID) | | 16 | + public static ExampleMod INSTANCE; | 17 | 17 | public TestConfig config; | | 18 | + | 18 | 19 | @net.minecraftforge.fml.common.Mod.EventHandler | 19 | 20 | public void onFMLInitialization(net.minecraftforge.fml.common.event.FMLInitializationEvent event) { | 20 | 21 | config = new TestConfig(); | 21 | | - CommandManager.INSTANCE.registerCommand(new ExampleCommand()); | | 22 | + CommandManager.INSTANCE.registerCommand(ExampleCommand.class); | 22 | 23 | } | 23 | 24 | } |
Collapse file Copy file name to clipboard +7-10Lines changed: 7 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | package cc.polyfrost.example.config; | 2 | 2 |
| 3 | 3 | import cc.polyfrost.example.hud.TestHud; | 4 | | -import cc.polyfrost.oneconfig.config.annotations.Option; | | 4 | +import cc.polyfrost.oneconfig.config.Config; | | 5 | +import cc.polyfrost.oneconfig.config.annotations.HUD; | | 6 | +import cc.polyfrost.oneconfig.config.annotations.Switch; | 5 | 7 | import cc.polyfrost.oneconfig.config.data.Mod; | 6 | 8 | import cc.polyfrost.oneconfig.config.data.ModType; | 7 | | -import cc.polyfrost.oneconfig.config.data.OptionType; | 8 | | -import cc.polyfrost.oneconfig.config.interfaces.Config; | 9 | 9 |
| 10 | 10 | public class TestConfig extends Config { | 11 | 11 |
| 12 | | - @Option( | | 12 | + @HUD( | 13 | 13 | name = "Very cool HUD", | 14 | | - subcategory = "Test", | 15 | | - type = OptionType.HUD, | 16 | | - size = 2 | | 14 | + subcategory = "Test" | 17 | 15 | ) | 18 | 16 | public static TestHud testHud = new TestHud(true, 500, 500); | 19 | 17 |
| 20 | | - @Option( | | 18 | + @Switch( | 21 | 19 | name = "Test", | 22 | 20 | subcategory = "Test", | 23 | | - type = OptionType.SWITCH, | 24 | 21 | size = 2 | 25 | 22 | ) | 26 | 23 | public static boolean test = true; | 27 | 24 |
| 28 | 25 | public TestConfig() { | 29 | | - super(new Mod("Example Mod", ModType.UTIL_QOL), "./config/example_mod.json"); | | 26 | + super(new Mod("Example Mod", ModType.UTIL_QOL), "config/example_mod.json"); | 30 | 27 | } | 31 | 28 | } | 32 | 29 |
|
Collapse file Copy file name to clipboard +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | package cc.polyfrost.example.hud; | 2 | 2 |
| 3 | 3 | import cc.polyfrost.oneconfig.hud.TextHud; | | 4 | +import com.google.common.collect.Lists; | 4 | 5 | import net.minecraft.client.Minecraft; | 5 | 6 |
| | 7 | +import java.util.List; | | 8 | + | 6 | 9 | public class TestHud extends TextHud { | 7 | 10 | public TestHud(boolean enabled, int x, int y) { | 8 | 11 | super(enabled, x, y); | 9 | 12 | } | 10 | 13 |
| 11 | 14 | @Override | 12 | | - public String getText() { | 13 | | - return "Hello, world! " + Minecraft.getDebugFPS(); | | 15 | + public List<String> getLines() { | | 16 | + return Lists.newArrayList("Hello, world! " + Minecraft.getDebugFPS()); | 14 | 17 | } | 15 | 18 | } |
Collapse file Copy file name to clipboard +2-10Lines changed: 2 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "compatibilityLevel": "JAVA_8", | 3 | 3 | "minVersion": "0.7", | 4 | | - "package": "cc.polyfrost.oneconfig.mixin", | | 4 | + "package": "cc.polyfrost.example.mixin", | 5 | 5 | "refmap": "mixins.oneconfig.refmap.json", | 6 | | - "plugin": "cc.polyfrost.oneconfig.plugin.OneConfigMixinPlugin", | 7 | | - "injectors": { | 8 | | - "maxShiftBy": 5 | 9 | | - }, | 10 | 6 | "verbose": true, | 11 | 7 | "client": [ | 12 | | - "cc.polyfrost.example.mixin.GuiIngameForgeMixin", | 13 | | - "cc.polyfrost.example.mixin.MinecraftMixin", | 14 | | - "cc.polyfrost.example.mixin.NetHandlerPlayClientMixin", | 15 | | - "cc.polyfrost.example.mixin.ShaderGroupAccessor", | 16 | | - "cc.polyfrost.example.mixin.WorldClientMixin" | | 8 | + "MinecraftMixin" | 17 | 9 | ] | 18 | 10 | } |
|