Class Zone
java.lang.Object
fr.multimc.api.spigot.common.worlds.locations.zones.Zone
- All Implemented Interfaces:
org.bukkit.event.Listener
-
Constructor Summary
ConstructorsConstructorDescriptionZone(org.bukkit.Location center, RelativeLocation location1, RelativeLocation location2) Constructs a new zone using a centerLocationand twoRelativeLocationrepresenting the two point on the circleZone(org.bukkit.Location center, RelativeLocation location1, RelativeLocation location2, org.bukkit.plugin.Plugin plugin, ZoneListener callback) Constructs a new zone using a centerLocationand twoRelativeLocationrepresenting the two point on the circleZone(org.bukkit.Location location1, org.bukkit.Location location2) Constructs a new zone using twoLocationrepresenting the two opposite corners of the zone.Zone(org.bukkit.Location location1, org.bukkit.Location location2, org.bukkit.plugin.Plugin plugin, ZoneListener callback) Constructs a new zone using twoLocationrepresenting the two opposite corners of the zone. -
Method Summary
Modifier and TypeMethodDescriptionList<org.bukkit.block.Block>Get aList<org.bukkit.block.Block>of all the blocks in the zone.org.bukkit.WorldgetWorld()Get the world this zone is in.booleanisIn(@NotNull org.bukkit.entity.Entity entity) Check whether the givenEntityis inside the zonebooleanisIn(org.bukkit.entity.Player player) Check whether the givenPlayeris inside the zonebooleanisIn(org.bukkit.Location location) Check whether the givenLocationis inside the zone
-
Constructor Details
-
Zone
public Zone(@Nonnull org.bukkit.Location location1, @Nonnull org.bukkit.Location location2, @Nullable org.bukkit.plugin.Plugin plugin, @Nullable ZoneListener callback) Constructs a new zone using twoLocationrepresenting the two opposite corners of the zone.- Parameters:
location1- The first corner of the zone.location2- The second corner of the zone.plugin- The plugin registering this zone as a listenercallback- TheZoneListenercallbacks for enter and exit event- Throws:
IllegalArgumentException- if the locations are not in the same world
-
Zone
public Zone(@Nonnull org.bukkit.Location location1, @Nonnull org.bukkit.Location location2) Constructs a new zone using twoLocationrepresenting the two opposite corners of the zone.- Parameters:
location1- The first corner of the zone.location2- The second corner of the zone.
-
Zone
public Zone(@Nonnull org.bukkit.Location center, @Nonnull RelativeLocation location1, @Nonnull RelativeLocation location2, @Nullable org.bukkit.plugin.Plugin plugin, @Nullable ZoneListener callback) Constructs a new zone using a centerLocationand twoRelativeLocationrepresenting the two point on the circle- Parameters:
center- center location of the zonelocation1- the first point on the circlelocation2- the second point on the circleplugin- The plugin registering this zone as a listenercallback- TheZoneListenercallbacks for enter and exit event
-
Zone
public Zone(@Nonnull org.bukkit.Location center, @Nonnull RelativeLocation location1, @Nonnull RelativeLocation location2) Constructs a new zone using a centerLocationand twoRelativeLocationrepresenting the two point on the circle- Parameters:
center- center location of the zonelocation1- the first point on the circlelocation2- the second point on the circle
-
-
Method Details
-
isIn
public boolean isIn(@NotNull @NotNull org.bukkit.entity.Entity entity) Check whether the givenEntityis inside the zone- Parameters:
entity- the given entity- Returns:
- true if the entity is inside the zone, false otherwise
-
isIn
public boolean isIn(@Nonnull org.bukkit.entity.Player player) Check whether the givenPlayeris inside the zone- Parameters:
player- the given player- Returns:
- true if the player is inside the zone, false otherwise
-
isIn
public boolean isIn(@Nonnull org.bukkit.Location location) Check whether the givenLocationis inside the zone- Parameters:
location- the given location- Returns:
- true if the location is inside the zone, false otherwise
-
getBlocks
Get aList<org.bukkit.block.Block>of all the blocks in the zone.- Returns:
List<org.bukkit.block.Block>
-
getWorld
public org.bukkit.World getWorld()Get the world this zone is in.- Returns:
World
-