diff --git a/build.gradle b/build.gradle index 43d2e12..e48a813 100644 --- a/build.gradle +++ b/build.gradle @@ -21,6 +21,10 @@ nova { 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/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.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/DrawableGuiComponent.java b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/DrawableGuiComponent.java new file mode 100644 index 0000000..83a7c3d --- /dev/null +++ b/minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/DrawableGuiComponent.java @@ -0,0 +1,21 @@ +package nova.gui.wrapper.mc.forge.v1_11; + +import nova.gui.nativeimpl.NativeGuiComponent; +import nova.gui.render.Graphics; + +public interface DrawableGuiComponent extends NativeGuiComponent { + + public void draw(int mouseX, int mouseY, float partial, Graphics graphics); + + public default void onAddedToContainer(MCGui.MCContainer container) { + + } + + public default MCCanvas getCanvas() { + return getGui().getCanvas(); + } + + public default MCGui getGui() { + return (MCGui) getComponent().getParentGui().get().getNative(); + } +} 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