Class BookEditScreen
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.ingame.BookEditScreen
- All Implemented Interfaces:
Drawable,Element,ParentElement,TickableElement
@Environment(CLIENT) public class BookEditScreen extends Screen
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classBookEditScreen.Line(package private) static classBookEditScreen.PageContent(package private) static classBookEditScreen.Position -
Field Summary
Fields Modifier and Type Field Description private ButtonWidgetcancelButtonprivate intcurrentPageprivate booleandirtyprivate ButtonWidgetdoneButtonprivate SelectionManagerfield_24269private SelectionManagerfield_24270private Textfield_25891private Textfield_25892private static Textfield_25893private static Textfield_25894private static OrderedTextfield_25895private static OrderedTextfield_25896private ButtonWidgetfinalizeButtonprivate Handhandprivate ItemStackitemStackprivate intlastClickIndexprivate longlastClickTimeprivate PageTurnWidgetnextPageButtonprivate BookEditScreen.PageContentpageContentprivate List<String>pagesprivate PlayerEntityplayerprivate PageTurnWidgetpreviousPageButtonprivate ButtonWidgetsignButtonprivate booleansigningprivate inttickCounterprivate StringtitleFields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, client, height, itemRenderer, passEvents, textRenderer, widthFields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE -
Constructor Summary
Constructors Constructor Description BookEditScreen(PlayerEntity playerEntity, ItemStack itemStack, Hand hand) -
Method Summary
Modifier and Type Method Description private voidappendNewPage()booleancharTyped(char chr, int modifiers)Callback for when a character input has been captured.private intcountPages()private BookEditScreen.PageContentcreatePageContent()private voidfinalizeBook(boolean signBook)private StringgetCurrentPageContent()private BookEditScreen.PageContentgetPageContent()protected voidinit()Called when a screen should be initialized.private voidinvalidatePageContent()booleankeyPressed(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured.private booleankeyPressedSignMode(int keyCode, int scanCode, int modifiers)private voidmethod_27580(int int2)private voidmethod_27581(MatrixStack matrixStack, BookEditScreen.Position position, boolean bool)private BookEditScreen.Positionmethod_27582(BookEditScreen.Position position)private Rect2imethod_27583(BookEditScreen.Position position, BookEditScreen.Position position2)private voidmethod_27584(String string)private Rect2imethod_27585(String string, TextHandler textHandler, int int2, int int3, int int4, int int5)private voidmethod_27588(Rect2i[] rect2i)private voidmethod_27589(int int2)private BookEditScreen.Positionmethod_27590(BookEditScreen.Position position)private static intmethod_27591(int[] int2, int int3)private booleanmethod_27592(int int2, int int3, int int4)private Stringmethod_27595()private voidmethod_27597()private voidmethod_27598()private voidmethod_27872()booleanmouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured.booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)Callback for when a mouse button drag event has been captured.private voidmoveCursorToBottom()private voidmoveCursorToTop()private voidopenNextPage()private voidopenPreviousPage()voidremoved()private voidremoveEmptyPages()voidrender(MatrixStack matrices, int mouseX, int mouseY, float delta)private voidsetPageContent(String newContent)voidtick()private voidupdateButtons()Methods inherited from class net.minecraft.client.gui.screen.Screen
addButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onClose, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
mouseMovedMethods inherited from interface net.minecraft.client.gui.ParentElement
changeFocus, focusOn, hoveredElement, keyReleased, mouseReleased, mouseScrolled, setInitialFocus
-
Field Details
-
field_25893
-
field_25894
-
field_25895
-
field_25896
-
player
-
itemStack
-
dirty
private boolean dirty -
signing
private boolean signing -
tickCounter
private int tickCounter -
currentPage
private int currentPage -
pages
-
title
-
field_24269
-
field_24270
-
lastClickTime
private long lastClickTime -
lastClickIndex
private int lastClickIndex -
nextPageButton
-
previousPageButton
-
doneButton
-
signButton
-
finalizeButton
-
cancelButton
-
hand
-
pageContent
-
field_25891
-
field_25892
-
-
Constructor Details
-
BookEditScreen
-
-
Method Details
-
method_27584
-
method_27595
-
countPages
private int countPages() -
tick
public void tick()- Specified by:
tickin interfaceTickableElement- Overrides:
tickin classScreen
-
init
protected void init()Called when a screen should be initialized.This method is called when this screen is
openedor resized. -
openPreviousPage
private void openPreviousPage() -
openNextPage
private void openNextPage() -
removed
public void removed() -
updateButtons
private void updateButtons() -
removeEmptyPages
private void removeEmptyPages() -
finalizeBook
private void finalizeBook(boolean signBook) -
appendNewPage
private void appendNewPage() -
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers)Callback for when a key down event has been captured. The key code is identified by the constants inGLFWclass.- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement- Overrides:
keyPressedin classScreen- Parameters:
keyCode- the named key code of the event as described in theGLFWclassscanCode- the unique/platform-specific scan code of the keyboard inputmodifiers- a GLFW bitfield describing the modifier keys that are held down (see {@linkplain https://www.glfw.org/docs/3.3/group__mods.html GLFW Modifier key flags})- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Keyboard.onKey(long, int, int, int, int),GLFW.GLFW_KEY_Q,GLFWKeyCallbackI.invoke(long, int, int, int, int)
-
charTyped
public boolean charTyped(char chr, int modifiers)Callback for when a character input has been captured. The key code is identified by the constants inGLFWclass.- Parameters:
chr- the captured charactermodifiers- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Keyboard.onChar(long, int, int),GLFW.GLFW_KEY_Q,GLFWKeyCallbackI.invoke(long, int, int, int, int)
-
method_27592
private boolean method_27592(int int2, int int3, int int4) -
method_27597
private void method_27597() -
method_27598
private void method_27598() -
method_27580
private void method_27580(int int2) -
moveCursorToTop
private void moveCursorToTop() -
moveCursorToBottom
private void moveCursorToBottom() -
keyPressedSignMode
private boolean keyPressedSignMode(int keyCode, int scanCode, int modifiers) -
getCurrentPageContent
-
setPageContent
-
render
-
method_27581
-
method_27588
-
method_27582
-
method_27590
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button)Callback for when a mouse button down event has been captured. The button number is identified by the constants inGLFWclass.- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onMouseButton(long, int, int, int),GLFW.GLFW_MOUSE_BUTTON_1
-
method_27589
private void method_27589(int int2) -
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)Callback for when a mouse button drag event has been captured. The button number is identified by the constants inGLFWclass.- Parameters:
mouseX- the current X coordinate of the mousemouseY- the current Y coordinate of the mousebutton- the mouse button numberdeltaX- the difference of the current X with the previous X coordinatedeltaY- the difference of the current Y with the previous Y coordinate- Returns:
trueto indicate that the event handling is successful/valid- See Also:
Mouse.onCursorPos(long, double, double),GLFW.GLFW_MOUSE_BUTTON_1
-
getPageContent
-
invalidatePageContent
private void invalidatePageContent() -
method_27872
private void method_27872() -
createPageContent
-
method_27591
private static int method_27591(int[] int2, int int3) -
method_27585
private Rect2i method_27585(String string, TextHandler textHandler, int int2, int int3, int int4, int int5) -
method_27583
-