Package net.minecraft.client.gui.screen
Class ReadBookScreen
- java.lang.Object
-
- net.minecraft.client.gui.AbstractGui
-
- net.minecraft.client.gui.FocusableGui
-
- net.minecraft.client.gui.screen.Screen
-
- net.minecraft.client.gui.screen.ReadBookScreen
-
- All Implemented Interfaces:
IGuiEventListener
,INestedGuiEventHandler
,IRenderable
,IScreen
- Direct Known Subclasses:
LecternScreen
public class ReadBookScreen extends Screen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ReadBookScreen.IBookInfo
static class
ReadBookScreen.UnwrittenBookInfo
static class
ReadBookScreen.WrittenBookInfo
-
Field Summary
Fields Modifier and Type Field Description private ChangePageButton
backButton
static ResourceLocation
BOOK_LOCATION
private ReadBookScreen.IBookInfo
bookAccess
private int
cachedPage
private java.util.List<IReorderingProcessor>
cachedPageComponents
private int
currentPage
static ReadBookScreen.IBookInfo
EMPTY_ACCESS
private ChangePageButton
forwardButton
private ITextComponent
pageMsg
private boolean
playTurnSound
-
Fields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, font, height, itemRenderer, minecraft, passEvents, title, width
-
Fields inherited from class net.minecraft.client.gui.AbstractGui
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
-
-
Constructor Summary
Constructors Modifier Constructor Description ReadBookScreen()
ReadBookScreen(ReadBookScreen.IBookInfo p_i51098_1_)
private
ReadBookScreen(ReadBookScreen.IBookInfo p_i51099_1_, boolean p_i51099_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>
convertPages(CompoundNBT p_214157_0_)
protected void
createMenuControls()
protected void
createPageControlButtons()
protected boolean
forcePage(int p_214153_1_)
Style
getClickedComponentStyleAt(double p_238805_1_, double p_238805_3_)
private int
getNumPages()
boolean
handleComponentClicked(Style p_230455_1_)
protected void
init()
boolean
keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
boolean
mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
protected void
pageBack()
protected void
pageForward()
void
render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
void
setBookAccess(ReadBookScreen.IBookInfo p_214155_1_)
boolean
setPage(int p_214160_1_)
private void
updateButtonVisibility()
-
Methods inherited from class net.minecraft.client.gui.screen.Screen
addButton, addWidget, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onClose, onFilesDrop, removed, renderBackground, renderBackground, renderComponentHoverEffect, renderComponentTooltip, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderToolTip, renderWrappedToolTip, resize, sendMessage, sendMessage, shouldCloseOnEsc, tick, wrapScreenError
-
Methods inherited from class net.minecraft.client.gui.FocusableGui
getFocused, isDragging, setDragging, setFocused
-
Methods inherited from class net.minecraft.client.gui.AbstractGui
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraft.client.gui.IGuiEventListener
mouseMoved
-
Methods inherited from interface net.minecraft.client.gui.INestedGuiEventHandler
changeFocus, charTyped, getChildAt, keyReleased, magicalSpecialHackyFocus, mouseDragged, mouseReleased, mouseScrolled, setInitialFocus
-
-
-
-
Field Detail
-
EMPTY_ACCESS
public static final ReadBookScreen.IBookInfo EMPTY_ACCESS
-
BOOK_LOCATION
public static final ResourceLocation BOOK_LOCATION
-
bookAccess
private ReadBookScreen.IBookInfo bookAccess
-
currentPage
private int currentPage
-
cachedPageComponents
private java.util.List<IReorderingProcessor> cachedPageComponents
-
cachedPage
private int cachedPage
-
pageMsg
private ITextComponent pageMsg
-
forwardButton
private ChangePageButton forwardButton
-
backButton
private ChangePageButton backButton
-
playTurnSound
private final boolean playTurnSound
-
-
Constructor Detail
-
ReadBookScreen
public ReadBookScreen(ReadBookScreen.IBookInfo p_i51098_1_)
-
ReadBookScreen
public ReadBookScreen()
-
ReadBookScreen
private ReadBookScreen(ReadBookScreen.IBookInfo p_i51099_1_, boolean p_i51099_2_)
-
-
Method Detail
-
setBookAccess
public void setBookAccess(ReadBookScreen.IBookInfo p_214155_1_)
-
setPage
public boolean setPage(int p_214160_1_)
-
forcePage
protected boolean forcePage(int p_214153_1_)
-
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
public boolean keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
- Specified by:
keyPressed
in interfaceIGuiEventListener
- Specified by:
keyPressed
in interfaceINestedGuiEventHandler
- Overrides:
keyPressed
in classScreen
-
render
public void render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
- Specified by:
render
in interfaceIRenderable
- Overrides:
render
in classScreen
-
mouseClicked
public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
-
handleComponentClicked
public boolean handleComponentClicked(Style p_230455_1_)
- Overrides:
handleComponentClicked
in classScreen
-
getClickedComponentStyleAt
@Nullable public Style getClickedComponentStyleAt(double p_238805_1_, double p_238805_3_)
-
convertPages
public static java.util.List<java.lang.String> convertPages(CompoundNBT p_214157_0_)
-
-