From 0590f229a54afb31037f517fb1c733ffecb29eff Mon Sep 17 00:00:00 2001 From: ExE Boss Date: Wed, 21 Dec 2016 15:52:49 +0100 Subject: [PATCH 1/2] Update to latest snapshot --- build.gradle | 12 +++--- gradle.properties | 2 +- minecraft/1.7/build.gradle | 4 +- minecraft/1.7/gradle.properties | 5 ++- .../forge/v1_7_10}/DrawableGuiComponent.java | 2 +- .../{mc17 => mc/forge/v1_7_10}/GuiUtils.java | 4 +- .../{mc17 => mc/forge/v1_7_10}/MCButton.java | 2 +- .../{mc17 => mc/forge/v1_7_10}/MCCanvas.java | 2 +- .../{mc17 => mc/forge/v1_7_10}/MCGui.java | 8 ++-- .../forge/v1_7_10}/MCGuiComponent.java | 2 +- .../forge/v1_7_10}/MCGuiComponentFactory.java | 2 +- .../forge/v1_7_10}/MCGuiContainer.java | 4 +- .../forge/v1_7_10}/MCGuiFactory.java | 21 ++++++---- .../forge/v1_7_10}/MCGuiPlayerInventory.java | 8 ++-- .../{mc17 => mc/forge/v1_7_10}/MCGuiSlot.java | 10 ++--- .../forge/v1_7_10}/dependency/GuiModule.java | 6 +-- .../forge/v1_7_10}/launch/NovaGuiWrapper.java | 8 ++-- .../forge/v1_7_10}/network/PacketGui.java | 8 ++-- .../v1_7_10}/text/AbstractParagraph.java | 2 +- .../wrapper/mc/forge/v1_7_10}/text/IText.java | 2 +- .../forge/v1_7_10}/text/MCTextRenderer.java | 6 +-- .../forge/v1_7_10}/text/Paragraph.java | 4 +- .../forge/v1_7_10}/text/SimpleParagraph.java | 4 +- minecraft/1.8/build.gradle | 4 +- minecraft/1.8/gradle.properties | 5 ++- .../mc/forge/v1_8}/DrawableGuiComponent.java | 2 +- .../{mc18 => mc/forge/v1_8}/GuiUtils.java | 4 +- .../{mc18 => mc/forge/v1_8}/MCButton.java | 2 +- .../{mc18 => mc/forge/v1_8}/MCCanvas.java | 2 +- .../{mc18 => mc/forge/v1_8}/MCGui.java | 8 ++-- .../forge/v1_8}/MCGuiComponent.java | 2 +- .../forge/v1_8}/MCGuiComponentFactory.java | 2 +- .../forge/v1_8}/MCGuiContainer.java | 4 +- .../{mc18 => mc/forge/v1_8}/MCGuiFactory.java | 21 ++++++---- .../forge/v1_8}/MCGuiPlayerInventory.java | 8 ++-- .../{mc18 => mc/forge/v1_8}/MCGuiSlot.java | 10 ++--- .../forge/v1_8}/dependency/GuiModule.java | 6 +-- .../forge/v1_8}/launch/NovaGuiWrapper.java | 8 ++-- .../forge/v1_8}/network/PacketGui.java | 8 ++-- .../forge/v1_8}/text/AbstractParagraph.java | 2 +- .../wrapper/mc/forge/v1_8}/text/IText.java | 2 +- .../forge/v1_8}/text/MCTextRenderer.java | 6 +-- .../forge/v1_8}/text/Paragraph.java | 4 +- .../forge/v1_8}/text/SimpleParagraph.java | 4 +- minecraft/build.gradle | 27 +++++++------ .../java/nova/gui/AbstractGuiContainer.java | 3 +- src/main/java/nova/gui/ComponentEvent.java | 16 ++++---- src/main/java/nova/gui/Gui.java | 6 +-- src/main/java/nova/gui/GuiComponent.java | 14 +++---- .../java/nova/gui/GuiComponentException.java | 2 + src/main/java/nova/gui/GuiEvent.java | 4 +- src/main/java/nova/gui/GuiException.java | 4 +- src/main/java/nova/gui/component/Button.java | 1 + .../component/inventory/PlayerInventory.java | 4 +- .../nova/gui/component/inventory/Slot.java | 6 +-- .../nova/gui/factory/GuiEventFactory.java | 2 +- .../java/nova/gui/factory/GuiFactory.java | 17 ++++---- .../java/nova/gui/factory/GuiManager.java | 39 ++++++++++++------- src/main/java/nova/gui/launch/NovaGui.java | 2 +- .../java/nova/gui/layout/LayoutException.java | 4 +- src/main/java/nova/gui/render/Vertex2D.java | 1 + 61 files changed, 217 insertions(+), 177 deletions(-) rename minecraft/{1.8/src/main/java/nova/gui/wrapper/mc18 => 1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10}/DrawableGuiComponent.java (91%) rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/GuiUtils.java (92%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCButton.java (98%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCCanvas.java (98%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCGui.java (97%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCGuiComponent.java (95%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCGuiComponentFactory.java (96%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCGuiContainer.java (93%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCGuiFactory.java (85%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCGuiPlayerInventory.java (87%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/MCGuiSlot.java (92%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/dependency/GuiModule.java (65%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/launch/NovaGuiWrapper.java (72%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/network/PacketGui.java (81%) mode change 100755 => 100644 rename minecraft/{1.8/src/main/java/nova/gui/wrapper/mc18 => 1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10}/text/AbstractParagraph.java (94%) rename minecraft/{1.8/src/main/java/nova/gui/wrapper/mc18 => 1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10}/text/IText.java (98%) rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/text/MCTextRenderer.java (94%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/text/Paragraph.java (96%) mode change 100755 => 100644 rename minecraft/1.7/src/main/java/nova/gui/wrapper/{mc17 => mc/forge/v1_7_10}/text/SimpleParagraph.java (94%) mode change 100755 => 100644 rename minecraft/{1.7/src/main/java/nova/gui/wrapper/mc17 => 1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8}/DrawableGuiComponent.java (92%) mode change 100755 => 100644 rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/GuiUtils.java (93%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCButton.java (98%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCCanvas.java (98%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCGui.java (97%) mode change 100755 => 100644 rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCGuiComponent.java (95%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCGuiComponentFactory.java (96%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCGuiContainer.java (94%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCGuiFactory.java (85%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCGuiPlayerInventory.java (87%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/MCGuiSlot.java (92%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/dependency/GuiModule.java (66%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/launch/NovaGuiWrapper.java (74%) mode change 100755 => 100644 rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/network/PacketGui.java (81%) mode change 100755 => 100644 rename minecraft/{1.7/src/main/java/nova/gui/wrapper/mc17 => 1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8}/text/AbstractParagraph.java (95%) mode change 100755 => 100644 rename minecraft/{1.7/src/main/java/nova/gui/wrapper/mc17 => 1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8}/text/IText.java (98%) mode change 100755 => 100644 rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/text/MCTextRenderer.java (95%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/text/Paragraph.java (96%) rename minecraft/1.8/src/main/java/nova/gui/wrapper/{mc18 => mc/forge/v1_8}/text/SimpleParagraph.java (94%) diff --git a/build.gradle b/build.gradle index 486a58e..43d2e12 100644 --- a/build.gradle +++ b/build.gradle @@ -1,26 +1,24 @@ 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") } } 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/1.7/build.gradle b/minecraft/1.7/build.gradle index 11d6cbf..c2b452b 100755 --- a/minecraft/1.7/build.gradle +++ b/minecraft/1.7/build.gradle @@ -58,8 +58,8 @@ minecraft { dependencies { compile rootProject - compile group: "nova.core", name: "NovaCore", version: property("novaVersion"), changing: true - compile "nova.wrapper.mc1710:NovaWrapper-MC1.7.10:0.1-SNAPSHOT:deobf" + compile group: "nova.core", name: "NOVA-Core", version: property("nova_version"), changing: true + compile "nova.core:NOVA-Core-Wrapper-MC1.7:0.1.0-SNAPSHOT:deobf" } processResources { diff --git a/minecraft/1.7/gradle.properties b/minecraft/1.7/gradle.properties index b7ea1f6..d502192 100755 --- a/minecraft/1.7/gradle.properties +++ b/minecraft/1.7/gradle.properties @@ -1,7 +1,10 @@ +group = nova.gui + minecraft.version = 1.7.10 forge.version = 10.13.4.1448-1.7.10 +forgeGradleVersion = 1.2-SNAPSHOT packaging = jar info.inceptionYear = 2015 -info.description = The NOVA-Minecraft Minecraft 1.7.10 wrapper. +info.description = The NOVA-GUI Minecraft 1.7.10 wrapper. info.organization.name = NOVA diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/DrawableGuiComponent.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/DrawableGuiComponent.java similarity index 91% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/DrawableGuiComponent.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/DrawableGuiComponent.java index d926d4e..46f7ef6 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/DrawableGuiComponent.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/DrawableGuiComponent.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_7_10; import nova.gui.nativeimpl.NativeGuiComponent; import nova.gui.render.Graphics; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/GuiUtils.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/GuiUtils.java old mode 100755 new mode 100644 similarity index 92% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/GuiUtils.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/GuiUtils.java index 33b8e8c..ccd5a4d --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/GuiUtils.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/GuiUtils.java @@ -1,9 +1,9 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.util.ResourceLocation; -import nova.wrapper.mc1710.launcher.NovaMinecraft; +import nova.core.wrapper.mc.forge.v17.launcher.NovaMinecraft; import org.lwjgl.opengl.GL11; public class GuiUtils { diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCButton.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCButton.java old mode 100755 new mode 100644 similarity index 98% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCButton.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCButton.java index 34905f2..05c3b82 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCButton.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCButton.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import cpw.mods.fml.client.config.GuiButtonExt; import cpw.mods.fml.common.FMLCommonHandler; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCCanvas.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCCanvas.java old mode 100755 new mode 100644 similarity index 98% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCCanvas.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCCanvas.java index c47bafe..5154dec --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCCanvas.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCCanvas.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGui.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGui.java old mode 100755 new mode 100644 similarity index 97% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGui.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGui.java index 70ab313..e8fe82a --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGui.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGui.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; @@ -12,6 +12,7 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import nova.core.network.Packet; +import nova.core.wrapper.mc.forge.v17.network.netty.MCNetworkManager; import nova.gui.Gui; import nova.gui.GuiComponent; import nova.gui.GuiEvent.MouseEvent.EnumMouseButton; @@ -20,10 +21,9 @@ import nova.gui.render.Canvas; import nova.gui.render.Graphics; import nova.gui.render.text.TextMetrics; -import nova.gui.wrapper.mc17.text.MCTextRenderer; +import nova.gui.wrapper.mc.forge.v1_7_10.text.MCTextRenderer; import nova.internal.core.Game; -import nova.gui.wrapper.mc17.network.PacketGui; -import nova.wrapper.mc1710.network.netty.MCNetworkManager; +import nova.gui.wrapper.mc.forge.v1_7_10.network.PacketGui; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiComponent.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiComponent.java old mode 100755 new mode 100644 similarity index 95% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiComponent.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiComponent.java index 37d10e7..bca38b6 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiComponent.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiComponent.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import nova.gui.GuiComponent; import nova.gui.Outline; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiComponentFactory.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiComponentFactory.java old mode 100755 new mode 100644 similarity index 96% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiComponentFactory.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiComponentFactory.java index 3bc9bf7..67251f8 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiComponentFactory.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiComponentFactory.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import nova.gui.AbstractGuiContainer; import nova.gui.Gui; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiContainer.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiContainer.java old mode 100755 new mode 100644 similarity index 93% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiContainer.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiContainer.java index 2293ed2..494decf --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiContainer.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiContainer.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import nova.gui.AbstractGuiContainer; import nova.gui.GuiComponent; @@ -6,7 +6,7 @@ import nova.gui.nativeimpl.NativeContainer; import nova.gui.render.Canvas; import nova.gui.render.Graphics; -import nova.gui.wrapper.mc17.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCContainer; import java.util.ArrayList; import java.util.List; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiFactory.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiFactory.java old mode 100755 new mode 100644 similarity index 85% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiFactory.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiFactory.java index 991c119..9881e88 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiFactory.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiFactory.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.client.Minecraft; @@ -8,14 +8,15 @@ import net.minecraft.inventory.Container; import net.minecraft.world.World; import nova.core.entity.Entity; +import nova.core.wrapper.mc.forge.v17.launcher.NovaMinecraft; +import nova.core.wrapper.mc.forge.v17.wrapper.entity.backward.BWEntity; import nova.gui.Gui; import nova.gui.GuiException; import nova.gui.factory.GuiFactory; import nova.gui.factory.GuiManager; -import nova.gui.wrapper.mc17.MCGui.MCContainer; -import nova.gui.wrapper.mc17.MCGui.MCGuiScreen; -import nova.wrapper.mc1710.launcher.NovaMinecraft; -import nova.wrapper.mc1710.wrapper.entity.BWEntity; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCGuiScreen; +import nova.internal.core.Game; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import java.util.ArrayList; @@ -27,6 +28,10 @@ public class MCGuiFactory extends GuiManager { private static Optional guiToOpen = Optional.empty(); private static List idMappedFactories = new ArrayList<>(); + public MCGuiFactory() { + super(Game.events()); + } + @Override public GuiFactory register(GuiFactory factory) { idMappedFactories.add(factory); @@ -35,8 +40,8 @@ public GuiFactory register(GuiFactory factory) { @Override public void showGui(String identifier, Entity entity, Vector3D pos) { - GuiFactory factory = getFactory(identifier).orElseThrow(() -> new GuiException(String.format("No GUI called %s registered!", identifier))); - Gui gui = factory.makeGUI(); + GuiFactory factory = registry.get(identifier).orElseThrow(() -> new GuiException(String.format("No GUI called %s registered!", identifier))); + Gui gui = factory.build(); showGui(gui, entity, pos, idMappedFactories.indexOf(factory)); } @@ -104,7 +109,7 @@ public GuiContainer getClientGuiElement(int id, EntityPlayer player, World world guiToOpen = Optional.empty(); } else { // Try to get the client side GUI from the id mapping - gui = idMappedFactories.get(id).makeGUI(); + gui = idMappedFactories.get(id).build(); } if (gui == null) { throw new GuiException("Couldn't get client side instance for the provided GUI of id " + id + " !"); diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiPlayerInventory.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiPlayerInventory.java old mode 100755 new mode 100644 similarity index 87% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiPlayerInventory.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiPlayerInventory.java index dc58571..d51ec67 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiPlayerInventory.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiPlayerInventory.java @@ -1,12 +1,12 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import net.minecraft.inventory.IInventory; +import nova.core.wrapper.mc.forge.v17.wrapper.inventory.BWInventory; import nova.gui.component.inventory.PlayerInventory; import nova.gui.nativeimpl.NativePlayerInventory; import nova.gui.render.Graphics; -import nova.gui.wrapper.mc17.MCGui.MCContainer; -import nova.gui.wrapper.mc17.MCGui.MCGuiScreen; -import nova.wrapper.mc1710.wrapper.inventory.BWInventory; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCGuiScreen; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import java.util.ArrayList; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiSlot.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiSlot.java old mode 100755 new mode 100644 similarity index 92% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiSlot.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiSlot.java index 78c9a40..2a6e721 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/MCGuiSlot.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/MCGuiSlot.java @@ -1,17 +1,17 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_7_10; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import nova.core.wrapper.mc.forge.v17.wrapper.inventory.FWInventory; +import nova.core.wrapper.mc.forge.v17.wrapper.item.ItemConverter; import nova.gui.component.inventory.Slot; import nova.gui.nativeimpl.NativeSlot; import nova.gui.render.Graphics; -import nova.gui.wrapper.mc17.MCGui.MCContainer; -import nova.gui.wrapper.mc17.MCGui.MCGuiScreen; -import nova.wrapper.mc1710.wrapper.inventory.FWInventory; -import nova.wrapper.mc1710.wrapper.item.ItemConverter; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCGuiScreen; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import org.lwjgl.opengl.GL11; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/dependency/GuiModule.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/dependency/GuiModule.java old mode 100755 new mode 100644 similarity index 65% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/dependency/GuiModule.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/dependency/GuiModule.java index d70baf9..dc6ab03 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/dependency/GuiModule.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/dependency/GuiModule.java @@ -1,9 +1,9 @@ -package nova.gui.wrapper.mc17.dependency; +package nova.gui.wrapper.mc.forge.v1_7_10.dependency; import nova.gui.factory.GuiComponentFactory; import nova.gui.factory.GuiManager; -import nova.gui.wrapper.mc17.MCGuiComponentFactory; -import nova.gui.wrapper.mc17.MCGuiFactory; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGuiComponentFactory; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGuiFactory; import se.jbee.inject.bind.BinderModule; public class GuiModule extends BinderModule { diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/launch/NovaGuiWrapper.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/launch/NovaGuiWrapper.java old mode 100755 new mode 100644 similarity index 72% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/launch/NovaGuiWrapper.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/launch/NovaGuiWrapper.java index 54da186..cba5cf8 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/launch/NovaGuiWrapper.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/launch/NovaGuiWrapper.java @@ -1,13 +1,13 @@ -package nova.gui.wrapper.mc17.launch; +package nova.gui.wrapper.mc.forge.v1_7_10.launch; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import nova.core.loader.Loadable; import nova.core.loader.Mod; -import nova.gui.wrapper.mc17.MCGuiFactory; -import nova.gui.wrapper.mc17.dependency.GuiModule; -import nova.wrapper.mc1710.launcher.NovaMinecraft; +import nova.core.wrapper.mc.forge.v17.launcher.NovaMinecraft; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGuiFactory; +import nova.gui.wrapper.mc.forge.v1_7_10.dependency.GuiModule; /** * The main class to initialize the Gui Plugin diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/network/PacketGui.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/network/PacketGui.java old mode 100755 new mode 100644 similarity index 81% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/network/PacketGui.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/network/PacketGui.java index 8310995..e85e42d --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/network/PacketGui.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/network/PacketGui.java @@ -1,14 +1,14 @@ -package nova.gui.wrapper.mc17.network; +package nova.gui.wrapper.mc.forge.v1_7_10.network; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import net.minecraft.entity.player.EntityPlayer; import nova.core.network.Packet; +import nova.core.wrapper.mc.forge.v17.network.MCPacket; +import nova.core.wrapper.mc.forge.v17.network.discriminator.PacketAbstract; import nova.gui.GuiException; -import nova.wrapper.mc1710.network.MCPacket; -import nova.wrapper.mc1710.network.discriminator.PacketAbstract; -import nova.gui.wrapper.mc17.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_7_10.MCGui.MCContainer; //TODO: Integrate withPriority NOVA public class PacketGui extends PacketAbstract { diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/AbstractParagraph.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/AbstractParagraph.java similarity index 94% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/AbstractParagraph.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/AbstractParagraph.java index 7248176..f741d7b 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/AbstractParagraph.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/AbstractParagraph.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18.text; +package nova.gui.wrapper.mc.forge.v1_7_10.text; import nova.gui.render.text.TextRenderer.RenderedText; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/IText.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/IText.java similarity index 98% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/IText.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/IText.java index 06460ae..1c98a63 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/IText.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/IText.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18.text; +package nova.gui.wrapper.mc.forge.v1_7_10.text; import net.minecraft.client.gui.FontRenderer; import nova.gui.render.text.FormattedText.TextFormat; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/MCTextRenderer.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/MCTextRenderer.java old mode 100755 new mode 100644 similarity index 94% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/MCTextRenderer.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/MCTextRenderer.java index 2a3fd5a..08a356d --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/MCTextRenderer.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/MCTextRenderer.java @@ -1,12 +1,12 @@ -package nova.gui.wrapper.mc17.text; +package nova.gui.wrapper.mc.forge.v1_7_10.text; import net.minecraft.client.gui.FontRenderer; import nova.core.render.Color; import nova.core.util.math.MathUtil; import nova.gui.render.text.FormattedText; import nova.gui.render.text.TextRenderer; -import nova.gui.wrapper.mc17.MCCanvas; -import nova.gui.wrapper.mc17.text.IText.Text; +import nova.gui.wrapper.mc.forge.v1_7_10.MCCanvas; +import nova.gui.wrapper.mc.forge.v1_7_10.text.IText.Text; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import org.lwjgl.opengl.GL11; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/Paragraph.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/Paragraph.java old mode 100755 new mode 100644 similarity index 96% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/Paragraph.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/Paragraph.java index 115e520..645fe2d --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/Paragraph.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/Paragraph.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17.text; +package nova.gui.wrapper.mc.forge.v1_7_10.text; import com.google.common.collect.Lists; import net.minecraft.client.gui.FontRenderer; @@ -6,7 +6,7 @@ import nova.gui.render.text.FormattedText.TextFormat; import nova.gui.render.text.TextRenderer; import nova.gui.render.text.TextRenderer.RenderedText; -import nova.gui.wrapper.mc17.text.IText.Word; +import nova.gui.wrapper.mc.forge.v1_7_10.text.IText.Word; import org.lwjgl.opengl.GL11; import java.util.List; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/SimpleParagraph.java b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/SimpleParagraph.java old mode 100755 new mode 100644 similarity index 94% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/SimpleParagraph.java rename to minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/SimpleParagraph.java index 73f21b6..b054667 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/SimpleParagraph.java +++ b/minecraft/1.7/src/main/java/nova/gui/wrapper/mc/forge/v1_7_10/text/SimpleParagraph.java @@ -1,11 +1,11 @@ -package nova.gui.wrapper.mc17.text; +package nova.gui.wrapper.mc.forge.v1_7_10.text; import net.minecraft.client.gui.FontRenderer; import nova.gui.render.text.FormattedText; import nova.gui.render.text.FormattedText.TextFormat; import nova.gui.render.text.TextRenderer; import nova.gui.render.text.TextRenderer.RenderedText; -import nova.gui.wrapper.mc17.text.IText.Text; +import nova.gui.wrapper.mc.forge.v1_7_10.text.IText.Text; import org.lwjgl.opengl.GL11; class SimpleParagraph extends AbstractParagraph implements RenderedText { diff --git a/minecraft/1.8/build.gradle b/minecraft/1.8/build.gradle index 5cdba31..a25ae6b 100644 --- a/minecraft/1.8/build.gradle +++ b/minecraft/1.8/build.gradle @@ -42,8 +42,8 @@ minecraft { dependencies { compile rootProject - compile group: "nova.core", name: "NovaCore", version: property("novaVersion"), changing: true - compile "nova.wrapper.mc18:NovaWrapper-MC1.8:0.1-SNAPSHOT:deobf" + compile group: "nova.core", name: "NOVA-Core", version: property("nova_version"), changing: true + compile "nova.core:NOVA-Core-Wrapper-MC1.8:0.1.0-SNAPSHOT:deobf" } processResources { diff --git a/minecraft/1.8/gradle.properties b/minecraft/1.8/gradle.properties index 583a1a8..210e104 100644 --- a/minecraft/1.8/gradle.properties +++ b/minecraft/1.8/gradle.properties @@ -1,7 +1,10 @@ +group = nova.gui + minecraft.version = 1.8 forge.version = 11.14.3.1491 +forgeGradleVersion = 1.2-SNAPSHOT packaging = jar info.inceptionYear = 2015 -info.description = The NOVA-Minecraft Minecraft 1.8 wrapper. +info.description = The NOVA-GUI Minecraft 1.8 wrapper. info.organization.name = NOVA diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/DrawableGuiComponent.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/DrawableGuiComponent.java old mode 100755 new mode 100644 similarity index 92% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/DrawableGuiComponent.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/DrawableGuiComponent.java index 091a9eb..3d00618 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/DrawableGuiComponent.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/DrawableGuiComponent.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17; +package nova.gui.wrapper.mc.forge.v1_8; import nova.gui.nativeimpl.NativeGuiComponent; import nova.gui.render.Graphics; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/GuiUtils.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/GuiUtils.java similarity index 93% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/GuiUtils.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/GuiUtils.java index d4e6b2c..8d4bf43 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/GuiUtils.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/GuiUtils.java @@ -1,9 +1,9 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.util.ResourceLocation; -import nova.wrapper.mc18.launcher.NovaMinecraft; +import nova.core.wrapper.mc.forge.v18.launcher.NovaMinecraft; import org.lwjgl.opengl.GL11; public class GuiUtils { diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCButton.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCButton.java similarity index 98% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCButton.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCButton.java index a1bd637..a649f61 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCButton.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCButton.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCCanvas.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCCanvas.java similarity index 98% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCCanvas.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCCanvas.java index a678d7c..bbe61b1 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCCanvas.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCCanvas.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGui.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGui.java old mode 100755 new mode 100644 similarity index 97% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGui.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGui.java index 776801a..4a784ec --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGui.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGui.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; @@ -12,6 +12,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nova.core.network.Packet; +import nova.core.wrapper.mc.forge.v18.network.netty.MCNetworkManager; import nova.gui.Gui; import nova.gui.GuiComponent; import nova.gui.GuiEvent.MouseEvent.EnumMouseButton; @@ -20,10 +21,9 @@ import nova.gui.render.Canvas; import nova.gui.render.Graphics; import nova.gui.render.text.TextMetrics; -import nova.gui.wrapper.mc18.text.MCTextRenderer; +import nova.gui.wrapper.mc.forge.v1_8.text.MCTextRenderer; import nova.internal.core.Game; -import nova.gui.wrapper.mc18.network.PacketGui; -import nova.wrapper.mc18.network.netty.MCNetworkManager; +import nova.gui.wrapper.mc.forge.v1_8.network.PacketGui; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiComponent.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiComponent.java similarity index 95% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiComponent.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiComponent.java index 41376d6..34087b3 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiComponent.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiComponent.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import nova.gui.GuiComponent; import nova.gui.Outline; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiComponentFactory.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiComponentFactory.java similarity index 96% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiComponentFactory.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiComponentFactory.java index c1d8ce2..6edd12c 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiComponentFactory.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiComponentFactory.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import nova.gui.AbstractGuiContainer; import nova.gui.Gui; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiContainer.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiContainer.java similarity index 94% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiContainer.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiContainer.java index 0025e67..787f071 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiContainer.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiContainer.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import nova.gui.AbstractGuiContainer; import nova.gui.GuiComponent; @@ -6,7 +6,7 @@ import nova.gui.nativeimpl.NativeContainer; import nova.gui.render.Canvas; import nova.gui.render.Graphics; -import nova.gui.wrapper.mc18.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCContainer; import java.util.ArrayList; import java.util.List; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiFactory.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiFactory.java similarity index 85% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiFactory.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiFactory.java index 2420f9b..41fb007 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiFactory.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiFactory.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; @@ -8,14 +8,15 @@ import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; import nova.core.entity.Entity; +import nova.core.wrapper.mc.forge.v18.launcher.NovaMinecraft; +import nova.core.wrapper.mc.forge.v18.wrapper.entity.backward.BWEntity; import nova.gui.Gui; import nova.gui.GuiException; import nova.gui.factory.GuiFactory; import nova.gui.factory.GuiManager; -import nova.gui.wrapper.mc18.MCGui.MCContainer; -import nova.gui.wrapper.mc18.MCGui.MCGuiScreen; -import nova.wrapper.mc18.launcher.NovaMinecraft; -import nova.wrapper.mc18.wrapper.entity.BWEntity; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCGuiScreen; +import nova.internal.core.Game; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import java.util.ArrayList; @@ -27,6 +28,10 @@ public class MCGuiFactory extends GuiManager { private static Optional guiToOpen = Optional.empty(); private static List idMappedFactories = new ArrayList<>(); + public MCGuiFactory() { + super(Game.events()); + } + @Override public GuiFactory register(GuiFactory factory) { idMappedFactories.add(factory); @@ -35,8 +40,8 @@ public GuiFactory register(GuiFactory factory) { @Override public void showGui(String identifier, Entity entity, Vector3D pos) { - GuiFactory factory = getFactory(identifier).orElseThrow(() -> new GuiException(String.format("No GUI called %s registered!", identifier))); - Gui gui = factory.makeGUI(); + GuiFactory factory = registry.get(identifier).orElseThrow(() -> new GuiException(String.format("No GUI called %s registered!", identifier))); + Gui gui = factory.build(); showGui(gui, entity, pos, idMappedFactories.indexOf(factory)); } @@ -105,7 +110,7 @@ public GuiContainer getClientGuiElement(int id, EntityPlayer player, World world guiToOpen = Optional.empty(); } else { // Try to get the client side GUI from the id mapping - gui = idMappedFactories.get(id).makeGUI(); + gui = idMappedFactories.get(id).build(); } if (gui == null) { throw new GuiException("Couldn't get client side instance for the provided GUI of id " + id + " !"); diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiPlayerInventory.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiPlayerInventory.java similarity index 87% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiPlayerInventory.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiPlayerInventory.java index 7a81323..40231bf 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiPlayerInventory.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiPlayerInventory.java @@ -1,12 +1,12 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import net.minecraft.inventory.IInventory; +import nova.core.wrapper.mc.forge.v18.wrapper.inventory.BWInventory; import nova.gui.component.inventory.PlayerInventory; import nova.gui.nativeimpl.NativePlayerInventory; import nova.gui.render.Graphics; -import nova.gui.wrapper.mc18.MCGui.MCContainer; -import nova.gui.wrapper.mc18.MCGui.MCGuiScreen; -import nova.wrapper.mc18.wrapper.inventory.BWInventory; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCGuiScreen; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import java.util.ArrayList; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiSlot.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiSlot.java similarity index 92% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiSlot.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiSlot.java index bd7c588..7b1ffa1 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/MCGuiSlot.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/MCGuiSlot.java @@ -1,17 +1,17 @@ -package nova.gui.wrapper.mc18; +package nova.gui.wrapper.mc.forge.v1_8; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import nova.core.wrapper.mc.forge.v18.wrapper.inventory.FWInventory; +import nova.core.wrapper.mc.forge.v18.wrapper.item.ItemConverter; import nova.gui.component.inventory.Slot; import nova.gui.nativeimpl.NativeSlot; import nova.gui.render.Graphics; -import nova.gui.wrapper.mc18.MCGui.MCContainer; -import nova.gui.wrapper.mc18.MCGui.MCGuiScreen; -import nova.wrapper.mc18.wrapper.inventory.FWInventory; -import nova.wrapper.mc18.wrapper.item.ItemConverter; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCGuiScreen; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import org.lwjgl.opengl.GL11; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/dependency/GuiModule.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/dependency/GuiModule.java similarity index 66% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/dependency/GuiModule.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/dependency/GuiModule.java index b7757d9..046d83f 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/dependency/GuiModule.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/dependency/GuiModule.java @@ -1,9 +1,9 @@ -package nova.gui.wrapper.mc18.dependency; +package nova.gui.wrapper.mc.forge.v1_8.dependency; import nova.gui.factory.GuiComponentFactory; import nova.gui.factory.GuiManager; -import nova.gui.wrapper.mc18.MCGuiComponentFactory; -import nova.gui.wrapper.mc18.MCGuiFactory; +import nova.gui.wrapper.mc.forge.v1_8.MCGuiComponentFactory; +import nova.gui.wrapper.mc.forge.v1_8.MCGuiFactory; import se.jbee.inject.bind.BinderModule; public class GuiModule extends BinderModule { diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/launch/NovaGuiWrapper.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/launch/NovaGuiWrapper.java old mode 100755 new mode 100644 similarity index 74% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/launch/NovaGuiWrapper.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/launch/NovaGuiWrapper.java index 68b7219..43c856e --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/launch/NovaGuiWrapper.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/launch/NovaGuiWrapper.java @@ -1,13 +1,13 @@ -package nova.gui.wrapper.mc18.launch; +package nova.gui.wrapper.mc.forge.v1_8.launch; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nova.core.loader.Loadable; import nova.core.loader.Mod; -import nova.gui.wrapper.mc18.MCGuiFactory; -import nova.gui.wrapper.mc18.dependency.GuiModule; -import nova.wrapper.mc18.launcher.NovaMinecraft; +import nova.core.wrapper.mc.forge.v18.launcher.NovaMinecraft; +import nova.gui.wrapper.mc.forge.v1_8.MCGuiFactory; +import nova.gui.wrapper.mc.forge.v1_8.dependency.GuiModule; /** * The main class to initialize the Gui Plugin diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/network/PacketGui.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/network/PacketGui.java old mode 100755 new mode 100644 similarity index 81% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/network/PacketGui.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/network/PacketGui.java index a477f30..2f8ac05 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/network/PacketGui.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/network/PacketGui.java @@ -1,14 +1,14 @@ -package nova.gui.wrapper.mc18.network; +package nova.gui.wrapper.mc.forge.v1_8.network; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import net.minecraft.entity.player.EntityPlayer; import nova.core.network.Packet; +import nova.core.wrapper.mc.forge.v18.network.MCPacket; +import nova.core.wrapper.mc.forge.v18.network.discriminator.PacketAbstract; import nova.gui.GuiException; -import nova.wrapper.mc18.network.MCPacket; -import nova.wrapper.mc18.network.discriminator.PacketAbstract; -import nova.gui.wrapper.mc18.MCGui.MCContainer; +import nova.gui.wrapper.mc.forge.v1_8.MCGui.MCContainer; //TODO: This is NOT used. NO-OP public class PacketGui extends PacketAbstract { diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/AbstractParagraph.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/AbstractParagraph.java old mode 100755 new mode 100644 similarity index 95% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/AbstractParagraph.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/AbstractParagraph.java index 3aa85a2..c305533 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/AbstractParagraph.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/AbstractParagraph.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17.text; +package nova.gui.wrapper.mc.forge.v1_8.text; import nova.gui.render.text.TextRenderer.RenderedText; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; diff --git a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/IText.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/IText.java old mode 100755 new mode 100644 similarity index 98% rename from minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/IText.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/IText.java index 58aa5ee..6af3204 --- a/minecraft/1.7/src/main/java/nova/gui/wrapper/mc17/text/IText.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/IText.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc17.text; +package nova.gui.wrapper.mc.forge.v1_8.text; import net.minecraft.client.gui.FontRenderer; import nova.gui.render.text.FormattedText.TextFormat; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/MCTextRenderer.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/MCTextRenderer.java similarity index 95% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/MCTextRenderer.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/MCTextRenderer.java index 5e4ad7f..817a609 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/MCTextRenderer.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/MCTextRenderer.java @@ -1,12 +1,12 @@ -package nova.gui.wrapper.mc18.text; +package nova.gui.wrapper.mc.forge.v1_8.text; import net.minecraft.client.gui.FontRenderer; import nova.core.render.Color; import nova.core.util.math.MathUtil; import nova.gui.render.text.FormattedText; import nova.gui.render.text.TextRenderer; -import nova.gui.wrapper.mc18.MCCanvas; -import nova.gui.wrapper.mc18.text.IText.Text; +import nova.gui.wrapper.mc.forge.v1_8.MCCanvas; +import nova.gui.wrapper.mc.forge.v1_8.text.IText.Text; import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; import org.lwjgl.opengl.GL11; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/Paragraph.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/Paragraph.java similarity index 96% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/Paragraph.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/Paragraph.java index 1dcfcec..6d3d559 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/Paragraph.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/Paragraph.java @@ -1,4 +1,4 @@ -package nova.gui.wrapper.mc18.text; +package nova.gui.wrapper.mc.forge.v1_8.text; import com.google.common.collect.Lists; import net.minecraft.client.gui.FontRenderer; @@ -6,7 +6,7 @@ import nova.gui.render.text.FormattedText.TextFormat; import nova.gui.render.text.TextRenderer; import nova.gui.render.text.TextRenderer.RenderedText; -import nova.gui.wrapper.mc18.text.IText.Word; +import nova.gui.wrapper.mc.forge.v1_8.text.IText.Word; import org.lwjgl.opengl.GL11; import java.util.List; diff --git a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/SimpleParagraph.java b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/SimpleParagraph.java similarity index 94% rename from minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/SimpleParagraph.java rename to minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/SimpleParagraph.java index 2717818..4532eda 100644 --- a/minecraft/1.8/src/main/java/nova/gui/wrapper/mc18/text/SimpleParagraph.java +++ b/minecraft/1.8/src/main/java/nova/gui/wrapper/mc/forge/v1_8/text/SimpleParagraph.java @@ -1,11 +1,11 @@ -package nova.gui.wrapper.mc18.text; +package nova.gui.wrapper.mc.forge.v1_8.text; import net.minecraft.client.gui.FontRenderer; import nova.gui.render.text.FormattedText; import nova.gui.render.text.FormattedText.TextFormat; import nova.gui.render.text.TextRenderer; import nova.gui.render.text.TextRenderer.RenderedText; -import nova.gui.wrapper.mc18.text.IText.Text; +import nova.gui.wrapper.mc.forge.v1_8.text.IText.Text; import org.lwjgl.opengl.GL11; class SimpleParagraph extends AbstractParagraph implements RenderedText { diff --git a/minecraft/build.gradle b/minecraft/build.gradle index 2f4e064..905f27d 100644 --- a/minecraft/build.gradle +++ b/minecraft/build.gradle @@ -1,16 +1,19 @@ -buildscript{ - repositories{ - mavenCentral() - maven { - name "forge" - url "http://files.minecraftforge.net/maven" +subprojects { + buildscript { + repositories { + mavenCentral() + maven { + name "forge" + url "http://files.minecraftforge.net/maven" + } + maven { + name "sonatype" + url "https://oss.sonatype.org/content/repositories/snapshots/" + } } - maven { - name "sonatype" - url "https://oss.sonatype.org/content/repositories/snapshots/" + dependencies { + // Minecraft 1.11 requires newer ForgeGradle, while 1.7 and 1.8 require older. + classpath 'net.minecraftforge.gradle:ForgeGradle:' + property('forgeGradleVersion') } } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' - } } diff --git a/src/main/java/nova/gui/AbstractGuiContainer.java b/src/main/java/nova/gui/AbstractGuiContainer.java index fde7bd6..21de0a4 100644 --- a/src/main/java/nova/gui/AbstractGuiContainer.java +++ b/src/main/java/nova/gui/AbstractGuiContainer.java @@ -184,6 +184,7 @@ public O add(GuiComponent component, Object... properties) { /** * Resets the GuiContainer, removing all the components and layouts */ + @SuppressWarnings("unchecked") public void reset() { ((HashMap>) children.clone()).values().forEach(this::removeElement); } @@ -202,7 +203,7 @@ public O removeElement(GuiComponent component) { throw new GuiComponentException("Component couldn't be removed from parent container as it wasn't a child."); } component.triggerEvent(new ComponentEvent.RemoveEvent(component, this)); - children.remove(component); + children.remove(component.getID()); layout.remove(component); component.updateQualifiedName(); getNative().removeElement(component); diff --git a/src/main/java/nova/gui/ComponentEvent.java b/src/main/java/nova/gui/ComponentEvent.java index 8102e96..f6a177c 100644 --- a/src/main/java/nova/gui/ComponentEvent.java +++ b/src/main/java/nova/gui/ComponentEvent.java @@ -1,8 +1,8 @@ package nova.gui; -import nova.core.event.CancelableEvent; -import nova.core.event.EventListener; -import nova.core.event.SidedEventBus.SidedEvent; +import nova.core.event.bus.CancelableEvent; +import nova.core.event.bus.EventListener; +import nova.core.event.bus.SidedEventBus.SidedEvent; import nova.core.network.NetworkTarget.Side; import nova.core.network.Sync; import nova.gui.factory.GuiEventFactory; @@ -10,7 +10,7 @@ /** * Event created by {@link GuiComponent}. These events, opposed to * {@link GuiEvent}, aren't propagated to the child components. - * + * * @see SidedComponentEvent * @see ComponentEventListener * @see GuiComponent#triggerEvent(ComponentEvent) @@ -30,7 +30,7 @@ public ComponentEvent(GuiComponent component) { /** * Specify to indicate which id {@link Sync} will use when getting * serialized to a packet. - * + * * @return sync id */ public int getSyncID() { @@ -40,9 +40,9 @@ public int getSyncID() { /** * {@link EventListener} interface used by {@link GuiComponent} to specify * the component type. Preferred over using {@link #component} directly. - * + * * @author Vic Nightfall - * + * * @param * @param * @see GuiComponent#onEvent(ComponentEventListener, Class) @@ -65,7 +65,7 @@ public default void onEvent(EVENT event) { * {@link ComponentEvent} which can be sent over the network. Has to be * registered with * {@link GuiEventFactory#registerNetworkEvent(java.util.function.Function)} - * + * * @author Vic Nightfall */ public static class SidedComponentEvent extends ComponentEvent implements SidedEvent { diff --git a/src/main/java/nova/gui/Gui.java b/src/main/java/nova/gui/Gui.java index 91634b0..e28d6cb 100644 --- a/src/main/java/nova/gui/Gui.java +++ b/src/main/java/nova/gui/Gui.java @@ -2,8 +2,8 @@ import nova.core.entity.Entity; import nova.core.entity.component.Player; -import nova.core.inventory.Inventory; -import nova.core.inventory.component.InventoryPlayer; +import nova.core.component.inventory.Inventory; +import nova.core.component.inventory.InventoryPlayer; import nova.core.network.NetworkTarget.Side; import nova.core.network.Packet; import nova.gui.component.inventory.Slot; @@ -81,7 +81,7 @@ protected void dispatchNetworkEvent(ComponentEvent.SidedComponentEvent event, Gu */ public void bind(Entity entity, Vector3D position) { inventoryMap.clear(); - playerInventory = entity.get(Player.class).getInventory(); + playerInventory = entity.components.get(Player.class).getInventory(); onEvent(new GuiEvent.BindEvent(this, entity, position)); repaint(); } diff --git a/src/main/java/nova/gui/GuiComponent.java b/src/main/java/nova/gui/GuiComponent.java index 678d14b..0949184 100644 --- a/src/main/java/nova/gui/GuiComponent.java +++ b/src/main/java/nova/gui/GuiComponent.java @@ -1,9 +1,9 @@ package nova.gui; -import nova.core.event.EventBus; -import nova.core.event.EventListener; -import nova.core.event.SidedEventBus; -import nova.core.event.SidedEventBus.SidedEvent; +import nova.core.event.bus.EventBus; +import nova.core.event.bus.EventListener; +import nova.core.event.bus.SidedEventBus; +import nova.core.event.bus.SidedEventBus.SidedEvent; import nova.core.network.NetworkTarget.Side; import nova.core.network.Syncable; import nova.core.util.Identifiable; @@ -318,7 +318,7 @@ public void triggerEvent(ComponentEvent event) { // Internal listener public O onGuiEvent(EventListener listener, Class clazz) { - guiEventBus.add(listener, clazz); + guiEventBus.on(clazz).bind(listener); return (O) this; } @@ -328,7 +328,7 @@ public O onEvent(ComponentEvent.ComponentEventLis if (side == Side.SERVER && !hasIdentifierRecursive()) { throw new GuiComponentException("Components without unique identifier can't recieve events on the server side!"); } - componentEventBus.add(listener, clazz, side); + componentEventBus.on(clazz).bind(listener); return (O) this; } @@ -340,7 +340,7 @@ public O onEvent(EventListener listener, C if (side == Side.SERVER && !hasIdentifierRecursive()) { throw new GuiComponentException("Components without unique identifier can't recieve events on the server side!"); } - componentEventBus.add(listener, clazz, side); + componentEventBus.on(clazz).bind(listener); return (O) this; } diff --git a/src/main/java/nova/gui/GuiComponentException.java b/src/main/java/nova/gui/GuiComponentException.java index 2467db6..249f056 100644 --- a/src/main/java/nova/gui/GuiComponentException.java +++ b/src/main/java/nova/gui/GuiComponentException.java @@ -1,6 +1,8 @@ package nova.gui; public class GuiComponentException extends GuiException { + private static final long serialVersionUID = 2017_01_22L; + public GuiComponentException() { super(); } diff --git a/src/main/java/nova/gui/GuiEvent.java b/src/main/java/nova/gui/GuiEvent.java index 264207c..351073a 100644 --- a/src/main/java/nova/gui/GuiEvent.java +++ b/src/main/java/nova/gui/GuiEvent.java @@ -3,7 +3,7 @@ import nova.core.block.Block; import nova.core.entity.Entity; import nova.core.entity.component.Player; -import nova.core.event.CancelableEvent; +import nova.core.event.bus.CancelableEvent; import nova.core.game.InputManager; import nova.core.world.World; import nova.gui.render.Graphics; @@ -100,7 +100,7 @@ public BindEvent(Gui gui, Entity entity, Vector3D position) { this.gui = gui; this.entity = entity; this.position = position; - this.player = entity.get(Player.class); + this.player = entity.components.get(Player.class); this.world = entity.world(); this.block = world.getBlock(position); } diff --git a/src/main/java/nova/gui/GuiException.java b/src/main/java/nova/gui/GuiException.java index e86fb7a..ba2b7b2 100644 --- a/src/main/java/nova/gui/GuiException.java +++ b/src/main/java/nova/gui/GuiException.java @@ -1,8 +1,10 @@ package nova.gui; -import nova.core.util.NovaException; +import nova.core.util.exception.NovaException; public class GuiException extends NovaException { + private static final long serialVersionUID = 2017_01_22L; + public GuiException() { super(); } diff --git a/src/main/java/nova/gui/component/Button.java b/src/main/java/nova/gui/component/Button.java index fbf14df..59a83fa 100644 --- a/src/main/java/nova/gui/component/Button.java +++ b/src/main/java/nova/gui/component/Button.java @@ -34,6 +34,7 @@ private void onMousePressed(GuiEvent.MouseEvent event) { if (isMouseOver()) { triggerEvent(new ComponentEvent.ActionEvent(this)); } + break; default: break; } diff --git a/src/main/java/nova/gui/component/inventory/PlayerInventory.java b/src/main/java/nova/gui/component/inventory/PlayerInventory.java index 80edafa..0ffc551 100644 --- a/src/main/java/nova/gui/component/inventory/PlayerInventory.java +++ b/src/main/java/nova/gui/component/inventory/PlayerInventory.java @@ -1,6 +1,6 @@ package nova.gui.component.inventory; -import nova.core.inventory.component.InventoryPlayer; +import nova.core.component.inventory.InventoryPlayer; import nova.gui.GuiComponent; import nova.gui.GuiEvent; import nova.gui.nativeimpl.NativePlayerInventory; @@ -9,7 +9,7 @@ * Defines the standard player inventory. It automatically gets wrapped to the * player inventory and its appearance, size, and other properties might differ * from wrapper to wrapper. - * + * * @author Vic Nightfall */ public class PlayerInventory extends GuiComponent { diff --git a/src/main/java/nova/gui/component/inventory/Slot.java b/src/main/java/nova/gui/component/inventory/Slot.java index 806a62f..98bebff 100644 --- a/src/main/java/nova/gui/component/inventory/Slot.java +++ b/src/main/java/nova/gui/component/inventory/Slot.java @@ -1,8 +1,8 @@ package nova.gui.component.inventory; -import nova.core.inventory.Inventory; -import nova.core.inventory.InventoryException; -import nova.core.inventory.ItemFilter; +import nova.core.component.inventory.Inventory; +import nova.core.component.inventory.InventoryException; +import nova.core.component.inventory.ItemFilter; import nova.core.item.Item; import nova.gui.Gui; import nova.gui.GuiComponent; diff --git a/src/main/java/nova/gui/factory/GuiEventFactory.java b/src/main/java/nova/gui/factory/GuiEventFactory.java index 526feee..1501af5 100644 --- a/src/main/java/nova/gui/factory/GuiEventFactory.java +++ b/src/main/java/nova/gui/factory/GuiEventFactory.java @@ -1,6 +1,6 @@ package nova.gui.factory; -import nova.core.event.EventException; +import nova.core.event.bus.EventException; import nova.core.network.Packet; import nova.gui.ComponentEvent; import nova.gui.Gui; diff --git a/src/main/java/nova/gui/factory/GuiFactory.java b/src/main/java/nova/gui/factory/GuiFactory.java index 7d9c047..c617b59 100644 --- a/src/main/java/nova/gui/factory/GuiFactory.java +++ b/src/main/java/nova/gui/factory/GuiFactory.java @@ -1,22 +1,23 @@ package nova.gui.factory; -import nova.core.util.Factory; +import nova.core.util.registry.Factory; import nova.gui.Gui; import java.util.function.Function; import java.util.function.Supplier; -public class GuiFactory extends Factory { +public class GuiFactory extends Factory { - public GuiFactory(Function constructor) { - super(constructor); + public GuiFactory(String id, Supplier constructor) { + super(id, constructor); } - public GuiFactory(Supplier supplier) { - super(o -> supplier.get()); + public GuiFactory(String id, Supplier constructor, Function processor) { + super(id, constructor, processor); } - public Gui makeGUI(Object... args) { - return constructor.apply(args); + @Override + protected GuiFactory selfConstructor(String id, Supplier constructor, Function processor) { + return new GuiFactory(id, constructor, processor); } } diff --git a/src/main/java/nova/gui/factory/GuiManager.java b/src/main/java/nova/gui/factory/GuiManager.java index 6f07779..b17f5fd 100755 --- a/src/main/java/nova/gui/factory/GuiManager.java +++ b/src/main/java/nova/gui/factory/GuiManager.java @@ -1,13 +1,14 @@ package nova.gui.factory; import nova.core.entity.Entity; +import nova.core.event.bus.GlobalEvents; import nova.core.loader.Mod; import nova.core.network.NetworkTarget.IllegalSideException; import nova.core.network.NetworkTarget.Side; import nova.core.network.Sided; -import nova.core.util.Manager; -import nova.core.util.RegistrationException; -import nova.core.util.Registry; +import nova.core.util.exception.RegistrationException; +import nova.core.util.registry.FactoryManager; +import nova.core.util.registry.Registry; import nova.gui.Gui; import nova.gui.GuiEvent; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; @@ -19,13 +20,15 @@ import java.util.function.Function; import java.util.function.Supplier; -public abstract class GuiManager extends Manager { +public abstract class GuiManager extends FactoryManager { // TODO Move this into a seperate manager protected EnumMap> overlayRegistry = new EnumMap<>(GuiType.class); + private final GlobalEvents events; - public GuiManager() { + public GuiManager(GlobalEvents events) { super(new Registry<>()); + this.events = events; } @Deprecated @@ -36,14 +39,13 @@ public void registerOverlay(Gui gui, GuiType guiType) { overlayRegistry.get(guiType).add(gui); } - public GuiFactory register(Supplier supplier) { - return register(new GuiFactory(supplier)); + @Override + public GuiFactory register(String id, Supplier constructor) { + return register(new GuiFactory(id, constructor)); } - @Override - @Deprecated - public GuiFactory register(Function constructor) { - return register(new GuiFactory(constructor)); + public GuiFactory register(String id, Supplier constructor, Function processor) { + return register(new GuiFactory(id, constructor, processor)); } /** @@ -63,8 +65,8 @@ public GuiFactory register(Function constructor) { * @see #showGui(Gui, Entity, Vector3D) */ public void showGui(String identifier, Entity entity, Vector3D position) { - GuiFactory factory = getFactory(identifier).orElseThrow(() -> new RegistrationException(String.format("No GUI called %s registered!", identifier))); - showGui(factory.makeGUI(), entity, position); + GuiFactory factory = registry.get(identifier).orElseThrow(() -> new RegistrationException(String.format("No GUI called %s registered!", identifier))); + showGui(factory.build(), entity, position); } /** @@ -149,6 +151,17 @@ public GuiType getActiveGuiType() { return getActiveGui().isPresent() ? GuiType.CUSTOM : GuiType.NATIVE; } + @Override + public void init() { + this.events.publish(new Init(this)); + } + + public class Init extends ManagerEvent { + public Init(GuiManager manager) { + super(manager); + } + } + public static enum GuiType { INGAME, TITLE, OPTIONS, INGAME_OPTIONS, CRAFTING, NATIVE, CUSTOM } diff --git a/src/main/java/nova/gui/launch/NovaGui.java b/src/main/java/nova/gui/launch/NovaGui.java index c5e4c06..d79c317 100755 --- a/src/main/java/nova/gui/launch/NovaGui.java +++ b/src/main/java/nova/gui/launch/NovaGui.java @@ -3,7 +3,7 @@ import nova.core.game.InputManager; import nova.core.loader.Mod; import nova.core.network.NetworkManager; -import nova.core.util.LanguageManager; +import nova.core.util.registry.LanguageManager; import nova.gui.factory.GuiComponentFactory; /** diff --git a/src/main/java/nova/gui/layout/LayoutException.java b/src/main/java/nova/gui/layout/LayoutException.java index 8dbe25a..3a09fb7 100644 --- a/src/main/java/nova/gui/layout/LayoutException.java +++ b/src/main/java/nova/gui/layout/LayoutException.java @@ -1,8 +1,10 @@ package nova.gui.layout; -import nova.core.util.NovaException; +import nova.core.util.exception.NovaException; public class LayoutException extends NovaException { + private static final long serialVersionUID = 2017_01_22L; + public LayoutException() { super(); } diff --git a/src/main/java/nova/gui/render/Vertex2D.java b/src/main/java/nova/gui/render/Vertex2D.java index 2c06586..450892c 100644 --- a/src/main/java/nova/gui/render/Vertex2D.java +++ b/src/main/java/nova/gui/render/Vertex2D.java @@ -3,6 +3,7 @@ import org.apache.commons.math3.geometry.euclidean.twod.Vector2D; public class Vertex2D extends Vector2D { + private static final long serialVersionUID = 2017_01_22L; public final boolean uv; public final double u, v; From 5ec32ad5d9ba947c2ea40d4feaa96a77cabd1311 Mon Sep 17 00:00:00 2001 From: ExE Boss Date: Thu, 22 Dec 2016 10:07:42 +0100 Subject: [PATCH 2/2] NOVA-GUI Minecraft 1.11 Wrappers --- build.gradle | 4 + minecraft/.gitignore | 1 + minecraft/1.11/.gitignore | 17 + minecraft/1.11/build.gradle | 73 +++++ minecraft/1.11/gradle.properties | 9 + .../mc/forge/v1_11/DrawableGuiComponent.java | 21 ++ .../gui/wrapper/mc/forge/v1_11/GuiUtils.java | 34 ++ .../gui/wrapper/mc/forge/v1_11/MCButton.java | 101 ++++++ .../gui/wrapper/mc/forge/v1_11/MCCanvas.java | 134 ++++++++ .../gui/wrapper/mc/forge/v1_11/MCGui.java | 291 ++++++++++++++++++ .../mc/forge/v1_11/MCGuiComponent.java | 42 +++ .../mc/forge/v1_11/MCGuiComponentFactory.java | 33 ++ .../mc/forge/v1_11/MCGuiContainer.java | 55 ++++ .../wrapper/mc/forge/v1_11/MCGuiFactory.java | 126 ++++++++ .../mc/forge/v1_11/MCGuiPlayerInventory.java | 60 ++++ .../gui/wrapper/mc/forge/v1_11/MCGuiSlot.java | 124 ++++++++ .../mc/forge/v1_11/dependency/GuiModule.java | 15 + .../mc/forge/v1_11/launch/NovaGuiWrapper.java | 25 ++ .../mc/forge/v1_11/network/PacketGui.java | 46 +++ .../forge/v1_11/text/AbstractParagraph.java | 32 ++ .../wrapper/mc/forge/v1_11/text/IText.java | 101 ++++++ .../mc/forge/v1_11/text/MCTextRenderer.java | 104 +++++++ .../mc/forge/v1_11/text/Paragraph.java | 114 +++++++ .../mc/forge/v1_11/text/SimpleParagraph.java | 64 ++++ .../src/main/resources/META-INF/nova_at.cfg | 6 + settings.gradle | 1 + 26 files changed, 1633 insertions(+) create mode 100644 minecraft/1.11/.gitignore create mode 100644 minecraft/1.11/build.gradle create mode 100644 minecraft/1.11/gradle.properties create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/DrawableGuiComponent.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/GuiUtils.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCButton.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCCanvas.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCGui.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCGuiComponent.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCGuiComponentFactory.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCGuiContainer.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCGuiFactory.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCGuiPlayerInventory.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/MCGuiSlot.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/dependency/GuiModule.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/launch/NovaGuiWrapper.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/network/PacketGui.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/text/AbstractParagraph.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/text/IText.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/text/MCTextRenderer.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/text/Paragraph.java create mode 100644 minecraft/1.11/src/main/java/nova/gui/wrapper/mc/forge/v1_11/text/SimpleParagraph.java create mode 100644 minecraft/1.11/src/main/resources/META-INF/nova_at.cfg 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