From 2b9cca88f852f4555850a2b92836df2263a15e90 Mon Sep 17 00:00:00 2001 From: Dragon2488 Date: Mon, 21 Aug 2017 17:23:34 +0700 Subject: [PATCH] some description --- src/main/java/gregtech/api/gui/ModularUI.java | 13 ++++++++++++- src/main/java/gregtech/api/gui/UIFactory.java | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/gui/ModularUI.java b/src/main/java/gregtech/api/gui/ModularUI.java index f9dbaf92..d1e06e4f 100644 --- a/src/main/java/gregtech/api/gui/ModularUI.java +++ b/src/main/java/gregtech/api/gui/ModularUI.java @@ -9,7 +9,18 @@ import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public final class ModularUI { +/** + * ModularUI is user-interface implementation concrete, based on widgets system + * Each widget acts unique and manage different things + * All widget information is synced to client from server for correct rendering + * Widgets and UI are both-sided, so widgets should equal on both sides + * However widget data will sync, widgets themself, background, sizes and other important info will not + * To open and create ModularUI, see {@link UIFactory} + * + * + * @param type of modular UI holder + */ +public final class ModularUI { public final ImmutableBiMap guiWidgets; diff --git a/src/main/java/gregtech/api/gui/UIFactory.java b/src/main/java/gregtech/api/gui/UIFactory.java index a41be811..57e5ff59 100644 --- a/src/main/java/gregtech/api/gui/UIFactory.java +++ b/src/main/java/gregtech/api/gui/UIFactory.java @@ -14,6 +14,11 @@ import net.minecraft.network.PacketBuffer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +/** + * Implement and register to {@link #FACTORY_REGISTRY} to be able to create and open ModularUI's + * createUITemplate should return equal gui both on server and client side, or sync will break! + * @param UI holder type + */ public abstract class UIFactory { public static final GTControlledRegistry FACTORY_REGISTRY = new GTControlledRegistry<>(Short.MAX_VALUE);