public abstract class ContainerScreen<T extends Container> extends Screen implements IHasContainer<T>
Modifier and Type | Field and Description |
---|---|
private Slot |
clickedSlot |
protected T |
container |
private Slot |
currentDragTargetSlot |
private boolean |
doubleClick |
private ItemStack |
draggedStack |
private long |
dragItemDropDelay |
protected boolean |
dragSplitting |
private int |
dragSplittingButton |
private int |
dragSplittingLimit |
private int |
dragSplittingRemnant |
protected java.util.Set<Slot> |
dragSplittingSlots |
protected int |
guiLeft |
protected int |
guiTop |
protected Slot |
hoveredSlot |
private boolean |
ignoreMouseUp |
static ResourceLocation |
INVENTORY_BACKGROUND |
private boolean |
isRightMouseClick |
private int |
lastClickButton |
private Slot |
lastClickSlot |
private long |
lastClickTime |
protected PlayerInventory |
playerInventory |
private ItemStack |
returningStack |
private Slot |
returningStackDestSlot |
private long |
returningStackTime |
private ItemStack |
shiftClickedSlot |
protected int |
slotColor |
private int |
touchUpX |
private int |
touchUpY |
protected int |
xSize |
protected int |
ySize |
buttons, children, font, height, itemRenderer, minecraft, passEvents, title, width
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
Constructor and Description |
---|
ContainerScreen(T screenContainer,
PlayerInventory inv,
ITextComponent titleIn) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
drawGuiContainerBackgroundLayer(float partialTicks,
int mouseX,
int mouseY) |
protected void |
drawGuiContainerForegroundLayer(int mouseX,
int mouseY) |
private void |
drawItemStack(ItemStack stack,
int x,
int y,
java.lang.String altText) |
private void |
drawSlot(Slot slotIn) |
protected boolean |
func_195363_d(int keyCode,
int scanCode) |
T |
getContainer() |
int |
getGuiLeft() |
int |
getGuiTop() |
private Slot |
getSelectedSlot(double mouseX,
double mouseY) |
int |
getSlotColor(int index) |
Slot |
getSlotUnderMouse() |
int |
getXSize() |
int |
getYSize() |
protected void |
handleMouseClick(Slot slotIn,
int slotId,
int mouseButton,
ClickType type) |
protected boolean |
hasClickedOutside(double mouseX,
double mouseY,
int guiLeftIn,
int guiTopIn,
int mouseButton) |
protected void |
init() |
boolean |
isPauseScreen() |
protected boolean |
isPointInRegion(int x,
int y,
int width,
int height,
double mouseX,
double mouseY) |
private boolean |
isSlotSelected(Slot slotIn,
double mouseX,
double mouseY) |
boolean |
keyPressed(int p_keyPressed_1_,
int p_keyPressed_2_,
int p_keyPressed_3_) |
boolean |
mouseClicked(double p_mouseClicked_1_,
double p_mouseClicked_3_,
int p_mouseClicked_5_) |
boolean |
mouseDragged(double p_mouseDragged_1_,
double p_mouseDragged_3_,
int p_mouseDragged_5_,
double p_mouseDragged_6_,
double p_mouseDragged_8_) |
boolean |
mouseReleased(double p_mouseReleased_1_,
double p_mouseReleased_3_,
int p_mouseReleased_5_) |
void |
removed() |
void |
render(int p_render_1_,
int p_render_2_,
float p_render_3_) |
protected void |
renderHoveredToolTip(int mouseX,
int mouseY) |
boolean |
shouldCloseOnEsc() |
void |
tick() |
private void |
updateDragSplitting() |
addButton, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onClose, renderBackground, renderBackground, renderComponentHoverEffect, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, setSize, wrapScreenError
getFocused, isDragging, setDragging, setFocused
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fill, fillGradient, getBlitOffset, hLine, innerBlit, setBlitOffset, vLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
changeFocus, charTyped, func_212932_b, getEventListenerForPos, keyReleased, mouseScrolled, setFocusedDefault
mouseMoved
public static final ResourceLocation INVENTORY_BACKGROUND
protected int xSize
protected int ySize
protected final PlayerInventory playerInventory
protected int guiLeft
protected int guiTop
protected Slot hoveredSlot
private Slot clickedSlot
private boolean isRightMouseClick
private ItemStack draggedStack
private int touchUpX
private int touchUpY
private Slot returningStackDestSlot
private long returningStackTime
private ItemStack returningStack
private Slot currentDragTargetSlot
private long dragItemDropDelay
protected final java.util.Set<Slot> dragSplittingSlots
protected boolean dragSplitting
private int dragSplittingLimit
private int dragSplittingButton
private boolean ignoreMouseUp
private int dragSplittingRemnant
private long lastClickTime
private Slot lastClickSlot
private int lastClickButton
private boolean doubleClick
private ItemStack shiftClickedSlot
protected int slotColor
public ContainerScreen(T screenContainer, PlayerInventory inv, ITextComponent titleIn)
public void render(int p_render_1_, int p_render_2_, float p_render_3_)
render
in interface IRenderable
render
in class Screen
protected void renderHoveredToolTip(int mouseX, int mouseY)
private void drawItemStack(ItemStack stack, int x, int y, java.lang.String altText)
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
protected abstract void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
private void drawSlot(Slot slotIn)
private void updateDragSplitting()
private Slot getSelectedSlot(double mouseX, double mouseY)
public boolean mouseClicked(double p_mouseClicked_1_, double p_mouseClicked_3_, int p_mouseClicked_5_)
mouseClicked
in interface IGuiEventListener
mouseClicked
in interface INestedGuiEventHandler
protected boolean hasClickedOutside(double mouseX, double mouseY, int guiLeftIn, int guiTopIn, int mouseButton)
public boolean mouseDragged(double p_mouseDragged_1_, double p_mouseDragged_3_, int p_mouseDragged_5_, double p_mouseDragged_6_, double p_mouseDragged_8_)
mouseDragged
in interface IGuiEventListener
mouseDragged
in interface INestedGuiEventHandler
public boolean mouseReleased(double p_mouseReleased_1_, double p_mouseReleased_3_, int p_mouseReleased_5_)
mouseReleased
in interface IGuiEventListener
mouseReleased
in interface INestedGuiEventHandler
private boolean isSlotSelected(Slot slotIn, double mouseX, double mouseY)
protected boolean isPointInRegion(int x, int y, int width, int height, double mouseX, double mouseY)
protected void handleMouseClick(Slot slotIn, int slotId, int mouseButton, ClickType type)
public boolean shouldCloseOnEsc()
shouldCloseOnEsc
in class Screen
public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_)
keyPressed
in interface IGuiEventListener
keyPressed
in interface INestedGuiEventHandler
keyPressed
in class Screen
protected boolean func_195363_d(int keyCode, int scanCode)
public boolean isPauseScreen()
isPauseScreen
in class Screen
public T getContainer()
getContainer
in interface IHasContainer<T extends Container>
@Nullable public Slot getSlotUnderMouse()
public int getGuiLeft()
public int getGuiTop()
public int getXSize()
public int getYSize()
public int getSlotColor(int index)