public abstract class SlotBase
extends net.minecraft.client.gui.widget.Widget
Modifier and Type | Field and Description |
---|---|
int |
amountScrolled |
int |
bottom |
protected static java.awt.Color |
COLOUR_BAR_ONE |
protected static java.awt.Color |
COLOUR_BAR_THREE |
protected static java.awt.Color |
COLOUR_BAR_TWO |
protected static int |
DEFAULT_SLOT_HEIGHT |
int |
height |
protected float |
initialClickY |
protected long |
lastClicked |
int |
left |
protected boolean |
opaque |
int |
right |
protected float |
scrollMultiplier |
int |
selectedElement |
protected int |
slotHeight |
int |
top |
int |
width |
Constructor and Description |
---|
SlotBase(int top,
int left,
int width,
int height,
boolean opaque) |
Modifier and Type | Method and Description |
---|---|
void |
bindAmountScrolled() |
protected void |
drawBackground(com.mojang.blaze3d.matrix.MatrixStack matrix)
Optionally draws a background behind the list.
|
protected abstract void |
drawSlot(com.mojang.blaze3d.matrix.MatrixStack matrix,
int index,
int x,
int yTop,
int yMiddle) |
protected abstract void |
elementClicked(int index,
boolean doubleClicked) |
protected abstract float[] |
get1Color() |
protected int[] |
get255Color() |
int |
getBottomIndex() |
int |
getCenterX()
Gets the x coordinate of the center of the list.
|
protected int |
getContentHeight() |
int |
getCurrentSlot(int par1,
int par2) |
int |
getElementPosition(int i) |
int |
getMouseOverIndex(int mouseX,
int mouseY)
Gets the index of the element that the cursor is currently over.
|
protected java.awt.Color |
getSelectionColor() |
protected abstract int |
getSize() |
int |
getTopIndex() |
boolean |
isElementVisible(int i) |
boolean |
isMouseOver(double x,
double y) |
boolean |
isMouseOver(int element,
int par1,
int par2) |
protected abstract boolean |
isSelected(int element) |
boolean |
mouseClicked(double mousePosX,
double mousePosY,
int button) |
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double dragX,
double dragY) |
boolean |
mouseScrolled(double mouseX,
double mouseY,
double delta) |
void |
mouseScrolled(int mousePosX,
int mousePosY,
double delta) |
void |
render(com.mojang.blaze3d.matrix.MatrixStack matrix,
int mousePosX,
int mousePosY,
float partialTicks) |
void |
scrollTo(int i) |
changeFocus, clearFGColor, clicked, createNarrationMessage, getFGColor, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isValidClickButton, mouseReleased, narrate, onClick, onDrag, onFocusedChanged, onRelease, playDownSound, queueNarration, renderBg, renderButton, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidth
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
protected static java.awt.Color COLOUR_BAR_ONE
protected static java.awt.Color COLOUR_BAR_TWO
protected static java.awt.Color COLOUR_BAR_THREE
protected static final int DEFAULT_SLOT_HEIGHT
public final int width
public final int height
public final int top
public final int bottom
public final int right
public final int left
public int amountScrolled
public int selectedElement
protected int slotHeight
protected float initialClickY
protected float scrollMultiplier
protected long lastClicked
protected boolean opaque
public SlotBase(int top, int left, int width, int height, boolean opaque)
protected abstract int getSize()
protected abstract void elementClicked(int index, boolean doubleClicked)
protected abstract boolean isSelected(int element)
protected int getContentHeight()
protected abstract void drawSlot(com.mojang.blaze3d.matrix.MatrixStack matrix, int index, int x, int yTop, int yMiddle)
protected abstract float[] get1Color()
protected java.awt.Color getSelectionColor()
protected int[] get255Color()
public int getCurrentSlot(int par1, int par2)
public boolean isMouseOver(int element, int par1, int par2)
public boolean isElementVisible(int i)
public int getTopIndex()
public int getBottomIndex()
public int getElementPosition(int i)
public void scrollTo(int i)
public void bindAmountScrolled()
public boolean isMouseOver(double x, double y)
isMouseOver
in interface net.minecraft.client.gui.IGuiEventListener
isMouseOver
in class net.minecraft.client.gui.widget.Widget
public boolean mouseScrolled(double mouseX, double mouseY, double delta)
public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
mouseDragged
in interface net.minecraft.client.gui.IGuiEventListener
mouseDragged
in class net.minecraft.client.gui.widget.Widget
public boolean mouseClicked(double mousePosX, double mousePosY, int button)
mouseClicked
in interface net.minecraft.client.gui.IGuiEventListener
mouseClicked
in class net.minecraft.client.gui.widget.Widget
public void render(com.mojang.blaze3d.matrix.MatrixStack matrix, int mousePosX, int mousePosY, float partialTicks)
render
in interface net.minecraft.client.gui.IRenderable
render
in class net.minecraft.client.gui.widget.Widget
public void mouseScrolled(int mousePosX, int mousePosY, double delta)
protected void drawBackground(com.mojang.blaze3d.matrix.MatrixStack matrix)
public int getMouseOverIndex(int mouseX, int mouseY)
mouseX
- The x coordinate of the cursor.mouseY
- The y coordinate of the cursor.public int getCenterX()