Class BookViewScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.BookViewScreen
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,TabOrderedElement
- Direct Known Subclasses:
LecternScreen
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PageButtonprivate static final intprivate static final intstatic final Identifierprivate BookViewScreen.BookAccessprivate intprivate List<FormattedCharSequence> Holds a copy of the page text, split into page width linesprivate intstatic final BookViewScreen.BookAccessprivate PageButtonprotected static final intprotected static final intprivate static final intprivate static final intprivate static final intstatic final intprivate static final intprivate static final Stylestatic final intstatic final intprivate Componentprivate final booleanDetermines if a sound is played when the page is turnedprotected static final intprotected static final intprivate static final ComponentFields inherited from class net.minecraft.client.gui.screens.Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width -
Constructor Summary
ConstructorsModifierConstructorDescriptionBookViewScreen(BookViewScreen.BookAccess pBookAccess) privateBookViewScreen(BookViewScreen.BookAccess pBookAccess, boolean pPlayTurnSound) -
Method Summary
Modifier and TypeMethodDescriptionprivate intprivate intprotected voidprotected voidprotected voidprotected booleanforcePage(int pPageNum) I'm not sure why this exists.private intprivate Componentprotected booleanhandleClickEvent(@Nullable ClickEvent pClickEvent) protected voidinit()booleanbooleankeyPressed(KeyEvent p_445531_) protected intbooleanmouseClicked(MouseButtonEvent p_446030_, boolean p_434370_) protected voidpageBack()protected voidvoidrender(GuiGraphics p_281997_, int p_281262_, int p_283321_, float p_282251_) Renders the graphical user interface (GUI) element.voidrenderBackground(GuiGraphics p_295678_, int p_296491_, int p_294260_, float p_294869_) voidsetBookAccess(BookViewScreen.BookAccess pBookAccess) booleansetPage(int pPageNum) Moves the book to the specified page and returns true if it exists,falseotherwise.private voidprivate voidvisitText(ActiveTextCollector pActiveTextCollector, boolean pContentOnly) Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isMouseOver, isPauseScreen, isValidCharacterForName, onClose, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removed, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
PAGE_INDICATOR_TEXT_Y_OFFSET
public static final int PAGE_INDICATOR_TEXT_Y_OFFSET- See Also:
-
PAGE_TEXT_X_OFFSET
public static final int PAGE_TEXT_X_OFFSET- See Also:
-
PAGE_TEXT_Y_OFFSET
public static final int PAGE_TEXT_Y_OFFSET- See Also:
-
BACKGROUND_TEXTURE_WIDTH
private static final int BACKGROUND_TEXTURE_WIDTH- See Also:
-
BACKGROUND_TEXTURE_HEIGHT
private static final int BACKGROUND_TEXTURE_HEIGHT- See Also:
-
TITLE
-
PAGE_TEXT_STYLE
-
EMPTY_ACCESS
-
BOOK_LOCATION
-
TEXT_WIDTH
protected static final int TEXT_WIDTH- See Also:
-
TEXT_HEIGHT
protected static final int TEXT_HEIGHT- See Also:
-
IMAGE_WIDTH
protected static final int IMAGE_WIDTH- See Also:
-
PAGE_INDICATOR_X_OFFSET
private static final int PAGE_INDICATOR_X_OFFSET- See Also:
-
IMAGE_HEIGHT
protected static final int IMAGE_HEIGHT- See Also:
-
PAGE_BUTTON_Y
private static final int PAGE_BUTTON_Y- See Also:
-
PAGE_BACK_BUTTON_X
private static final int PAGE_BACK_BUTTON_X- See Also:
-
PAGE_FORWARD_BUTTON_X
private static final int PAGE_FORWARD_BUTTON_X- See Also:
-
bookAccess
-
currentPage
private int currentPage -
cachedPageComponents
Holds a copy of the page text, split into page width lines -
cachedPage
private int cachedPage -
pageMsg
-
forwardButton
-
backButton
-
playTurnSound
private final boolean playTurnSoundDetermines if a sound is played when the page is turned
-
-
Constructor Details
-
BookViewScreen
-
BookViewScreen
public BookViewScreen() -
BookViewScreen
-
-
Method Details
-
setBookAccess
-
setPage
public boolean setPage(int pPageNum) Moves the book to the specified page and returns true if it exists,falseotherwise. -
forcePage
protected boolean forcePage(int pPageNum) I'm not sure why this exists. The function it calls is public and does all the work. -
init
protected void init() -
getNarrationMessage
- Overrides:
getNarrationMessagein classScreen
-
getPageNumberMessage
-
createMenuControls
protected void createMenuControls() -
createPageControlButtons
protected void createPageControlButtons() -
getNumPages
private int getNumPages() -
pageBack
protected void pageBack() -
pageForward
protected void pageForward() -
updateButtonVisibility
private void updateButtonVisibility() -
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen
-
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
p_281997_- the GuiGraphics object used for rendering.p_281262_- the x-coordinate of the mouse cursor.p_283321_- the y-coordinate of the mouse cursor.p_282251_- the partial tick time.
-
visitText
-
renderBackground
- Overrides:
renderBackgroundin classScreen
-
backgroundLeft
private int backgroundLeft() -
backgroundTop
private int backgroundTop() -
mouseClicked
-
handleClickEvent
-
closeContainerOnServer
protected void closeContainerOnServer() -
isInGameUi
public boolean isInGameUi()- Overrides:
isInGameUiin classScreen
-