Package net.minecraft.client.gui.screen
Class EditBookScreen
- java.lang.Object
-
- net.minecraft.client.gui.AbstractGui
-
- net.minecraft.client.gui.FocusableGui
-
- net.minecraft.client.gui.screen.Screen
-
- net.minecraft.client.gui.screen.EditBookScreen
-
- All Implemented Interfaces:
IGuiEventListener
,INestedGuiEventHandler
,IRenderable
,IScreen
public class EditBookScreen extends Screen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
EditBookScreen.BookLine
(package private) static class
EditBookScreen.BookPage
(package private) static class
EditBookScreen.Point
-
Field Summary
Fields Modifier and Type Field Description private ChangePageButton
backButton
private static IReorderingProcessor
BLACK_CURSOR
private ItemStack
book
private Button
cancelButton
private int
currentPage
private EditBookScreen.BookPage
displayCache
private Button
doneButton
private static ITextComponent
EDIT_TITLE_LABEL
private static ITextComponent
FINALIZE_WARNING_LABEL
private Button
finalizeButton
private ChangePageButton
forwardButton
private int
frameTick
private static IReorderingProcessor
GRAY_CURSOR
private Hand
hand
private boolean
isModified
private boolean
isSigning
private long
lastClickTime
private int
lastIndex
private PlayerEntity
owner
private ITextComponent
ownerText
private TextInputUtil
pageEdit
private ITextComponent
pageMsg
private java.util.List<java.lang.String>
pages
private Button
signButton
private java.lang.String
title
private TextInputUtil
titleEdit
-
Fields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, font, height, itemRenderer, minecraft, passEvents, width
-
Fields inherited from class net.minecraft.client.gui.AbstractGui
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
-
-
Constructor Summary
Constructors Constructor Description EditBookScreen(PlayerEntity p_i51100_1_, ItemStack p_i51100_2_, Hand p_i51100_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
appendPageToBook()
private boolean
bookKeyPressed(int p_214230_1_, int p_214230_2_, int p_214230_3_)
private void
changeLine(int p_238755_1_)
boolean
charTyped(char p_231042_1_, int p_231042_2_)
private void
clearDisplayCache()
private void
clearDisplayCacheAfterPageChange()
private EditBookScreen.Point
convertLocalToScreen(EditBookScreen.Point p_238767_1_)
private EditBookScreen.Point
convertScreenToLocal(EditBookScreen.Point p_238758_1_)
private Rectangle2d
createPartialLineSelection(java.lang.String p_238761_1_, CharacterManager p_238761_2_, int p_238761_3_, int p_238761_4_, int p_238761_5_, int p_238761_6_)
private Rectangle2d
createSelection(EditBookScreen.Point p_238759_1_, EditBookScreen.Point p_238759_2_)
private void
eraseEmptyTrailingPages()
private static int
findLineFromPos(int[] p_238768_0_, int p_238768_1_)
private java.lang.String
getClipboard()
private java.lang.String
getCurrentPageText()
private EditBookScreen.BookPage
getDisplayCache()
private int
getNumPages()
protected void
init()
private void
keyDown()
private void
keyEnd()
private void
keyHome()
boolean
keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
private void
keyUp()
boolean
mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
boolean
mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_)
private void
pageBack()
private void
pageForward()
private EditBookScreen.BookPage
rebuildDisplayCache()
void
removed()
void
render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
private void
renderCursor(MatrixStack p_238756_1_, EditBookScreen.Point p_238756_2_, boolean p_238756_3_)
private void
renderHighlight(Rectangle2d[] p_238764_1_)
private void
saveChanges(boolean p_214198_1_)
private void
selectWord(int p_238765_1_)
private void
setClipboard(java.lang.String p_238760_1_)
private void
setCurrentPageText(java.lang.String p_214217_1_)
void
tick()
private boolean
titleKeyPressed(int p_214196_1_, int p_214196_2_, int p_214196_3_)
private void
updateButtonVisibility()
-
Methods inherited from class net.minecraft.client.gui.screen.Screen
addButton, addWidget, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onClose, onFilesDrop, renderBackground, renderBackground, renderComponentHoverEffect, renderComponentTooltip, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderToolTip, renderWrappedToolTip, resize, sendMessage, sendMessage, shouldCloseOnEsc, 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, getChildAt, keyReleased, magicalSpecialHackyFocus, mouseReleased, mouseScrolled, setInitialFocus
-
-
-
-
Field Detail
-
EDIT_TITLE_LABEL
private static final ITextComponent EDIT_TITLE_LABEL
-
FINALIZE_WARNING_LABEL
private static final ITextComponent FINALIZE_WARNING_LABEL
-
BLACK_CURSOR
private static final IReorderingProcessor BLACK_CURSOR
-
GRAY_CURSOR
private static final IReorderingProcessor GRAY_CURSOR
-
owner
private final PlayerEntity owner
-
book
private final ItemStack book
-
isModified
private boolean isModified
-
isSigning
private boolean isSigning
-
frameTick
private int frameTick
-
currentPage
private int currentPage
-
pages
private final java.util.List<java.lang.String> pages
-
title
private java.lang.String title
-
pageEdit
private final TextInputUtil pageEdit
-
titleEdit
private final TextInputUtil titleEdit
-
lastClickTime
private long lastClickTime
-
lastIndex
private int lastIndex
-
forwardButton
private ChangePageButton forwardButton
-
backButton
private ChangePageButton backButton
-
doneButton
private Button doneButton
-
signButton
private Button signButton
-
finalizeButton
private Button finalizeButton
-
cancelButton
private Button cancelButton
-
hand
private final Hand hand
-
displayCache
@Nullable private EditBookScreen.BookPage displayCache
-
pageMsg
private ITextComponent pageMsg
-
ownerText
private final ITextComponent ownerText
-
-
Constructor Detail
-
EditBookScreen
public EditBookScreen(PlayerEntity p_i51100_1_, ItemStack p_i51100_2_, Hand p_i51100_3_)
-
-
Method Detail
-
setClipboard
private void setClipboard(java.lang.String p_238760_1_)
-
getClipboard
private java.lang.String getClipboard()
-
getNumPages
private int getNumPages()
-
pageBack
private void pageBack()
-
pageForward
private void pageForward()
-
updateButtonVisibility
private void updateButtonVisibility()
-
eraseEmptyTrailingPages
private void eraseEmptyTrailingPages()
-
saveChanges
private void saveChanges(boolean p_214198_1_)
-
appendPageToBook
private void appendPageToBook()
-
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
-
charTyped
public boolean charTyped(char p_231042_1_, int p_231042_2_)
-
bookKeyPressed
private boolean bookKeyPressed(int p_214230_1_, int p_214230_2_, int p_214230_3_)
-
keyUp
private void keyUp()
-
keyDown
private void keyDown()
-
changeLine
private void changeLine(int p_238755_1_)
-
keyHome
private void keyHome()
-
keyEnd
private void keyEnd()
-
titleKeyPressed
private boolean titleKeyPressed(int p_214196_1_, int p_214196_2_, int p_214196_3_)
-
getCurrentPageText
private java.lang.String getCurrentPageText()
-
setCurrentPageText
private void setCurrentPageText(java.lang.String p_214217_1_)
-
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
-
renderCursor
private void renderCursor(MatrixStack p_238756_1_, EditBookScreen.Point p_238756_2_, boolean p_238756_3_)
-
renderHighlight
private void renderHighlight(Rectangle2d[] p_238764_1_)
-
convertScreenToLocal
private EditBookScreen.Point convertScreenToLocal(EditBookScreen.Point p_238758_1_)
-
convertLocalToScreen
private EditBookScreen.Point convertLocalToScreen(EditBookScreen.Point p_238767_1_)
-
mouseClicked
public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
-
selectWord
private void selectWord(int p_238765_1_)
-
mouseDragged
public boolean mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_)
-
getDisplayCache
private EditBookScreen.BookPage getDisplayCache()
-
clearDisplayCache
private void clearDisplayCache()
-
clearDisplayCacheAfterPageChange
private void clearDisplayCacheAfterPageChange()
-
rebuildDisplayCache
private EditBookScreen.BookPage rebuildDisplayCache()
-
findLineFromPos
private static int findLineFromPos(int[] p_238768_0_, int p_238768_1_)
-
createPartialLineSelection
private Rectangle2d createPartialLineSelection(java.lang.String p_238761_1_, CharacterManager p_238761_2_, int p_238761_3_, int p_238761_4_, int p_238761_5_, int p_238761_6_)
-
createSelection
private Rectangle2d createSelection(EditBookScreen.Point p_238759_1_, EditBookScreen.Point p_238759_2_)
-
-