some description
This commit is contained in:
parent
43dcc2cec2
commit
2b9cca88f8
2 changed files with 17 additions and 1 deletions
|
@ -9,7 +9,18 @@ import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public final class ModularUI<H> {
|
/**
|
||||||
|
* 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 <H> type of modular UI holder
|
||||||
|
*/
|
||||||
|
public final class ModularUI<H extends IUIHolder> {
|
||||||
|
|
||||||
public final ImmutableBiMap<Integer, Widget> guiWidgets;
|
public final ImmutableBiMap<Integer, Widget> guiWidgets;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,11 @@ import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
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 <E> UI holder type
|
||||||
|
*/
|
||||||
public abstract class UIFactory<E extends IUIHolder> {
|
public abstract class UIFactory<E extends IUIHolder> {
|
||||||
|
|
||||||
public static final GTControlledRegistry<UIFactory> FACTORY_REGISTRY = new GTControlledRegistry<>(Short.MAX_VALUE);
|
public static final GTControlledRegistry<UIFactory> FACTORY_REGISTRY = new GTControlledRegistry<>(Short.MAX_VALUE);
|
||||||
|
|
Loading…
Reference in a new issue