Class McbsGoalGUI<T extends McbsGoal>
java.lang.Object
com.thecsdev.betterstats.api.mcbs.view.goal.McbsGoalGUI<T>
- Type Parameters:
T- TheMcbsGoaltype.
- Direct Known Subclasses:
McbsSivGoalGUI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull net.minecraft.client.gui.screens.ScreencreateEditScreen(@Nullable net.minecraft.client.gui.screens.Screen lastScreen, @NotNull McbsEditorFileTab editorTab, T goal) Creates aScreenthat presents an interface allowing the user to edit properties for anMcbsGoalof typeT.static final <T extends McbsGoal>
@Nullable McbsGoalGUI<T> findFor(@NotNull McbsGoalType<T> type) Finds and returns theMcbsGoalGUIinstance for a givenMcbsGoalType.static final <T extends McbsGoal>
@Nullable McbsGoalGUI<T> findFor(T goal) Finds and returns theMcbsGoalGUIinstance for a givenMcbsGoal.final @Nullable net.minecraft.resources.IdentifiergetKey()Returns theIdentifierkey for thisMcbsGoalGUIin theBClientRegistries.GOAL_GUIregistry, ornullif thisMcbsGoalGUIis not registered.final @NotNull McbsGoalType<T> getType()voidCreates GUI that visually acts as a goal's "icon", and then adds it to the providedTElement.booleanReturnstrueif and only ifcreateEditScreen(Screen, McbsEditorFileTab, McbsGoal)is intended to be used.
-
Constructor Details
-
McbsGoalGUI
- Throws:
NullPointerException
-
-
Method Details
-
getType
-
getKey
@Nullable public final @Nullable net.minecraft.resources.Identifier getKey()Returns theIdentifierkey for thisMcbsGoalGUIin theBClientRegistries.GOAL_GUIregistry, ornullif thisMcbsGoalGUIis not registered. -
initIcon
@Contract(pure=true) @Virtual public void initIcon(@Nullable T goal, @NotNull @NotNull com.thecsdev.commonmc.api.client.gui.TElement onto, int preferredPadding) throws NullPointerException Creates GUI that visually acts as a goal's "icon", and then adds it to the providedTElement.- Parameters:
goal- TheMcbsGoalinstance for which the icon is to be initialized.onto- The icon's background, aka the 'slot' where the icon is to be initialized.preferredPadding- The preferred padding to be applied around the icon.- Throws:
NullPointerException- If aNotNullargument isnull.
-
isEditable
@Contract(pure=true) @Virtual public boolean isEditable()Returnstrueif and only ifcreateEditScreen(Screen, McbsEditorFileTab, McbsGoal)is intended to be used.- Implementation Note:
- This method should return a constant value.
-
createEditScreen
@Contract(pure=true) @Virtual @NotNull public @NotNull net.minecraft.client.gui.screens.Screen createEditScreen(@Nullable @Nullable net.minecraft.client.gui.screens.Screen lastScreen, @NotNull @NotNull McbsEditorFileTab editorTab, @NotNull T goal) throws NullPointerException Creates aScreenthat presents an interface allowing the user to edit properties for anMcbsGoalof typeT.- Parameters:
lastScreen- TheScreenthat the returned screen will use as its "last screen".editorTab- TheMcbsEditorFileTabthat displayed the goals interface, where the user clicked to edit the givenMcbsGoal.goal- The goal whose properties are to be edited.- Throws:
NullPointerException- If aNotNullargument isnull.- Implementation Note:
- If
isEditable()returnsfalse, avoid overriding this method.
-
findFor
@Contract(pure=true) @Nullable public static final <T extends McbsGoal> @Nullable McbsGoalGUI<T> findFor(@NotNull T goal) throws NullPointerException Finds and returns theMcbsGoalGUIinstance for a givenMcbsGoal.- Type Parameters:
T- TheMcbsGoal.- Parameters:
goal- TheMcbsGoalto find the GUI for.- Throws:
NullPointerException- If the argument isnull.
-
findFor
@Contract(pure=true) @Nullable public static final <T extends McbsGoal> @Nullable McbsGoalGUI<T> findFor(@NotNull @NotNull McbsGoalType<T> type) throws NullPointerException Finds and returns theMcbsGoalGUIinstance for a givenMcbsGoalType.- Type Parameters:
T- TheMcbsGoaltype.- Parameters:
type- TheMcbsGoalTypeto find the GUI for.- Throws:
NullPointerException- If the argument isnull.
-