Class SocketWidget<T extends net.minecraft.client.gui.widget.LayoutWidget>

java.lang.Object
net.replaceitem.reconfigure.screen.widget.layout.SocketWidget<T>
All Implemented Interfaces:
net.minecraft.client.gui.widget.LayoutWidget, net.minecraft.client.gui.widget.Widget

public class SocketWidget<T extends net.minecraft.client.gui.widget.LayoutWidget> extends Object implements net.minecraft.client.gui.widget.LayoutWidget
Helper wrapper widget that always contains one wrapper widget. This is used to the widget can be swapped out or re-created. Things like GridWidget does not support removing widgets from it, so to do so, a new one needs to be created and re-filled. If the grid widget is contained in another LayoutWidget however, it cannot be removed from that for re-creation. This SocketWidget is used as a way to keep itself in an outer grid, but replace the LayoutWidget within.
  • Constructor Details

    • SocketWidget

      public SocketWidget(T inner)
  • Method Details

    • getInner

      public T getInner()
    • setInner

      public void setInner(T inner)
    • getX

      public int getX()
      Specified by:
      getX in interface net.minecraft.client.gui.widget.Widget
    • getY

      public int getY()
      Specified by:
      getY in interface net.minecraft.client.gui.widget.Widget
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface net.minecraft.client.gui.widget.Widget
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface net.minecraft.client.gui.widget.Widget
    • setX

      public void setX(int x)
      Specified by:
      setX in interface net.minecraft.client.gui.widget.Widget
    • setY

      public void setY(int y)
      Specified by:
      setY in interface net.minecraft.client.gui.widget.Widget
    • refreshPositions

      public void refreshPositions()
      Specified by:
      refreshPositions in interface net.minecraft.client.gui.widget.LayoutWidget
    • forEachElement

      public void forEachElement(Consumer<net.minecraft.client.gui.widget.Widget> consumer)
      Specified by:
      forEachElement in interface net.minecraft.client.gui.widget.LayoutWidget