@Environment(value=CLIENT) public class RecipeAlternativesWidget extends DrawableHelper implements Drawable, Element
Modifier and Type | Class and Description |
---|---|
(package private) class |
RecipeAlternativesWidget.AlternativeButtonWidget |
(package private) class |
RecipeAlternativesWidget.FurnaceAlternativeButtonWidget |
Modifier and Type | Field and Description |
---|---|
private List<RecipeAlternativesWidget.AlternativeButtonWidget> |
alternativeButtons |
private static Identifier |
BACKGROUND_TEXTURE |
private int |
buttonX |
private int |
buttonY |
private MinecraftClient |
client |
private boolean |
furnace |
private Recipe<?> |
lastClickedRecipe |
private RecipeResultCollection |
resultCollection |
private float |
time |
private boolean |
visible |
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
RecipeAlternativesWidget() |
Modifier and Type | Method and Description |
---|---|
boolean |
changeFocus(boolean lookForwards)
Changes the focusing element by cycling to the next/previous element.
|
Recipe<?> |
getLastClickedRecipe() |
RecipeResultCollection |
getResults() |
boolean |
isMouseOver(double mouseX,
double mouseY)
Checks if the mouse position is within the bound
of the element.
|
boolean |
isVisible() |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
private void |
renderGrid(MatrixStack matrixStack,
int int2,
int int3,
int int4,
int int5,
int int6,
int int7) |
void |
setVisible(boolean visible) |
void |
showAlternativesForResult(MinecraftClient client,
RecipeResultCollection results,
int buttonX,
int buttonY,
int areaCenterX,
int areaCenterY,
float delta) |
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
charTyped, keyPressed, keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled
private static final Identifier BACKGROUND_TEXTURE
private final List<RecipeAlternativesWidget.AlternativeButtonWidget> alternativeButtons
private boolean visible
private int buttonX
private int buttonY
private MinecraftClient client
private RecipeResultCollection resultCollection
private Recipe<?> lastClickedRecipe
private float time
private boolean furnace
public void showAlternativesForResult(MinecraftClient client, RecipeResultCollection results, int buttonX, int buttonY, int areaCenterX, int areaCenterY, float delta)
public boolean changeFocus(boolean lookForwards)
changeFocus
in interface Element
lookForwards
- true
to cycle forwards, otherwise cycle backwardstrue
to indicate that the event handling is successful/validpublic RecipeResultCollection getResults()
public Recipe<?> getLastClickedRecipe()
public boolean mouseClicked(double mouseX, double mouseY, int button)
GLFW
class.mouseClicked
in interface Element
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 isMouseOver(double mouseX, double mouseY)
isMouseOver
in interface Element
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousetrue
if the mouse is within the bound of the element, otherwise false
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
private void renderGrid(MatrixStack matrixStack, int int2, int int3, int int4, int int5, int int6, int int7)
public void setVisible(boolean visible)
public boolean isVisible()