Include gui and api inside jar

This commit is contained in:
Neil
2020-02-18 12:18:19 +01:00
parent da35bda7b9
commit 211ecfe682
3 changed files with 20 additions and 8 deletions
+8 -5
View File
@@ -18,19 +18,21 @@ repositories {
url = "http://server.bbkr.space:8081/artifactory/libs-release" url = "http://server.bbkr.space:8081/artifactory/libs-release"
} }
} }
dependencies {
modImplementation "io.github.cottonmc:LibGui:1.6.0"
}
dependencies { dependencies {
//to change the versions see the gradle.properties file //to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}" mappings "net.fabricmc:yarn:${project.yarn_mappings}"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}" modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
// modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" //modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them. // You may need to force-disable transitiveness on them.
modImplementation "io.github.cottonmc:LibGui:1.6.0"
include "io.github.cottonmc:LibGui:1.6.0"
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
include("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
} }
processResources { processResources {
@@ -63,14 +65,15 @@ task sourcesJar(type: Jar, dependsOn: classes) {
jar { jar {
from "LICENSE" from "LICENSE"
}
}
// configure the maven publication // configure the maven publication
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven // add all the jars that should be included when publishing to maven
artifact(remapJar) { artifact(remapJar) {
builtBy remapJar builtBy remapJar
} }
artifact(sourcesJar) { artifact(sourcesJar) {
+1 -1
View File
@@ -14,5 +14,5 @@ org.gradle.jvmargs=-Xmx1G
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.4.29+build.290-1.15 fabric_version=0.4.32+build.292-1.15
modmenu_version=1.10.1+build.30 modmenu_version=1.10.1+build.30
@@ -6,6 +6,8 @@ import io.github.cottonmc.cotton.gui.widget.WButton;
import io.github.cottonmc.cotton.gui.widget.WGridPanel; import io.github.cottonmc.cotton.gui.widget.WGridPanel;
import io.github.cottonmc.cotton.gui.widget.WLabel; import io.github.cottonmc.cotton.gui.widget.WLabel;
import io.github.cottonmc.cotton.gui.widget.WSprite; import io.github.cottonmc.cotton.gui.widget.WSprite;
import kaptainwutax.seedcracker.SeedCracker;
import kaptainwutax.seedcracker.finder.FinderQueue;
import net.minecraft.text.LiteralText; import net.minecraft.text.LiteralText;
import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
@@ -19,7 +21,15 @@ public class Gui extends LightweightGuiDescription {
WSprite icon = new WSprite(new Identifier("minecraft:textures/item/redstone.png")); WSprite icon = new WSprite(new Identifier("minecraft:textures/item/redstone.png"));
root.add(icon, 0, 2, 1, 1); root.add(icon, 0, 2, 1, 1);
WButton button = new WButton(new TranslatableText("gui.examplemod.examplebutton")); WButton button = new WButton(new TranslatableText("RESET DATA"));
button.setOnClick(new Runnable() {
@Override
public void run() {
SeedCracker.get().getDataStorage().clear();
FinderQueue.get().clear();
}
}
);
root.add(button, 0, 3, 4, 1); root.add(button, 0, 3, 4, 1);
WLabel label = new WLabel(new LiteralText("Test"), 0xFFFFFF); WLabel label = new WLabel(new LiteralText("Test"), 0xFFFFFF);
@@ -29,7 +39,6 @@ public class Gui extends LightweightGuiDescription {
} }
@Override @Override
public void addPainters() { public void addPainters() {
getRootPanel().setBackgroundPainter(BackgroundPainter.VANILLA); //This is done automatically though getRootPanel().setBackgroundPainter(BackgroundPainter.VANILLA); //This is done automatically though