Klasse Region
java.lang.Object
de.delinkedde.mobarenareborn.arena.Region
An axis-aligned cuboid region defined by two corners within a single world.
The region is normalised on construction so that the stored minimum and maximum coordinates are independent of the order in which the corners were supplied. It is used for boundary checks (anti-cheat, mob containment) and is immutable.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanTests whether the given location lies within this region.static @NotNull RegionfromCorners(@NotNull Location a, @NotNull Location b) Creates a region from two corner locations.intmaxX()intmaxY()intmaxZ()intminX()intminY()intminZ()@NotNull Stringworld()
-
Konstruktordetails
-
Region
Creates a region from explicit, already known coordinates.- Parameter:
world- the world namex1- first corner Xy1- first corner Yz1- first corner Zx2- second corner Xy2- second corner Yz2- second corner Z
-
-
Methodendetails
-
fromCorners
@NotNull public static @NotNull Region fromCorners(@NotNull @NotNull Location a, @NotNull @NotNull Location b) Creates a region from two corner locations.- Parameter:
a- the first cornerb- the second corner- Gibt zurück:
- the normalised region
- Löst aus:
IllegalArgumentException- if the corners are in different (or null) worlds
-
contains
Tests whether the given location lies within this region.- Parameter:
location- the location to test- Gibt zurück:
trueif the location is in the same world and within the bounds
-
world
- Gibt zurück:
- the world name
-
minX
public int minX()- Gibt zurück:
- the minimum X coordinate
-
minY
public int minY()- Gibt zurück:
- the minimum Y coordinate
-
minZ
public int minZ()- Gibt zurück:
- the minimum Z coordinate
-
maxX
public int maxX()- Gibt zurück:
- the maximum X coordinate
-
maxY
public int maxY()- Gibt zurück:
- the maximum Y coordinate
-
maxZ
public int maxZ()- Gibt zurück:
- the maximum Z coordinate
-