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"
}
}
dependencies {
modImplementation "io.github.cottonmc:LibGui:1.6.0"
}
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
// 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.
// 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 {
@@ -63,14 +65,15 @@ task sourcesJar(type: Jar, dependsOn: classes) {
jar {
from "LICENSE"
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
+1 -1
View File
@@ -14,5 +14,5 @@ org.gradle.jvmargs=-Xmx1G
# Dependencies
# 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
@@ -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.WLabel;
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.TranslatableText;
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"));
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);
WLabel label = new WLabel(new LiteralText("Test"), 0xFFFFFF);
@@ -29,7 +39,6 @@ public class Gui extends LightweightGuiDescription {
}
@Override
public void addPainters() {
getRootPanel().setBackgroundPainter(BackgroundPainter.VANILLA); //This is done automatically though