@Environment(value=CLIENT) public class CraftingScreen extends HandledScreen<CraftingScreenHandler> implements RecipeBookProvider
| Modifier and Type | Field and Description |
|---|---|
private boolean |
narrow |
private static Identifier |
RECIPE_BUTTON_TEXTURE |
private RecipeBookWidget |
recipeBook |
private static Identifier |
TEXTURE |
BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, focusedSlot, handler, playerInventory, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, ybuttons, children, client, height, itemRenderer, passEvents, textRenderer, title, widthGUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE| Constructor and Description |
|---|
CraftingScreen(CraftingScreenHandler handler,
PlayerInventory inventory,
Text title) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
drawBackground(MatrixStack matrices,
float delta,
int mouseX,
int mouseY) |
RecipeBookWidget |
getRecipeBookWidget() |
protected void |
init()
Called when a screen should be initialized.
|
protected boolean |
isClickOutsideBounds(double mouseX,
double mouseY,
int left,
int top,
int button) |
protected boolean |
isPointWithinBounds(int xPosition,
int yPosition,
int width,
int height,
double pointX,
double pointY) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
protected void |
onMouseClick(Slot slot,
int invSlot,
int clickData,
SlotActionType actionType) |
void |
refreshRecipeBook() |
void |
removed() |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
void |
tick() |
drawForeground, drawMouseoverTooltip, getScreenHandler, handleHotbarKeyPressed, isPauseScreen, keyPressed, mouseDragged, mouseReleased, onCloseaddButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenErrorgetFocused, isDragging, setDragging, setFocuseddrawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchangeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseScrolled, setInitialFocusmouseMovedprivate static final Identifier TEXTURE
private static final Identifier RECIPE_BUTTON_TEXTURE
private final RecipeBookWidget recipeBook
private boolean narrow
public CraftingScreen(CraftingScreenHandler handler, PlayerInventory inventory, Text title)
protected void init()
This method is called when this screen is opened or resized.
init in class HandledScreen<CraftingScreenHandler>public void tick()
tick in interface TickableElementtick in class HandledScreen<CraftingScreenHandler>public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
render in interface Drawablerender in class HandledScreen<CraftingScreenHandler>protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY)
drawBackground in class HandledScreen<CraftingScreenHandler>protected boolean isPointWithinBounds(int xPosition,
int yPosition,
int width,
int height,
double pointX,
double pointY)
isPointWithinBounds in class HandledScreen<CraftingScreenHandler>public boolean mouseClicked(double mouseX,
double mouseY,
int button)
GLFW class.mouseClicked in interface ElementmouseClicked in interface ParentElementmouseClicked in class HandledScreen<CraftingScreenHandler>mouseX - the X coordinate of the mousemouseY - the Y coordinate of the mousebutton - the mouse button numbertrue to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int),
GLFW.GLFW_MOUSE_BUTTON_1protected boolean isClickOutsideBounds(double mouseX,
double mouseY,
int left,
int top,
int button)
isClickOutsideBounds in class HandledScreen<CraftingScreenHandler>protected void onMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType)
public void refreshRecipeBook()
refreshRecipeBook in interface RecipeBookProviderpublic void removed()
removed in class HandledScreen<CraftingScreenHandler>public RecipeBookWidget getRecipeBookWidget()
getRecipeBookWidget in interface RecipeBookProvider