From 5a8a3011e4830dfadb080d2c821f12dc517b9152 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sun, 11 Jul 2021 13:25:07 +0300 Subject: Document SyncedGuiDescription constructors --- .../cottonmc/cotton/gui/SyncedGuiDescription.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java index f7b5688..b51e9ee 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java @@ -61,6 +61,13 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio protected WWidget focus; private Vec2i titlePos = new Vec2i(8, 6); + /** + * Constructs a new synced GUI description without a block inventory or a property delegate. + * + * @param type the {@link ScreenHandlerType} of this GUI description + * @param syncId the current sync ID + * @param playerInventory the player inventory of the player viewing this screen + */ public SyncedGuiDescription(ScreenHandlerType type, int syncId, PlayerInventory playerInventory) { super(type, syncId); this.blockInventory = null; @@ -68,8 +75,17 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio this.world = playerInventory.player.world; this.propertyDelegate = null;//new ArrayPropertyDelegate(1); } - - public SyncedGuiDescription(ScreenHandlerType type, int syncId, PlayerInventory playerInventory, Inventory blockInventory, PropertyDelegate propertyDelegate) { + + /** + * Constructs a new synced GUI description. + * + * @param type the {@link ScreenHandlerType} of this GUI description + * @param syncId the current sync ID + * @param playerInventory the player inventory of the player viewing this screen + * @param blockInventory the block inventory of a corresponding container block, or null if not found or applicable + * @param propertyDelegate a property delegate whose properties, if any, will automatically be {@linkplain #addProperties(PropertyDelegate) added} + */ + public SyncedGuiDescription(ScreenHandlerType type, int syncId, PlayerInventory playerInventory, @Nullable Inventory blockInventory, @Nullable PropertyDelegate propertyDelegate) { super(type, syncId); this.blockInventory = blockInventory; this.playerInventory = playerInventory; -- cgit