Class RealmsWorldSlotButton
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessage
net.minecraft.client.gui.components.AbstractButton
net.minecraft.client.gui.components.Button
com.mojang.realmsclient.gui.RealmsWorldSlotButton
- All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classNested classes/interfaces inherited from class Button
Button.Builder, Button.CreateNarration, Button.OnPress, Button.PlainNested classes/interfaces inherited from class AbstractWidget
AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Identifierstatic final Identifierstatic final Identifierstatic final Identifierprivate static final Componentprivate static final Identifierprivate final intprivate final StringWidgetprivate RealmsWorldSlotButton.Stateprivate static final Componentprivate static final ComponentFields inherited from class Button
BIG_WIDTH, createNarration, DEFAULT_HEIGHT, DEFAULT_NARRATION, DEFAULT_SPACING, DEFAULT_WIDTH, onPress, SMALL_WIDTHFields inherited from class AbstractButton
SPRITES, TEXT_MARGINFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionRealmsWorldSlotButton(int x, int y, int width, int height, int slotIndex, RealmsServer serverData, Button.OnPress onPress) -
Method Summary
Modifier and TypeMethodDescriptionvoidextractContents(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) private static RealmsWorldSlotButton.ActiongetAction(boolean activeSlot, boolean empty, boolean expired) getState()booleanisActive()setServerData(RealmsServer serverData) private voidsetTooltipAndNarration(RealmsWorldSlotButton.State state, @Nullable String minigameName) voidupdateSlotState(RealmsServer serverData) Methods inherited from class Button
builder, createNarrationMessage, onPress, updateWidgetNarrationMethods inherited from class AbstractButton
extractDefaultLabel, extractDefaultSprite, extractWidgetRenderState, keyPressed, onClick, setOverrideRenderHighlightedSpriteMethods inherited from class AbstractWidget.WithInactiveMessage
defaultInactiveMessage, getMessage, setMessageMethods inherited from class AbstractWidget
clearFGColor, defaultButtonNarrationText, extractRenderState, extractScrollingStringOverContents, getAlpha, getBottom, getFGColor, getHeight, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onDrag, onRelease, playButtonClickSound, playDownSound, setAlpha, setFGColor, setFocused, setHeight, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GuiEventListener
charTyped, getBorderForArrowNavigation, getCurrentFocusPath, keyReleased, mouseMoved, mouseScrolled, preeditUpdated, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratables
-
Field Details
-
SLOT_FRAME_SPRITE
-
EMPTY_SLOT_LOCATION
-
DEFAULT_WORLD_SLOT_1
-
DEFAULT_WORLD_SLOT_2
-
DEFAULT_WORLD_SLOT_3
-
SWITCH_TO_MINIGAME_SLOT_TOOLTIP
-
SWITCH_TO_WORLD_SLOT_TOOLTIP
-
MINIGAME
-
slotIndex
private final int slotIndex -
slotNameWidget
-
state
-
-
Constructor Details
-
RealmsWorldSlotButton
public RealmsWorldSlotButton(int x, int y, int width, int height, int slotIndex, RealmsServer serverData, Button.OnPress onPress)
-
-
Method Details
-
getState
-
setServerData
-
setTooltipAndNarration
private void setTooltipAndNarration(RealmsWorldSlotButton.State state, @Nullable String minigameName) -
getAction
private static RealmsWorldSlotButton.Action getAction(boolean activeSlot, boolean empty, boolean expired) -
isActive
public boolean isActive()- Specified by:
isActivein interfaceNarratableEntry- Overrides:
isActivein classAbstractWidget
-
extractContents
- Specified by:
extractContentsin classAbstractButton
-
updateSlotState
-