@Environment(value=CLIENT) public abstract class AbstractFurnaceScreen<T extends AbstractFurnaceScreenHandler> extends HandledScreen<T> implements RecipeBookProvider
Modifier and Type | Field and Description |
---|---|
private Identifier |
background |
private boolean |
narrow |
private static Identifier |
RECIPE_BUTTON_TEXTURE |
AbstractFurnaceRecipeBookScreen |
recipeBook |
BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, focusedSlot, handler, playerInventory, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, y
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, width
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
AbstractFurnaceScreen(T handler,
AbstractFurnaceRecipeBookScreen recipeBook,
PlayerInventory inventory,
Text title,
Identifier background) |
Modifier and Type | Method and Description |
---|---|
boolean |
charTyped(char chr,
int keyCode)
Callback for when a character input has been captured.
|
protected void |
drawBackground(MatrixStack matrices,
float delta,
int mouseX,
int mouseY) |
RecipeBookWidget |
getRecipeBookWidget() |
void |
init()
Called when a screen should be initialized.
|
protected boolean |
isClickOutsideBounds(double mouseX,
double mouseY,
int left,
int top,
int button) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
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, isPointWithinBounds, mouseDragged, mouseReleased, onClose
addButton, 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, wrapScreenError
getFocused, isDragging, setDragging, setFocused
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
changeFocus, focusOn, hoveredElement, keyReleased, mouseScrolled, setInitialFocus
mouseMoved
private static final Identifier RECIPE_BUTTON_TEXTURE
public final AbstractFurnaceRecipeBookScreen recipeBook
private boolean narrow
private final Identifier background
public AbstractFurnaceScreen(T handler, AbstractFurnaceRecipeBookScreen recipeBook, PlayerInventory inventory, Text title, Identifier background)
public void init()
This method is called when this screen is opened
or resized.
init
in class HandledScreen<T extends AbstractFurnaceScreenHandler>
public void tick()
tick
in interface TickableElement
tick
in class HandledScreen<T extends AbstractFurnaceScreenHandler>
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
render
in interface Drawable
render
in class HandledScreen<T extends AbstractFurnaceScreenHandler>
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY)
drawBackground
in class HandledScreen<T extends AbstractFurnaceScreenHandler>
public boolean mouseClicked(double mouseX, double mouseY, int button)
GLFW
class.mouseClicked
in interface Element
mouseClicked
in interface ParentElement
mouseClicked
in class HandledScreen<T extends AbstractFurnaceScreenHandler>
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_1
protected void onMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType)
public boolean keyPressed(int keyCode, int scanCode, int modifiers)
GLFW
class.keyPressed
in interface Element
keyPressed
in interface ParentElement
keyPressed
in class HandledScreen<T extends AbstractFurnaceScreenHandler>
keyCode
- the named key code of the event as described in the GLFW
classscanCode
- the unique/platform-specific scan code of the keyboard inputmodifiers
- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)true
to indicate that the event handling is successful/validKeyboard.onKey(long, int, int, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button)
isClickOutsideBounds
in class HandledScreen<T extends AbstractFurnaceScreenHandler>
public boolean charTyped(char chr, int keyCode)
GLFW
class.charTyped
in interface Element
charTyped
in interface ParentElement
chr
- the captured characterkeyCode
- the associated key codetrue
to indicate that the event handling is successful/validKeyboard.onChar(long, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
public void refreshRecipeBook()
refreshRecipeBook
in interface RecipeBookProvider
public RecipeBookWidget getRecipeBookWidget()
getRecipeBookWidget
in interface RecipeBookProvider
public void removed()
removed
in class HandledScreen<T extends AbstractFurnaceScreenHandler>