aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/CottonCraftingController.java (renamed from src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java)10
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java6
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java b/src/main/java/io/github/cottonmc/cotton/gui/CottonCraftingController.java
index 0e95295..2b9edc2 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/CottonCraftingController.java
@@ -29,7 +29,7 @@ import net.minecraft.recipe.RecipeInputProvider;
import net.minecraft.recipe.RecipeType;
import net.minecraft.world.World;
-public class CottonScreenController extends CraftingContainer<Inventory> implements GuiDescription {
+public class CottonCraftingController extends CraftingContainer<Inventory> implements GuiDescription {
protected Inventory blockInventory;
protected PlayerInventory playerInventory;
@@ -43,7 +43,7 @@ public class CottonScreenController extends CraftingContainer<Inventory> impleme
protected WWidget focus;
- public CottonScreenController(RecipeType<?> recipeType, int syncId, PlayerInventory playerInventory) {
+ public CottonCraftingController(RecipeType<?> recipeType, int syncId, PlayerInventory playerInventory) {
super(null, syncId);
this.blockInventory = null;
this.playerInventory = playerInventory;
@@ -52,7 +52,7 @@ public class CottonScreenController extends CraftingContainer<Inventory> impleme
this.propertyDelegate = null;//new ArrayPropertyDelegate(1);
}
- public CottonScreenController(RecipeType<?> recipeType, int syncId, PlayerInventory playerInventory, Inventory blockInventory, PropertyDelegate propertyDelegate) {
+ public CottonCraftingController(RecipeType<?> recipeType, int syncId, PlayerInventory playerInventory, Inventory blockInventory, PropertyDelegate propertyDelegate) {
super(null, syncId);
this.blockInventory = blockInventory;
this.playerInventory = playerInventory;
@@ -70,12 +70,12 @@ public class CottonScreenController extends CraftingContainer<Inventory> impleme
return LibGuiClient.config.darkMode ? darkTitleColor : titleColor;
}
- public CottonScreenController setRootPanel(WPanel panel) {
+ public CottonCraftingController setRootPanel(WPanel panel) {
this.rootPanel = panel;
return this;
}
- public CottonScreenController setTitleColor(int color) {
+ public CottonCraftingController setTitleColor(int color) {
this.titleColor = color;
return this;
}
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 0be2ecd..b7acb28 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,6 +1,6 @@
package io.github.cottonmc.cotton.gui.client;
-import io.github.cottonmc.cotton.gui.CottonScreenController;
+import io.github.cottonmc.cotton.gui.CottonCraftingController;
import io.github.cottonmc.cotton.gui.widget.WPanel;
import io.github.cottonmc.cotton.gui.widget.WWidget;
import net.minecraft.client.MinecraftClient;
@@ -10,8 +10,8 @@ import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.util.Nameable;
-public class CottonInventoryScreen<T extends CottonScreenController> extends AbstractContainerScreen<T> {
- protected CottonScreenController container;
+public class CottonInventoryScreen<T extends CottonCraftingController> extends AbstractContainerScreen<T> {
+ protected CottonCraftingController container;
public static final int PADDING = 8;
protected WWidget lastResponder = null;
protected WWidget focus = null;
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java
index cda638d..960a6e6 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java
@@ -131,7 +131,7 @@ public abstract class WPanel extends WWidget {
y>=child.getY() &&
x<child.getX()+child.getWidth() &&
y<child.getY()+child.getHeight()) {
- return child.hit(x, y);
+ return child.hit(x-child.getX(), y-child.getY());
}
}
return this;