diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java | 17 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java | 6 |
2 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java b/src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java index 1b8af53..3393cdd 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/CottonScreenController.java @@ -29,7 +29,7 @@ import net.minecraft.recipe.RecipeInputProvider; import net.minecraft.recipe.RecipeType; import net.minecraft.world.World; -public abstract class CottonScreenController extends CraftingContainer<Inventory> implements GuiDescription { +public class CottonScreenController extends CraftingContainer<Inventory> implements GuiDescription { protected Inventory blockInventory; protected PlayerInventory playerInventory; @@ -293,15 +293,18 @@ public abstract class CottonScreenController extends CraftingContainer<Inventory if (rootPanel!=null) rootPanel.onClick(x, y, button); } - /** - * Gets the PropertyDelegate associated with this Controller. - */ @Nullable + @Override public PropertyDelegate getPropertyDelegate() { - // TODO Auto-generated method stub return propertyDelegate; } + @Override + public GuiDescription setPropertyDelegate(PropertyDelegate delegate) { + this.propertyDelegate = delegate; + return this; + } + public WPlayerInvPanel createPlayerInventoryPanel() { return new WPlayerInvPanel(this.playerInventory); } @@ -364,7 +367,9 @@ public abstract class CottonScreenController extends CraftingContainer<Inventory } @Override - public abstract int getCraftingResultSlotIndex(); + public int getCraftingResultSlotIndex() { + return -1; + } @Override public int getCraftingWidth() { diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java index acb126c..bfae32f 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java @@ -1,10 +1,6 @@ package io.github.cottonmc.cotton.gui.widget; -import io.github.cottonmc.cotton.gui.client.BackgroundPainter; -import io.github.cottonmc.cotton.gui.client.LibGuiClient; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.widget.AbstractButtonWidget; import net.minecraft.client.sound.PositionedSoundInstance; @@ -60,7 +56,7 @@ public class WButton extends WWidget { color = 16777120; } - ScreenDrawing.drawCenteredWithShadow(label.asFormattedString(), x+(getWidth()/2), y+4, color); //LibGuiClient.config.darkMode ? darkmodeColor : color); + ScreenDrawing.drawCenteredWithShadow(label.asFormattedString(), x+(getWidth()/2), y + ((20 - 8) / 2), color); //LibGuiClient.config.darkMode ? darkmodeColor : color); } |