Datensatzklasse RegionFootprint
java.lang.Object
java.lang.Record
de.delinkedde.areashopreborn.domain.RegionFootprint
- Datensatzkomponenten:
vertices- ordered polygon vertices
Immutable, hole-free polygon describing a region on the horizontal X/Z plane.
The implementation deliberately uses the same integer polygon model as WorldGuard.
Therefore containment and union results can be transferred to a
ProtectedPolygonalRegion without a second geometry interpretation.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRegionFootprint(List<FootprintPoint> vertices) Validates and freezes the supplied polygon. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunglongarea()Calculates the number of block columns this footprint protects.bounds(int minY, int maxY) Returns the smallest inclusive cuboid containing this footprint at the supplied heights.booleancontains(int x, int z) Tests whether the supplied block column lies in this polygon, including its edges.booleancontains(RegionFootprint other) Tests whether this footprint completely covers another footprint.final booleanGibt an, ob ein anderes Objekt diesem gleich ("equal to") ist.final inthashCode()Gibt einen Hashcodewert für diese Objekt zurück.booleanhasSameShapeAs(RegionFootprint other) Compares two polygons by shape instead of by vertex list identity.booleanisOnBoundary(int x, int z) Tests whether a block column lies directly on a polygon edge.booleanoverlaps(RegionFootprint other) Tests whether this footprint and another footprint share at least one block column.static RegionFootprintrectangle(CuboidBounds bounds) Creates the rectangular footprint of inclusive cuboid bounds.booleanTests whether two polygons are block-adjacent along a shared edge.static RegionFootprintstrictRectangle(CuboidBounds bounds) Creates a rectangular footprint while rejecting a line-shaped selection.final StringtoString()Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück.union(RegionFootprint other) Combines this footprint with another footprint.vertices()Gibt den Wert für die Datensatzkomponenteverticeszurück.
-
Konstruktordetails
-
RegionFootprint
Validates and freezes the supplied polygon.- Löst aus:
IllegalArgumentException- when fewer than three effective vertices exist or the polygon has no horizontal area
-
-
Methodendetails
-
rectangle
Creates the rectangular footprint of inclusive cuboid bounds.- Parameter:
bounds- source cuboid- Gibt zurück:
- ordered rectangular footprint
-
strictRectangle
Creates a rectangular footprint while rejecting a line-shaped selection.- Parameter:
bounds- source cuboid- Gibt zurück:
- rectangular footprint
-
union
Combines this footprint with another footprint.- Parameter:
other- footprint to add- Gibt zurück:
- one connected, hole-free union polygon
- Löst aus:
IllegalArgumentException- when the result is disconnected, contains a hole, or cannot be represented by one WorldGuard polygon
-
contains
public boolean contains(int x, int z) Tests whether the supplied block column lies in this polygon, including its edges.- Parameter:
x- block X coordinatez- block Z coordinate- Gibt zurück:
truewhen the point is inside or on an edge
-
isOnBoundary
public boolean isOnBoundary(int x, int z) Tests whether a block column lies directly on a polygon edge.- Parameter:
x- block X coordinatez- block Z coordinate- Gibt zurück:
truewhen the point lies on any boundary segment
-
contains
Tests whether this footprint completely covers another footprint.- Parameter:
other- candidate child footprint- Gibt zurück:
truewhen subtracting this polygon leaves no candidate block
-
overlaps
Tests whether this footprint and another footprint share at least one block column.- Parameter:
other- other footprint- Gibt zurück:
truewhen both polygons protect a common block
-
hasSameShapeAs
Compares two polygons by shape instead of by vertex list identity.WorldGuard may return the same ring starting at a different vertex or in the opposite winding order. Reconciliation must not report such a representation difference as a real geometry mismatch.
- Parameter:
other- footprint to compare- Gibt zurück:
truewhen both polygons describe the same ring
-
bounds
Returns the smallest inclusive cuboid containing this footprint at the supplied heights.- Parameter:
minY- minimum build heightmaxY- maximum build height- Gibt zurück:
- bounding cuboid
-
area
public long area()Calculates the number of block columns this footprint protects.- Gibt zurück:
- non-negative block count
-
toString
Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück. Die Darstellung enthält den Namen der Klasse, gefolgt vom Namen und Wert jeder der Datensatzkomponenten. -
hashCode
public final int hashCode()Gibt einen Hashcodewert für diese Objekt zurück. Der Wert wird vom Hashcode jeder der Datensatzkomponenten abgeleitet. -
equals
Gibt an, ob ein anderes Objekt diesem gleich ("equal to") ist. Die Objekte sind gleich, wenn das andere Objekt der gleichen Klasse angehört und alle Datensatzkomponenten gleich sind. Alle Komponenten in dieser Datensatzklasse werden verglichen mitObjects::equals(Object,Object). -
vertices
Gibt den Wert für die Datensatzkomponenteverticeszurück.- Gibt zurück:
- Wert der Datensatzkomponente
vertices
-