@Environment(value=CLIENT) public class LoomScreen extends HandledScreen<LoomScreenHandler>
Modifier and Type | Field and Description |
---|---|
private ItemStack |
banner |
private ModelPart |
bannerField |
private boolean |
canApplyDyePattern |
private boolean |
canApplySpecialPattern |
private ItemStack |
dye |
private List<com.mojang.datafixers.util.Pair<BannerPattern,DyeColor>> |
field_21841 |
private int |
firstPatternButtonId |
private boolean |
hasTooManyPatterns |
private ItemStack |
pattern |
private static int |
PATTERN_BUTTON_ROW_COUNT |
private boolean |
scrollbarClicked |
private float |
scrollPosition |
private static Identifier |
TEXTURE |
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 |
---|
LoomScreen(LoomScreenHandler handler,
PlayerInventory inventory,
Text title) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawBackground(MatrixStack matrices,
float delta,
int mouseX,
int mouseY) |
protected boolean |
isClickOutsideBounds(double mouseX,
double mouseY,
int left,
int top,
int button) |
private void |
method_22692(int int2,
int int3,
int int4) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
Callback for when a mouse button drag event
has been captured.
|
boolean |
mouseScrolled(double mouseX,
double mouseY,
double amount)
Callback for when a mouse button scroll event
has been captured.
|
private void |
onInventoryChanged() |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
drawForeground, drawMouseoverTooltip, getScreenHandler, handleHotbarKeyPressed, init, isPauseScreen, isPointWithinBounds, keyPressed, mouseReleased, onClose, onMouseClick, removed, tick
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, charTyped, focusOn, hoveredElement, keyReleased, setInitialFocus
mouseMoved
private static final Identifier TEXTURE
private static final int PATTERN_BUTTON_ROW_COUNT
private final ModelPart bannerField
@Nullable private List<com.mojang.datafixers.util.Pair<BannerPattern,DyeColor>> field_21841
private ItemStack banner
private ItemStack dye
private ItemStack pattern
private boolean canApplyDyePattern
private boolean canApplySpecialPattern
private boolean hasTooManyPatterns
private float scrollPosition
private boolean scrollbarClicked
private int firstPatternButtonId
public LoomScreen(LoomScreenHandler handler, PlayerInventory inventory, Text title)
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
render
in interface Drawable
render
in class HandledScreen<LoomScreenHandler>
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY)
drawBackground
in class HandledScreen<LoomScreenHandler>
private void method_22692(int int2, int int3, int int4)
public boolean mouseClicked(double mouseX, double mouseY, int button)
GLFW
class.mouseClicked
in interface Element
mouseClicked
in interface ParentElement
mouseClicked
in class HandledScreen<LoomScreenHandler>
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
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
GLFW
class.mouseDragged
in interface Element
mouseDragged
in interface ParentElement
mouseDragged
in class HandledScreen<LoomScreenHandler>
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 coordinatetrue
to indicate that the event handling is successful/validMouse.onCursorPos(long, double, double)
,
GLFW.GLFW_MOUSE_BUTTON_1
public boolean mouseScrolled(double mouseX, double mouseY, double amount)
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mouseamount
- value is > 1
if scrolled down, < 1
if scrolled uptrue
to indicate that the event handling is successful/validMouse.onMouseScroll(long, double, double)
protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button)
isClickOutsideBounds
in class HandledScreen<LoomScreenHandler>
private void onInventoryChanged()