Class BlastProtectionUtil

java.lang.Object
com.andrei1058.bedwars.api.util.BlastProtectionUtil

public class BlastProtectionUtil extends Object
  • Constructor Details

  • Method Details

    • isProtected

      public boolean isProtected(@NotNull @NotNull IArena arena, org.bukkit.Location pov, @NotNull @NotNull org.bukkit.block.Block block, double step)
      Check if block is protected by blast-proof glass or an unbreakable block from a point of view

      if pov is null, block is checked by VersionSupport.isGlass(Material) and IArena.isBlockPlaced(Block) instead. Otherwise, a ray tracing is performed to check whether there is any glass block or an unbreakable block.

      If arena is null, then glass only be checked.

      Parameters:
      arena - Arena instance.
      pov - the point of view.
      block - the block instance.
      step - how frequent to check the ray (0.25 - 0.5 recommended).
      Returns:
      whether there's unbreakable block between the pov and the block