Package com.andrei1058.bedwars.api.util
Class BlastProtectionUtil
java.lang.Object
com.andrei1058.bedwars.api.util.BlastProtectionUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisProtected(@NotNull IArena arena, org.bukkit.Location pov, @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
-
Constructor Details
-
BlastProtectionUtil
-
-
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 viewif pov is null, block is checked by
VersionSupport.isGlass(Material)andIArena.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
-