Class SafeLocationManager
java.lang.Object
dev.cwhead.GravesX.manager.SafeLocationManager
Resolves safe teleport and grave placement locations.
Prefers fluid surface placement when configured.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumExplains why a particular grave placement location was chosen.static classGrave placement result. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBuild(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, List<String> permissionList) Checks if an entity can build at a location.org.bukkit.LocationgetLastSolidLocation(org.bukkit.entity.Entity entity) Gets the last solid location for an entity.intgetMinHeight(org.bukkit.Location location) Gets the minimum height for a location.intgetNetherRoofLimit(org.bukkit.World world, Grave grave) Returns the configured Nether roof Y limit for the given world.org.bukkit.LocationgetSafeGraveLocation(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, Grave grave) Gets a safe grave location.org.bukkit.LocationgetSafeTeleportLocation(org.bukkit.entity.Entity entity, org.bukkit.Location location, Grave grave, Graves plugin) Gets a safe teleport location.booleanhasGrave(org.bukkit.Location location) Checks if a grave exists at a location.booleanisAboveNetherRoof(org.bukkit.Location location, Grave grave) Returns whether the location is above the configured Nether roof limit.booleanisInsideBorder(org.bukkit.Location location) Checks if a location is inside the world border.booleanisLocationSafeGrave(org.bukkit.Location location) Checks if a grave location is safe.booleanisLocationSafePlayer(org.bukkit.Location location) Checks if a player location is safe.booleanisVoid(org.bukkit.Location location) Checks if a location is in the void.voidremoveLastSolidLocation(org.bukkit.entity.Entity entity) Removes the last solid location for an entity.resolveSafeGravePlacement(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, Grave grave) Resolves a safe grave placement result.voidsetLastSolidLocation(org.bukkit.entity.Entity entity, org.bukkit.Location location) Stores the last solid location for an entity.
-
Constructor Details
-
SafeLocationManager
-
-
Method Details
-
getNetherRoofLimit
Returns the configured Nether roof Y limit for the given world. -
isAboveNetherRoof
Returns whether the location is above the configured Nether roof limit. -
setLastSolidLocation
public void setLastSolidLocation(org.bukkit.entity.Entity entity, org.bukkit.Location location) Stores the last solid location for an entity.- Parameters:
entity- The entity.location- The location.
-
getLastSolidLocation
public org.bukkit.Location getLastSolidLocation(org.bukkit.entity.Entity entity) Gets the last solid location for an entity.- Parameters:
entity- The entity.- Returns:
- The location, or null if not available.
-
removeLastSolidLocation
public void removeLastSolidLocation(org.bukkit.entity.Entity entity) Removes the last solid location for an entity.- Parameters:
entity- The entity.
-
getSafeTeleportLocation
public org.bukkit.Location getSafeTeleportLocation(org.bukkit.entity.Entity entity, org.bukkit.Location location, Grave grave, Graves plugin) Gets a safe teleport location.- Parameters:
entity- The entity.location- The location.grave- The grave.plugin- The plugin.- Returns:
- The safe location, or null if not found.
-
getSafeGraveLocation
public org.bukkit.Location getSafeGraveLocation(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, Grave grave) Gets a safe grave location.- Parameters:
livingEntity- The entity.location- The location.grave- The grave.- Returns:
- The safe location, or null if not found.
-
resolveSafeGravePlacement
public SafeLocationManager.GravePlacementResult resolveSafeGravePlacement(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, Grave grave) Resolves a safe grave placement result.- Parameters:
livingEntity- The entity.location- The location.grave- The grave.- Returns:
- The placement result, or null if the input location is null.
-
canBuild
public boolean canBuild(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, List<String> permissionList) Checks if an entity can build at a location.- Parameters:
livingEntity- The entity.location- The location.permissionList- The permission list.- Returns:
- True if building is allowed, otherwise false.
-
isLocationSafePlayer
public boolean isLocationSafePlayer(org.bukkit.Location location) Checks if a player location is safe.- Parameters:
location- The location.- Returns:
- True if safe, otherwise false.
-
isLocationSafeGrave
public boolean isLocationSafeGrave(org.bukkit.Location location) Checks if a grave location is safe.- Parameters:
location- The location.- Returns:
- True if safe, otherwise false.
-
hasGrave
public boolean hasGrave(org.bukkit.Location location) Checks if a grave exists at a location.- Parameters:
location- The location.- Returns:
- True if a grave exists, otherwise false.
-
isInsideBorder
public boolean isInsideBorder(org.bukkit.Location location) Checks if a location is inside the world border.- Parameters:
location- The location.- Returns:
- True if inside the border, otherwise false.
-
isVoid
public boolean isVoid(org.bukkit.Location location) Checks if a location is in the void.- Parameters:
location- The location.- Returns:
- True if in the void, otherwise false.
-
getMinHeight
public int getMinHeight(org.bukkit.Location location) Gets the minimum height for a location.- Parameters:
location- The location.- Returns:
- The minimum height.
-