aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle4
-rw-r--r--gradle.properties10
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java37
3 files changed, 26 insertions, 25 deletions
diff --git a/build.gradle b/build.gradle
index e8e41d8..20e4bae 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,7 +15,7 @@ buildscript {
System.out.println(rootProject.name);
if (rootProject.name.equalsIgnoreCase("LibGUI")) {
System.out.println("Added libgui to classpath");
- classpath 'fabric-loom:fabric-loom.gradle.plugin:0.2.5-SNAPSHOT'
+ classpath 'fabric-loom:fabric-loom.gradle.plugin:0.2.6-SNAPSHOT'
}
}
}
@@ -51,7 +51,7 @@ repositories {
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
- mappings "net.fabricmc:yarn:${project.yarn_mappings}"
+ mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "io.github.cottonmc:Jankson-Fabric:${project.jankson_version}"
diff --git a/gradle.properties b/gradle.properties
index d568886..3bb175f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
- minecraft_version=19w46b
- yarn_mappings=19w46b+build.1
- loader_version=0.6.3+build.167
+ minecraft_version=1.15
+ yarn_mappings=1.15+build.2
+ loader_version=0.7.2+build.174
# Mod Properties
mod_version = 1.3.3-beta.7
@@ -13,5 +13,5 @@ org.gradle.jvmargs=-Xmx1G
archives_base_name = LibGui
# Dependencies
- fabric_version=0.4.12+build.261-1.15
- jankson_version=2.0.0+j1.2.0
+ fabric_version=0.4.24+build.279-1.15
+ jankson_version=2.0.1+j1.2.0
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
index 5e0cc09..2813c0f 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java
@@ -1,5 +1,6 @@
package io.github.cottonmc.cotton.gui.client;
+import net.minecraft.client.render.DiffuseLighting;
import org.lwjgl.glfw.GLFW;
import io.github.cottonmc.cotton.gui.CottonCraftingController;
@@ -7,7 +8,6 @@ import io.github.cottonmc.cotton.gui.widget.WPanel;
import io.github.cottonmc.cotton.gui.widget.WWidget;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
-import net.minecraft.client.render.GuiLighting;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
@@ -32,7 +32,8 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
*
* * "width" and "height" are the width and height of the overall screen
* * "containerWidth" and "containerHeight" are the width and height of the panel to render
- * * "left" and "top" are *actually* self-explanatory
+ * * ~~"left" and "top" are *actually* self-explanatory~~
+ * * "left" and "top" are now (1.15) "x" and "y". A bit less self-explanatory, I guess.
* * coordinates start at 0,0 at the topleft of the screen.
*/
@@ -57,8 +58,8 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
if (containerWidth<16) containerWidth=300;
if (containerHeight<16) containerHeight=300;
}
- left = (width / 2) - (containerWidth / 2);
- top = (height / 2) - (containerHeight / 2);
+ x = (width / 2) - (containerWidth / 2);
+ y = (height / 2) - (containerHeight / 2);
}
@Override
@@ -110,8 +111,8 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
@Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
boolean result = super.mouseClicked(mouseX, mouseY, mouseButton);
- int containerX = (int)mouseX-left;
- int containerY = (int)mouseY-top;
+ int containerX = (int)mouseX-x;
+ int containerY = (int)mouseY-y;
if (containerX<0 || containerY<0 || containerX>=width || containerY>=height) return result;
if (lastResponder==null) {
lastResponder = description.doMouseDown(containerX, containerY, mouseButton);
@@ -124,8 +125,8 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
@Override
public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) { //Testing shows that STATE IS ACTUALLY BUTTON
boolean result = super.mouseReleased(mouseX, mouseY, mouseButton);
- int containerX = (int)mouseX-left;
- int containerY = (int)mouseY-top;
+ int containerX = (int)mouseX-x;
+ int containerY = (int)mouseY-y;
if (lastResponder!=null) {
lastResponder.onMouseUp(containerX-lastResponder.getAbsoluteX(), containerY-lastResponder.getAbsoluteY(), mouseButton);
@@ -144,8 +145,8 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double unknown_1, double unknown_2) {
boolean result = super.mouseDragged(mouseX, mouseY, mouseButton, unknown_1, unknown_2);
- int containerX = (int)mouseX-left;
- int containerY = (int)mouseY-top;
+ int containerX = (int)mouseX-x;
+ int containerY = (int)mouseY-y;
if (lastResponder!=null) {
lastResponder.onMouseDrag(containerX-lastResponder.getAbsoluteX(), containerY-lastResponder.getAbsoluteY(), mouseButton);
@@ -162,8 +163,8 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
if (description.getRootPanel()==null) return super.mouseScrolled(mouseX, mouseY, amount);
WPanel root = description.getRootPanel();
- int containerX = (int)mouseX-left;
- int containerY = (int)mouseY-top;
+ int containerX = (int)mouseX-x;
+ int containerY = (int)mouseY-y;
WWidget child = root.hit(containerX, containerY);
child.onMouseScroll(containerX - child.getAbsoluteX(), containerY - child.getAbsoluteY(), amount);
@@ -179,12 +180,12 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
if (description!=null) {
WPanel root = description.getRootPanel();
if (root!=null) {
- root.paintBackground(left, top, mouseX-left, mouseY-top);
+ root.paintBackground(x, y, mouseX-x, mouseY-y);
}
}
if (getTitle() != null) {
- font.draw(getTitle().asFormattedString(), left, top, description.getTitleColor());
+ font.draw(getTitle().asFormattedString(), x, y, description.getTitleColor());
}
}
@@ -194,15 +195,15 @@ public class CottonInventoryScreen<T extends CottonCraftingController> extends A
paint(mouseX, mouseY);
super.render(mouseX, mouseY, partialTicks);
- GuiLighting.disable(); //Needed because super.render leaves dirty state
+ DiffuseLighting.disable(); //Needed because super.render leaves dirty state
if (description!=null) {
WPanel root = description.getRootPanel();
if (root!=null) {
- root.paintForeground(left, top, mouseX, mouseY);
+ root.paintForeground(x, y, mouseX, mouseY);
- WWidget hitChild = root.hit(mouseX-left, mouseY-top);
- if (hitChild!=null) hitChild.renderTooltip(left, top, mouseX-left, mouseY-top);
+ WWidget hitChild = root.hit(mouseX-x, mouseY-y);
+ if (hitChild!=null) hitChild.renderTooltip(x, y, mouseX-x, mouseY-y);
}
}