Klasse ProtectionService

java.lang.Object
de.delinkedde.mobarenareborn.protection.ProtectionService

public final class ProtectionService extends Object
Decides whether a location is inside a protected arena region.

Any arena that has a region defined is protected, regardless of whether it is enabled, so the build area is safe from griefing both during rounds and while it is being set up. Protection can be switched off entirely with protection.enabled in config.yml.

  • Konstruktordetails

    • ProtectionService

      public ProtectionService(@NotNull @NotNull ArenaManager arenas, @NotNull @NotNull ConfigManager config)
      Parameter:
      arenas - the arena registry, queried for regions
      config - the configuration manager, read for the master toggle
  • Methodendetails

    • isProtected

      public boolean isProtected(@Nullable @Nullable Location location)
      Tests whether a location lies inside any arena region while protection is enabled.
      Parameter:
      location - the location to test, may be null
      Gibt zurück:
      true if the location is within a protected arena region
    • isInArenaRegion

      public boolean isInArenaRegion(@Nullable @Nullable Location location)
      Tests whether a location lies inside any arena region, independent of the protection toggle.
      Parameter:
      location - the location to test, may be null
      Gibt zurück:
      true if the location is within an arena region
    • blocksNaturalSpawns

      public boolean blocksNaturalSpawns()
      Gibt zurück:
      whether natural mob spawning should be blocked inside arena regions