Class AbstractSectionWithTitle<T extends AbstractSectionWithTitle<T>>
java.lang.Object
net.mcexpanded.fancytabsections.Section.AbstractSectionWithTitle<T>
- All Implemented Interfaces:
Section<T>,StickySection
- Direct Known Subclasses:
SectionColored,SectionTextured
public abstract class AbstractSectionWithTitle<T extends AbstractSectionWithTitle<T>>
extends Object
implements Section<T>, StickySection
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanintintbooleannet.minecraft.network.chat.Componentintint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleannet.minecraft.world.item.ItemStackicon()If a display item has been set, use that, otherwise pass to supernet.minecraft.resources.ResourceLocationid()booleanisSticky()items()voidonReload(net.minecraft.core.RegistryAccess registryAccess) Triggers the displayItemFunction to set the ItemStack from RegistryAccessvoidrender(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.Font font, int topLeftX, int topLeftY) voidrenderTitle(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.Font font, int topLeftX, int topLeftY) setCentered(boolean centered) Makes the title of the section centered in the middle + offsetsetCollapsible(boolean collapsible) setDisplayItem(Function<net.minecraft.core.RegistryAccess, net.minecraft.world.item.ItemStack> item) Sets the display ItemStack.setItems(ConglomerateOfItems items) setOnRender(Runnable onRender) Runs code each timeSection.render(GuiGraphics, Font, int, int)is called for this Section.setOnRenderConsumer(Consumer<T> onRenderSection) Sets a consumer to run at the start ofSection.render(GuiGraphics, Font, int, int)is called for this Section.setRenderTitle(boolean renderTitle) Sets whether the title should render.setSticky(boolean sticky) Adjusts the offset at which to render the Title.setTextColor(int textColor) setTextOutline(int textOutline) setTextShadow(boolean textShadow) setTitle(net.minecraft.network.chat.Component component) setTitleOffset(int x, int y) Adjusts the offset at which to render the Title.net.minecraft.network.chat.Componenttitle()
-
Field Details
-
title
public net.minecraft.network.chat.Component title -
renderTitle
public boolean renderTitle -
titleOffsetX
public int titleOffsetX -
titleOffsetY
public int titleOffsetY -
textColor
public int textColor -
textOutline
public int textOutline -
textShadow
public boolean textShadow
-
-
Constructor Details
-
AbstractSectionWithTitle
public AbstractSectionWithTitle(net.minecraft.resources.ResourceLocation id)
-
-
Method Details
-
render
public void render(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.Font font, int topLeftX, int topLeftY) - Specified by:
renderin interfaceSection<T extends AbstractSectionWithTitle<T>>
-
renderTitle
public void renderTitle(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.Font font, int topLeftX, int topLeftY) -
setTitle
-
setTitle
-
setRenderTitle
Sets whether the title should render.- Since:
- 6.0
-
setDisplayItem
public T setDisplayItem(Function<net.minecraft.core.RegistryAccess, net.minecraft.world.item.ItemStack> item) Sets the display ItemStack.- Since:
- 6.0
-
onReload
public void onReload(net.minecraft.core.RegistryAccess registryAccess) Triggers the displayItemFunction to set the ItemStack from RegistryAccess- Specified by:
onReloadin interfaceSection<T extends AbstractSectionWithTitle<T>>- Since:
- 6.0
-
icon
public net.minecraft.world.item.ItemStack icon()If a display item has been set, use that, otherwise pass to super- Specified by:
iconin interfaceSection<T extends AbstractSectionWithTitle<T>>- Returns:
- A display icon for this section, to be used on the Section Index
- Since:
- 6.0
-
setTitleOffset
Adjusts the offset at which to render the Title. Default is (5, 5)- Since:
- 4.0
-
setCentered
Makes the title of the section centered in the middle + offset- Since:
- 5.0
-
setTextColor
-
setTextOutline
-
setTextShadow
-
setCollapsible
-
setItems
-
setSticky
Adjusts the offset at which to render the Title. Default is (5, 5)- Since:
- 5.0
-
setOnRender
Runs code each timeSection.render(GuiGraphics, Font, int, int)is called for this Section.- Since:
- 5.0
-
setOnRenderConsumer
Sets a consumer to run at the start ofSection.render(GuiGraphics, Font, int, int)is called for this Section.- Since:
- 6.0
-
id
public net.minecraft.resources.ResourceLocation id()- Specified by:
idin interfaceSection<T extends AbstractSectionWithTitle<T>>
-
title
public net.minecraft.network.chat.Component title()- Specified by:
titlein interfaceSection<T extends AbstractSectionWithTitle<T>>- Returns:
- A display title for this section, or null if it doesn't have one. Lets features that need a human-readable label (e.g. a jump list) work with any Section implementation, without needing to know its concrete type.
-
items
- Specified by:
itemsin interfaceSection<T extends AbstractSectionWithTitle<T>>
-
collapsible
public boolean collapsible()- Specified by:
collapsiblein interfaceSection<T extends AbstractSectionWithTitle<T>>
-
isSticky
public boolean isSticky()- Specified by:
isStickyin interfaceStickySection
-