diff --git a/build.gradle b/build.gradle index 486a58e..e48a813 100644 --- a/build.gradle +++ b/build.gradle @@ -1,28 +1,30 @@ plugins { id "java" - id "nova.gradle" version "0.2.5" + id "nova.gradle" version "0.2.6" id "maven-publish" id "com.jfrog.artifactory" version "3.1.1" } - apply from: "https://raw.githubusercontent.com/NOVA-Team/NOVA-Gradle/master/shared-scripts/java.gradle" dependencies { - compile "nova.core:NovaCore:$novaVersion" - testCompile "nova.core:NovaCore:$novaVersion:wrappertests" + compile nova(nova_version) } + nova { wrappers { "17" { - wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:$novaVersion" + wrapper "nova.core:NOVA-Core-Wrapper-MC1.7:$nova_version" runtime project(":minecraft:1.7") } - "18" { - wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:$novaVersion" + wrapper "nova.core:NOVA-Core-Wrapper-MC1.8:$nova_version" runtime project(":minecraft:1.8") } + "1_11" { + wrapper "nova.core:NOVA-Core-Wrapper-MC1.11:$nova_version" + runtime project(":minecraft:1.11") + } } } diff --git a/gradle.properties b/gradle.properties index a35cc57..dc9e34e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ version = 0.0.1-SNAPSHOT group = nova.gui -novaVersion = 0.1.0-SNAPSHOT +nova_version = 0.1.0-SNAPSHOT packaging = jar info.inceptionYear = 2015 diff --git a/minecraft/.gitignore b/minecraft/.gitignore index a4c6e69..896c508 100644 --- a/minecraft/.gitignore +++ b/minecraft/.gitignore @@ -3,5 +3,6 @@ !/build.gradle !/.gitignore +!/1.11 !/1.8 !/1.7 diff --git a/minecraft/1.11/.gitignore b/minecraft/1.11/.gitignore new file mode 100644 index 0000000..85be317 --- /dev/null +++ b/minecraft/1.11/.gitignore @@ -0,0 +1,17 @@ +# Ignore All +/* + +# Sources +!/src + +# github +!/.gitignore +!/README.md + +# gradle +!/build.gradle +!/build.properties +!/settings.gradle +!/gradle.properties +!/gradlew* +!/gradle diff --git a/minecraft/1.11/build.gradle b/minecraft/1.11/build.gradle new file mode 100644 index 0000000..922cfa2 --- /dev/null +++ b/minecraft/1.11/build.gradle @@ -0,0 +1,73 @@ +apply plugin: "maven-publish" +apply plugin: "com.jfrog.artifactory" +apply from: "https://raw.githubusercontent.com/NOVA-Team/NOVA-Gradle/master/shared-scripts/java.gradle" + +idea.module.name = "GUI-MC-1.11" +archivesBaseName = "NOVA-GUI-Wrapper-MC1.11" + +publishing { + publications { + main(MavenPublication) { + from components.java + + artifactId "NOVA-GUI-Wrapper-MC1.11" + + artifact sourcesJar + artifact javadocJar + + pom.withXml(writePom(project.properties)) + } + } +} + +artifactory { + publish { + defaults { + publications("main") + publishPom = true + } + } +} + +task deobfJar(type: Jar) { + from sourceSets.main.output + classifier = 'deobf' +} + +artifacts { + archives jar + archives deobfJar +} + +apply plugin: 'net.minecraftforge.gradle.forge' + +minecraft { + version = property("minecraft.version") + "-" + property("forge.version") + mappings = 'snapshot_20161220' + runDir = "run" +} + +dependencies { + compile rootProject + compile group: "nova.core", name: "NOVA-Core", version: property("nova_version"), changing: true + compile "nova.core:NOVA-Core-Wrapper-MC1.11:0.1.0-SNAPSHOT:deobf" +} + +processResources { + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include "mcmod.info" + + // replace version and mcversion + expand "version": project.version, "mcversion": project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude "mcmod.info" + } +} diff --git a/minecraft/1.11/gradle.properties b/minecraft/1.11/gradle.properties new file mode 100644 index 0000000..9f642ab --- /dev/null +++ b/minecraft/1.11/gradle.properties @@ -0,0 +1,9 @@ +group = nova.gui + +minecraft.version = 1.11 +forge.version = 13.19.1.2189 +forgeGradleVersion = 2.2-SNAPSHOT + +packaging = jar +info.inceptionYear = 2016 +info.description = The NOVA-GUI Minecraft 1.11 wrapper.info.organization.name = NOVA diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/DrawableGuiComponent.java b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/DrawableGuiComponent.java similarity index 92% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/DrawableGuiComponent.java rename to minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/DrawableGuiComponent.java index d926d4e..83a7c3d 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/DrawableGuiComponent.java +++ b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/DrawableGuiComponent.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_11; import nova.gui.nativeimpl.NativeGuiComponent; import nova.gui.render.Graphics; diff --git a/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/GuiUtils.java b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/GuiUtils.java new file mode 100644 index 0000000..e63e3af --- /dev/null +++ b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/GuiUtils.java @@ -0,0 +1,34 @@ +package nova.gui.wrapper.mc.forge.v1_11; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import nova.core.wrapper.mc.forge.v1_11.launcher.NovaMinecraft; +import org.lwjgl.opengl.GL11; + +public class GuiUtils { + + public static final ResourceLocation RESOURCE_GUI_CONTROLS = new ResourceLocation(NovaMinecraft.id, "textures/gui/controls.png"); + + public static void drawGUIWindow(int xOffset, int yOffset, int width, int height) { + GL11.glTranslatef(xOffset, yOffset, 0); + + Gui.drawRect(3, 3, width - 3, height - 3, 0xFFC6C6C6); + Gui.drawRect(4, 0, width - 4, 1, 0xFF000000); + Gui.drawRect(4, 1, width - 4, 3, 0xFFFFFFFF); + Gui.drawRect(4, height - 1, width - 4, height, 0xFF000000); + Gui.drawRect(4, height - 3, width - 4, height - 1, 0xFF555555); + Gui.drawRect(0, 4, 1, height - 4, 0xFF000000); + Gui.drawRect(1, 4, 3, height - 4, 0xFFFFFFFF); + Gui.drawRect(width - 1, 4, width, height - 4, 0xFF000000); + Gui.drawRect(width - 3, 4, width - 1, height - 4, 0xFF555555); + + Minecraft.getMinecraft().renderEngine.bindTexture(RESOURCE_GUI_CONTROLS); + GL11.glColor4f(1, 1, 1, 1); + Gui.drawModalRectWithCustomSizedTexture(0, 0, 0, 0, 4, 4, 32, 32); + Gui.drawModalRectWithCustomSizedTexture(width - 4, 0, 4, 0, 4, 4, 32, 32); + Gui.drawModalRectWithCustomSizedTexture(width - 4, height - 4, 4, 4, 4, 4, 32, 32); + Gui.drawModalRectWithCustomSizedTexture(0, height - 4, 0, 4, 4, 4, 32, 32); + GL11.glTranslatef(-xOffset, -yOffset, 0); + } +} diff --git a/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCButton.java b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCButton.java new file mode 100644 index 0000000..4ba7c96 --- /dev/null +++ b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCButton.java @@ -0,0 +1,101 @@ +package nova.gui.wrapper.mc.forge.v1_11; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraftforge.fml.client.config.GuiButtonExt; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import nova.gui.GuiEvent.MouseEvent; +import nova.gui.GuiEvent.MouseEvent.EnumMouseState; +import nova.gui.Outline; +import nova.gui.component.Button; +import nova.gui.nativeimpl.NativeButton; +import nova.gui.render.Graphics; +import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; +import org.lwjgl.opengl.GL11; + +import java.util.Optional; + +public class MCButton extends MCGuiComponent