Class ContainerScreenExtended<T extends ContainerExtended>
java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended<T>
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler
,net.minecraft.client.gui.components.events.GuiEventListener
,net.minecraft.client.gui.components.Widget
,net.minecraft.client.gui.screens.inventory.MenuAccess<T>
,IValueNotifiable
- Direct Known Subclasses:
ContainerScreenScrolling
public abstract class ContainerScreenExtended<T extends ContainerExtended>
extends net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
implements IValueNotifiable
An extended GUI container.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected T
protected int
protected int
protected net.minecraft.resources.ResourceLocation
Fields inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
hoveredSlot, imageHeight, imageWidth, INVENTORY_LOCATION, inventoryLabelX, inventoryLabelY, isQuickCrafting, leftPos, menu, playerInventoryTitle, quickCraftSlots, SLOT_ITEM_BLIT_OFFSET, slotColor, titleLabelX, titleLabelY, topPos
Fields inherited from class net.minecraft.client.gui.screens.Screen
font, height, itemRenderer, minecraft, passEvents, renderables, title, width
Fields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorsConstructorDescriptionContainerScreenExtended
(T container, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract net.minecraft.resources.ResourceLocation
protected net.minecraft.client.gui.components.Button.OnPress
createServerPressable
(String buttonId, net.minecraft.client.gui.components.Button.OnPress clientPressable) Call this to create a button pressable callback so that the container is notified as well, assuming it has a corresponding registeredIContainerButtonAction
registered in the container by the same button id.protected void
drawCurrentScreen
(com.mojang.blaze3d.vertex.PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) void
drawTooltip
(List<net.minecraft.network.chat.Component> lines, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y) protected int
protected int
int
net.minecraft.resources.ResourceLocation
Get the texture path of the GUI.int
net.minecraft.world.inventory.MenuType<?>
void
init()
boolean
isHovering
(int left, int top, int right, int bottom, double pointX, double pointY) boolean
isHovering
(net.minecraft.world.inventory.Slot slotIn, double mouseX, double mouseY) boolean
isPointInRegion
(Rectangle region, Point mouse) void
onUpdate
(int valueId, net.minecraft.nbt.CompoundTag value) Called by the server if the value has changed.protected void
Will send client-side onUpdate events for all stored valuesfinal void
render
(com.mojang.blaze3d.vertex.PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) protected void
renderBg
(com.mojang.blaze3d.vertex.PoseStack matrixStack, float f, int x, int y) Methods inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
checkHotbarKeyPressed, clearDraggingState, containerTick, getGuiLeft, getGuiTop, getMenu, getSlotColor, getSlotUnderMouse, getXSize, getYSize, hasClickedOutside, isPauseScreen, keyPressed, mouseClicked, mouseDragged, mouseReleased, onClose, removed, renderLabels, renderSlotHighlight, renderSlotHighlight, renderTooltip, slotClicked, tick
Methods inherited from class net.minecraft.client.gui.screens.Screen
addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, children, clearWidgets, findNarratableWidget, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrationEnabled, onFilesDrop, rebuildWidgets, removeWidget, renderBackground, renderBackground, renderComponentHoverEffect, renderComponentTooltip, renderComponentTooltip, renderComponentTooltip, renderComponentTooltip, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, shouldCloseOnEsc, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, wrapScreenError
Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocused
Methods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blitOutlineBlack, disableScissor, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, enableScissor, fill, fillGradient, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
changeFocus, charTyped, getChildAt, keyReleased, magicalSpecialHackyFocus, mouseScrolled, setInitialFocus
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMoved
-
Field Details
-
container
-
texture
protected net.minecraft.resources.ResourceLocation texture -
offsetX
protected int offsetX -
offsetY
protected int offsetY
-
-
Constructor Details
-
ContainerScreenExtended
public ContainerScreenExtended(T container, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title)
-
-
Method Details
-
constructGuiTexture
protected abstract net.minecraft.resources.ResourceLocation constructGuiTexture() -
getGuiTexture
public net.minecraft.resources.ResourceLocation getGuiTexture()Get the texture path of the GUI.- Returns:
- The path of the GUI for this block.
-
init
public void init()- Overrides:
init
in classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
-
render
public final void render(com.mojang.blaze3d.vertex.PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) - Specified by:
render
in interfacenet.minecraft.client.gui.components.Widget
- Overrides:
render
in classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
-
drawCurrentScreen
protected void drawCurrentScreen(com.mojang.blaze3d.vertex.PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) -
getBaseXSize
protected int getBaseXSize() -
getBaseYSize
protected int getBaseYSize() -
renderBg
protected void renderBg(com.mojang.blaze3d.vertex.PoseStack matrixStack, float f, int x, int y) - Specified by:
renderBg
in classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
-
isHovering
public boolean isHovering(net.minecraft.world.inventory.Slot slotIn, double mouseX, double mouseY) - Overrides:
isHovering
in classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
-
isHovering
public boolean isHovering(int left, int top, int right, int bottom, double pointX, double pointY) - Overrides:
isHovering
in classnet.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
-
isPointInRegion
-
drawTooltip
public void drawTooltip(List<net.minecraft.network.chat.Component> lines, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y) -
createServerPressable
protected net.minecraft.client.gui.components.Button.OnPress createServerPressable(String buttonId, @Nullable net.minecraft.client.gui.components.Button.OnPress clientPressable) Call this to create a button pressable callback so that the container is notified as well, assuming it has a corresponding registeredIContainerButtonAction
registered in the container by the same button id.- Parameters:
buttonId
- The button id.clientPressable
- An optional pressable that should be called client-side.- Returns:
- The created pressable.
-
onUpdate
public void onUpdate(int valueId, net.minecraft.nbt.CompoundTag value) Description copied from interface:IValueNotifiable
Called by the server if the value has changed.- Specified by:
onUpdate
in interfaceIValueNotifiable
- Parameters:
valueId
- The value id.value
- The new value.
-
refreshValues
protected void refreshValues()Will send client-side onUpdate events for all stored values -
getGuiLeftTotal
public int getGuiLeftTotal()- Returns:
- The total gui left offset.
-
getGuiTopTotal
public int getGuiTopTotal()- Returns:
- The total gui top offset.
-
getValueNotifiableType
public net.minecraft.world.inventory.MenuType<?> getValueNotifiableType()- Specified by:
getValueNotifiableType
in interfaceIValueNotifiable
- Returns:
- The container type.
-