diff --git a/assets/mcpht/icon.png b/assets/mcpht/icon.png new file mode 100755 index 0000000..39e7921 Binary files /dev/null and b/assets/mcpht/icon.png differ diff --git a/build.gradle b/build.gradle index 25e40bd..6a863a2 100644 --- a/build.gradle +++ b/build.gradle @@ -16,6 +16,8 @@ repositories { // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. // See https://docs.gradle.org/current/userguide/declaring_repositories.html // for more information about repositories. + maven { url "https://maven.shedaniel.me/" } + maven { url "https://maven.terraformersmc.com/releases/" } } loom { @@ -38,7 +40,12 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - + + modApi("me.shedaniel.cloth:cloth-config-fabric:10.1.105") { + exclude(group: "net.fabricmc.fabric-api") + } + modApi "com.terraformersmc:modmenu:6.2.1" + // Uncomment the following line to enable the deprecated Fabric API modules. // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. diff --git a/src/client/java/de/cscherr/mcpht/config/MenuAPI.java b/src/client/java/de/cscherr/mcpht/config/MenuAPI.java new file mode 100644 index 0000000..bd17af3 --- /dev/null +++ b/src/client/java/de/cscherr/mcpht/config/MenuAPI.java @@ -0,0 +1,11 @@ +package de.cscherr.mcpht.config; + +import com.terraformersmc.modmenu.api.ConfigScreenFactory; +import com.terraformersmc.modmenu.api.ModMenuApi; + +public class MenuAPI implements ModMenuApi { + @Override + public ConfigScreenFactory getModConfigScreenFactory() { + return OptionsScreen::new; + } +} diff --git a/src/client/java/de/cscherr/mcpht/config/OptionsScreen.java b/src/client/java/de/cscherr/mcpht/config/OptionsScreen.java new file mode 100644 index 0000000..6e1547a --- /dev/null +++ b/src/client/java/de/cscherr/mcpht/config/OptionsScreen.java @@ -0,0 +1,40 @@ +package de.cscherr.mcpht.config; +import de.cscherr.mcpht.McphtClient; +import me.shedaniel.clothconfig2.api.ConfigBuilder; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.MultilineText; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.tooltip.Tooltip; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.text.Text; + +public class OptionsScreen extends Screen { + public ButtonWidget dummyButton; + private final Screen parent; + protected OptionsScreen(Screen parent) { + super(Text.literal("MCPHT Options")); + this.parent = parent; + } + @Override + protected void init() { + dummyButton = ButtonWidget.builder(Text.literal("Dummy"), button -> { + McphtClient.LOGGER.info("Dummy click"); + }) + .dimensions(width / 2 - 205, 20, 200, 20) + .tooltip(Tooltip.of(Text.literal("Tooltip of button1"))) + .build(); + addDrawableChild(dummyButton); + } + @Override + public void close() { + client.setScreen(parent); + } + @Override + public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + super.render(matrices, mouseX, mouseY, delta); + final MultilineText multilineText = MultilineText.create(textRenderer, + Text.literal("This is Text\nother line"), width - 20); + multilineText.drawWithShadow(matrices, 10, height / 2, 16, 0xffffff); + } +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 8c9e0df..3f3abf2 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,17 +1,22 @@ { "schemaVersion": 1, "id": "mcpht", - "version": "${version}", - "name": "mcpht", - "description": "This is an example description! Tell everyone what your mod is about!", + "version": "0.0.1", + "name": "MCPHT", + "description": "Plex Hack Tools", "authors": [ - "Me!" + { + "name": "Christoph J. Scherr", + "email": "software@cscherr.de" + } ], "contact": { - "homepage": "https://fabricmc.net/", - "sources": "https://github.com/FabricMC/fabric-example-mod" + "email": "software@cscherr.de", + "homepage": "https://www.cscherr.de", + "sources": "https://git.cscherr.de/PlexSheep/mcpht", + "issues": "https://git.cscherr.de/PlexSheep/mcpht/issues" }, - "license": "CC0-1.0", + "license": "MIT", "icon": "assets/mcpht/icon.png", "environment": "*", "entrypoints": { @@ -33,9 +38,15 @@ "fabricloader": ">=0.14.24", "minecraft": "~1.19.4", "java": ">=17", - "fabric-api": "*" + "fabric-api": "*", + "modmenu": ">=6.0.0" }, "suggests": { "another-mod": "*" + }, + "custom": { + "modmenu": { + "update_checker": true + } } } \ No newline at end of file