Class ContainerScreenExtended<T extends ContainerExtended>

java.lang.Object
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.Renderable, net.minecraft.client.gui.components.TabOrderedElement, 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

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    BACKGROUND_LOCATION, font, height, minecraft, renderables, screenExecutor, title, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContainerScreenExtended(T container, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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 registered IContainerButtonAction registered in the container by the same button id.
    protected void
    drawCurrentScreen(net.minecraft.client.gui.GuiGraphics guiGraphics, 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
     
    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
     
    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 values
    final void
    render(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks)
     
    protected void
    renderBg(net.minecraft.client.gui.GuiGraphics guiGraphics, 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, getTooltipFromContainerItem, getXSize, getYSize, handleSlotStateChanged, hasClickedOutside, isPauseScreen, keyPressed, mouseClicked, mouseDragged, mouseReleased, onClose, removed, renderBackground, renderLabels, renderSlot, renderSlotHighlight, renderSlotHighlight, renderTooltip, slotClicked, tick

    Methods inherited from class net.minecraft.client.gui.screens.Screen

    added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrationEnabled, onFilesDrop, rebuildWidgets, removeWidget, renderDirtBackground, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, wrapScreenError

    Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    getFocused, isDragging, setDragging, setFocused

    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

    charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, magicalSpecialHackyFocus, mouseScrolled, nextFocusPath, setFocused

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    mouseMoved

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

    • container

      protected T extends ContainerExtended 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 class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
    • render

      public final void render(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks)
      Specified by:
      render in interface net.minecraft.client.gui.components.Renderable
      Overrides:
      render in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
    • drawCurrentScreen

      protected void drawCurrentScreen(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks)
    • getBaseXSize

      protected int getBaseXSize()
    • getBaseYSize

      protected int getBaseYSize()
    • renderBg

      protected void renderBg(net.minecraft.client.gui.GuiGraphics guiGraphics, float f, int x, int y)
      Specified by:
      renderBg in class net.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 class net.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 class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends ContainerExtended>
    • isPointInRegion

      public boolean isPointInRegion(Rectangle region, Point mouse)
    • 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 registered IContainerButtonAction 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 interface IValueNotifiable
      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 interface IValueNotifiable
      Returns:
      The container type.