public interface ITerminalStorageTabClient<S extends ITerminalStorageSlot>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_SLOT_OFFSET_X |
static int |
DEFAULT_SLOT_OFFSET_Y |
static int |
DEFAULT_SLOT_ROW_LENGTH |
static int |
DEFAULT_SLOT_VISIBLE_ROWS |
| Modifier and Type | Method and Description |
|---|---|
int |
computeDraggingQuantity(java.util.Set<net.minecraft.inventory.container.Slot> dragSlots,
int dragMode,
net.minecraft.item.ItemStack stack,
int quantity)
Calculate the quantity that will be added to the given stack based on the drag mode and the given list of slots.
|
int |
dragIntoSlot(net.minecraft.inventory.container.Container container,
int channel,
net.minecraft.inventory.container.Slot slot,
int quantity,
boolean simulate)
Drag the given quantity into the given slot with the currently active instance.
|
int |
getActiveSlotId() |
int |
getActiveSlotQuantity() |
default net.minecraft.util.ResourceLocation |
getBackgroundTexture() |
java.util.List<ITerminalButton<?,?,?>> |
getButtons() |
int[] |
getChannels() |
net.minecraft.item.ItemStack |
getIcon() |
java.lang.String |
getInstanceFilter(int channel)
Get the currently active filter.
|
net.minecraft.util.ResourceLocation |
getName() |
int |
getSlotCount(int channel)
Get the total number of slots in the given channel
|
default int |
getSlotOffsetX() |
default int |
getSlotOffsetY() |
default int |
getSlotRowLength() |
java.util.List<S> |
getSlots(int channel,
int offset,
int limit)
Get a subset of slots.
|
default int |
getSlotVisibleRows() |
java.lang.String |
getStatus(int channel) |
java.util.List<net.minecraft.util.text.ITextComponent> |
getTooltip() |
boolean |
handleClick(net.minecraft.inventory.container.Container container,
int channel,
int hoveringStorageSlot,
int mouseButton,
boolean hasClickedOutside,
boolean hasClickedInStorage,
int hoveredContainerSlot)
Called when a mouse click happens in a gui.
|
boolean |
isEnabled() |
boolean |
isSlotValidForDraggingInto(int channel,
net.minecraft.inventory.container.Slot slot)
Check if we can drag over the current slot with an active instance.
|
default void |
onCommonSlotRender(net.minecraft.client.gui.screen.inventory.ContainerScreen gui,
com.mojang.blaze3d.matrix.MatrixStack matrixStack,
ContainerScreenTerminalStorage.DrawLayer layer,
float partialTick,
int x,
int y,
int mouseX,
int mouseY,
int slot,
ITerminalStorageTabCommon tabCommon) |
void |
resetActiveSlot()
Unselect the active storage slot.
|
void |
setActiveSlotQuantity(int quantity)
Set the active quantity.
|
void |
setInstanceFilter(int channel,
java.lang.String filter)
Set a filter for instances in slots.
|
static final int DEFAULT_SLOT_OFFSET_X
static final int DEFAULT_SLOT_OFFSET_Y
static final int DEFAULT_SLOT_VISIBLE_ROWS
static final int DEFAULT_SLOT_ROW_LENGTH
net.minecraft.util.ResourceLocation getName()
ITerminalStorageTab.getName().net.minecraft.item.ItemStack getIcon()
java.util.List<net.minecraft.util.text.ITextComponent> getTooltip()
java.lang.String getInstanceFilter(int channel)
channel - The channel to get the filter for.void setInstanceFilter(int channel,
java.lang.String filter)
filter - A string-based filter, which could be a regex.channel - The channel to filter in.java.util.List<S> getSlots(int channel, int offset, int limit)
channel - A channel id.offset - A slot offset.limit - A slot limit.boolean isEnabled()
int getSlotCount(int channel)
channel - A channel id.java.lang.String getStatus(int channel)
channel - A channel id.int[] getChannels()
void resetActiveSlot()
boolean handleClick(net.minecraft.inventory.container.Container container,
int channel,
int hoveringStorageSlot,
int mouseButton,
boolean hasClickedOutside,
boolean hasClickedInStorage,
int hoveredContainerSlot)
container - The active container.channel - The active channel.hoveringStorageSlot - The storage slot id that is being hovered. -1 if none.mouseButton - The mouse button.hasClickedOutside - If the player has clicked outside the gui.hasClickedInStorage - If the player has clicked inside the storage space.
This can be true even if the storage slot is -1.hoveredContainerSlot - The container slot id that is being hovered. -1 if none.int getActiveSlotId()
int getActiveSlotQuantity()
void setActiveSlotQuantity(int quantity)
quantity - A quantity to set.java.util.List<ITerminalButton<?,?,?>> getButtons()
default int getSlotOffsetX()
default int getSlotOffsetY()
default int getSlotVisibleRows()
default int getSlotRowLength()
@Nullable default net.minecraft.util.ResourceLocation getBackgroundTexture()
default void onCommonSlotRender(net.minecraft.client.gui.screen.inventory.ContainerScreen gui,
com.mojang.blaze3d.matrix.MatrixStack matrixStack,
ContainerScreenTerminalStorage.DrawLayer layer,
float partialTick,
int x,
int y,
int mouseX,
int mouseY,
int slot,
ITerminalStorageTabCommon tabCommon)
boolean isSlotValidForDraggingInto(int channel,
net.minecraft.inventory.container.Slot slot)
channel - The active channel.slot - The slot to drag over.int computeDraggingQuantity(java.util.Set<net.minecraft.inventory.container.Slot> dragSlots,
int dragMode,
net.minecraft.item.ItemStack stack,
int quantity)
dragSlots - The list of slots to drag over.dragMode - The drag mode.stack - The stack to calculate the quantity for.quantity - The available quantity to drag.int dragIntoSlot(net.minecraft.inventory.container.Container container,
int channel,
net.minecraft.inventory.container.Slot slot,
int quantity,
boolean simulate)
container - The active container.channel - The active channel.slot - The slot to drag into.quantity - The quantity to insert.simulate - If insertion should only be simulated.