diff options
author | Falkreon <falkreon@gmail.com> | 2019-07-24 16:02:56 -0500 |
---|---|---|
committer | Falkreon <falkreon@gmail.com> | 2019-07-24 16:02:56 -0500 |
commit | bedee39321838f622080a77be10cc161aa3fc8e1 (patch) | |
tree | c4ca91572e95cb9982fd423cdee10bc5649d137a /src/main/java/io | |
parent | 092e6c13d05fbb3df4c4939171d56d72d344f891 (diff) | |
download | LibGui-bedee39321838f622080a77be10cc161aa3fc8e1.tar.gz LibGui-bedee39321838f622080a77be10cc161aa3fc8e1.tar.bz2 LibGui-bedee39321838f622080a77be10cc161aa3fc8e1.zip |
Fix abstract method woes, fix button text position
Diffstat (limited to 'src/main/java/io')
-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); } |