aboutsummaryrefslogtreecommitdiff
path: root/GuiTest/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'GuiTest/src/main/java')
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/GuiBlockEntity.java3
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java2
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java7
3 files changed, 6 insertions, 6 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlockEntity.java b/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlockEntity.java
index c699b47..6a9f741 100644
--- a/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlockEntity.java
+++ b/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlockEntity.java
@@ -14,8 +14,9 @@ import net.minecraft.util.collection.DefaultedList;
import javax.annotation.Nullable;
public class GuiBlockEntity extends BlockEntity implements ImplementedInventory, NamedScreenHandlerFactory {
+ static final int INVENTORY_SIZE = 8;
- DefaultedList<ItemStack> items = DefaultedList.ofSize(8, ItemStack.EMPTY);
+ DefaultedList<ItemStack> items = DefaultedList.ofSize(INVENTORY_SIZE, ItemStack.EMPTY);
public GuiBlockEntity() {
super(LibGuiTest.GUI_BLOCKENTITY_TYPE);
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java
index 732494e..9d638e2 100644
--- a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java
+++ b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java
@@ -10,7 +10,7 @@ import net.minecraft.text.LiteralText;
public class TestDescription extends SyncedGuiDescription {
public TestDescription(ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) {
- super(type, syncId, playerInventory, getBlockInventory(context), null);
+ super(type, syncId, playerInventory, getBlockInventory(context, GuiBlockEntity.INVENTORY_SIZE), null);
WGridPanel root = (WGridPanel)this.getRootPanel();
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java
index bcc2584..85ad3cd 100644
--- a/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java
+++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java
@@ -1,10 +1,9 @@
package io.github.cottonmc.test.client;
-import java.util.List;
-
import io.github.cottonmc.cotton.gui.client.BackgroundPainter;
import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription;
import io.github.cottonmc.cotton.gui.client.ScreenDrawing;
+import io.github.cottonmc.cotton.gui.widget.TooltipBuilder;
import io.github.cottonmc.cotton.gui.widget.WGridPanel;
import io.github.cottonmc.cotton.gui.widget.WLabel;
import io.github.cottonmc.cotton.gui.widget.WSlider;
@@ -17,7 +16,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.LiteralText;
-import net.minecraft.text.StringRenderable;
import net.minecraft.util.Identifier;
public class TestClientGui extends LightweightGuiDescription {
@@ -38,8 +36,9 @@ public class TestClientGui extends LightweightGuiDescription {
WGridPanel root = new WGridPanel(22);
this.setRootPanel(root);
WLabel title = new WLabel(new LiteralText("Client Test Gui"), WLabel.DEFAULT_TEXT_COLOR) {
+ @Environment(EnvType.CLIENT)
@Override
- public void addTooltip(List<StringRenderable> tooltip) {
+ public void addTooltip(TooltipBuilder tooltip) {
tooltip.add(new LiteralText("Radical!"));
}
};