Record Class ScreenRect

java.lang.Object
java.lang.Record
net.minecraft.client.gui.ScreenRect
Record Components:
position -
width -
height -

@Environment(CLIENT) public record ScreenRect(ScreenPos position, int width, int height) extends Record
A rectangle on the screen.
Mappings:
Namespace Name
named net/minecraft/client/gui/ScreenRect
intermediary net/minecraft/class_8030
official fms
named position
intermediary comp_1195
official a
named width
intermediary comp_1196
official b
named height
intermediary comp_1197
official c
  • Field Details

    • position

      private final ScreenPos position
      The field for the position record component.
    • width

      private final int width
      The field for the width record component.
    • height

      private final int height
      The field for the height record component.
    • EMPTY

      private static final ScreenRect EMPTY
      Mappings:
      Namespace Name Mixin selector
      named EMPTY Lnet/minecraft/client/gui/ScreenRect;EMPTY:Lnet/minecraft/client/gui/ScreenRect;
      intermediary field_41835 Lnet/minecraft/class_8030;field_41835:Lnet/minecraft/class_8030;
      official d Lfms;d:Lfms;
  • Constructor Details

    • ScreenRect

      public ScreenRect(int sameAxis, int otherAxis, int width, int height)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/gui/ScreenRect;<init>(IIII)V
      intermediary <init> Lnet/minecraft/class_8030;<init>(IIII)V
      official <init> Lfms;<init>(IIII)V
    • ScreenRect

      public ScreenRect(ScreenPos screenPos, int int2, int int3)
  • Method Details

    • empty

      public static ScreenRect empty()
      Returns an empty rect.
      Returns:
      an empty rect
      Mappings:
      Namespace Name Mixin selector
      named empty Lnet/minecraft/client/gui/ScreenRect;empty()Lnet/minecraft/client/gui/ScreenRect;
      intermediary method_48248 Lnet/minecraft/class_8030;method_48248()Lnet/minecraft/class_8030;
      official a Lfms;a()Lfms;
    • of

      public static ScreenRect of(NavigationAxis axis, int sameAxisCoord, int otherAxisCoord, int sameAxisLength, int otherAxisLength)
      Returns a new rect.
      Parameters:
      sameAxisCoord - the coordinate of the axis axis
      otherAxisCoord - the coordinate of the axis's other axis
      sameAxisLength - the length of the edge whose axis is the same as axis
      otherAxisLength - the length of the edge whose axis is different from axis
      Returns:
      a new rect
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/client/gui/ScreenRect;of(Lnet/minecraft/client/gui/navigation/NavigationAxis;IIII)Lnet/minecraft/client/gui/ScreenRect;
      intermediary method_48250 Lnet/minecraft/class_8030;method_48250(Lnet/minecraft/class_8027;IIII)Lnet/minecraft/class_8030;
      official a Lfms;a(Lfmp;IIII)Lfms;
    • add

      public ScreenRect add(NavigationDirection direction)
      Returns a new rect of the same dimensions with the position incremented.
      Returns:
      a new rect of the same dimensions with the position incremented
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/client/gui/ScreenRect;add(Lnet/minecraft/client/gui/navigation/NavigationDirection;)Lnet/minecraft/client/gui/ScreenRect;
      intermediary method_48251 Lnet/minecraft/class_8030;method_48251(Lnet/minecraft/class_8028;)Lnet/minecraft/class_8030;
      official a Lfms;a(Lfmq;)Lfms;
    • getLength

      public int getLength(NavigationAxis axis)
      Returns the length of the rect in the given axis.
      Returns:
      the length of the rect in the given axis
      Mappings:
      Namespace Name Mixin selector
      named getLength Lnet/minecraft/client/gui/ScreenRect;getLength(Lnet/minecraft/client/gui/navigation/NavigationAxis;)I
      intermediary method_48249 Lnet/minecraft/class_8030;method_48249(Lnet/minecraft/class_8027;)I
      official a Lfms;a(Lfmp;)I
    • getBoundingCoordinate

      public int getBoundingCoordinate(NavigationDirection direction)
      Returns the coordinate of the bounding box in the given direction.
      Returns:
      the coordinate of the bounding box in the given direction
      Mappings:
      Namespace Name Mixin selector
      named getBoundingCoordinate Lnet/minecraft/client/gui/ScreenRect;getBoundingCoordinate(Lnet/minecraft/client/gui/navigation/NavigationDirection;)I
      intermediary method_48255 Lnet/minecraft/class_8030;method_48255(Lnet/minecraft/class_8028;)I
      official b Lfms;b(Lfmq;)I
    • getBorder

      public ScreenRect getBorder(NavigationDirection direction)
      Returns a rect representing the border of this rect in the given direction.

      Borders are one pixel thick.

      Returns:
      a rect representing the border of this rect in the given direction
      Mappings:
      Namespace Name Mixin selector
      named getBorder Lnet/minecraft/client/gui/ScreenRect;getBorder(Lnet/minecraft/client/gui/navigation/NavigationDirection;)Lnet/minecraft/client/gui/ScreenRect;
      intermediary method_48256 Lnet/minecraft/class_8030;method_48256(Lnet/minecraft/class_8028;)Lnet/minecraft/class_8030;
      official c Lfms;c(Lfmq;)Lfms;
    • overlaps

      public boolean overlaps(ScreenRect other)
      Returns whether this rect overlaps with rect in both axes.
      Returns:
      whether this rect overlaps with rect in both axes
      Mappings:
      Namespace Name Mixin selector
      named overlaps Lnet/minecraft/client/gui/ScreenRect;overlaps(Lnet/minecraft/client/gui/ScreenRect;)Z
      intermediary method_48252 Lnet/minecraft/class_8030;method_48252(Lnet/minecraft/class_8030;)Z
      official a Lfms;a(Lfms;)Z
    • overlaps

      public boolean overlaps(ScreenRect other, NavigationAxis axis)
      Returns whether this rect overlaps with rect in axis.
      Returns:
      whether this rect overlaps with rect in axis
      Mappings:
      Namespace Name Mixin selector
      named overlaps Lnet/minecraft/client/gui/ScreenRect;overlaps(Lnet/minecraft/client/gui/ScreenRect;Lnet/minecraft/client/gui/navigation/NavigationAxis;)Z
      intermediary method_48253 Lnet/minecraft/class_8030;method_48253(Lnet/minecraft/class_8030;Lnet/minecraft/class_8027;)Z
      official a Lfms;a(Lfms;Lfmp;)Z
    • getCenter

      public int getCenter(NavigationAxis axis)
      Returns the center of this rect in the given axis.
      Returns:
      the center of this rect in the given axis
      Mappings:
      Namespace Name Mixin selector
      named getCenter Lnet/minecraft/client/gui/ScreenRect;getCenter(Lnet/minecraft/client/gui/navigation/NavigationAxis;)I
      intermediary method_48254 Lnet/minecraft/class_8030;method_48254(Lnet/minecraft/class_8027;)I
      official b Lfms;b(Lfmp;)I
    • intersection

      @Nullable public @Nullable ScreenRect intersection(ScreenRect other)
      Returns the rect that intersects with other, or null if they do not intersect.
      Returns:
      the rect that intersects with other, or null if they do not intersect
      Mappings:
      Namespace Name Mixin selector
      named intersection Lnet/minecraft/client/gui/ScreenRect;intersection(Lnet/minecraft/client/gui/ScreenRect;)Lnet/minecraft/client/gui/ScreenRect;
      intermediary method_49701 Lnet/minecraft/class_8030;method_49701(Lnet/minecraft/class_8030;)Lnet/minecraft/class_8030;
      official b Lfms;b(Lfms;)Lfms;
    • getTop

      public int getTop()
      Mappings:
      Namespace Name Mixin selector
      named getTop Lnet/minecraft/client/gui/ScreenRect;getTop()I
      intermediary method_49618 Lnet/minecraft/class_8030;method_49618()I
      official b Lfms;b()I
    • getBottom

      public int getBottom()
      Mappings:
      Namespace Name Mixin selector
      named getBottom Lnet/minecraft/client/gui/ScreenRect;getBottom()I
      intermediary method_49619 Lnet/minecraft/class_8030;method_49619()I
      official c Lfms;c()I
    • getLeft

      public int getLeft()
      Mappings:
      Namespace Name Mixin selector
      named getLeft Lnet/minecraft/client/gui/ScreenRect;getLeft()I
      intermediary method_49620 Lnet/minecraft/class_8030;method_49620()I
      official d Lfms;d()I
    • getRight

      public int getRight()
      Mappings:
      Namespace Name Mixin selector
      named getRight Lnet/minecraft/client/gui/ScreenRect;getRight()I
      intermediary method_49621 Lnet/minecraft/class_8030;method_49621()I
      official e Lfms;e()I
    • contains

      public boolean contains(int x, int y)
      Mappings:
      Namespace Name Mixin selector
      named contains Lnet/minecraft/client/gui/ScreenRect;contains(II)Z
      intermediary method_58137 Lnet/minecraft/class_8030;method_58137(II)Z
      official a Lfms;a(II)Z
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • position

      public ScreenPos position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component