Class ProtectionQuery
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
testBlockBreak
(Object cause, org.bukkit.block.Block block) Test whether a block can be broken.boolean
testBlockInteract
(Object cause, org.bukkit.block.Block block) Test whether a block can be interacted with.boolean
testBlockPlace
(Object cause, org.bukkit.Location location, org.bukkit.Material newMaterial) Test whether a block can be placed at a given location.boolean
testEntityDamage
(Object cause, org.bukkit.entity.Entity entity) Test whether an entity can be damaged.boolean
testEntityDestroy
(Object cause, org.bukkit.entity.Entity entity) Test whether an entity can be destroyed.boolean
testEntityInteract
(Object cause, org.bukkit.entity.Entity entity) Test whether an entity can be interacted with.boolean
testEntityPlace
(Object cause, org.bukkit.Location location, org.bukkit.entity.EntityType type) Test whether an entity can be placed.
-
Constructor Details
-
ProtectionQuery
public ProtectionQuery()
-
-
Method Details
-
testBlockPlace
public boolean testBlockPlace(@Nullable Object cause, org.bukkit.Location location, org.bukkit.Material newMaterial) Test whether a block can be placed at a given location.The cause does not have to be a player. It can be
null
if the cause is not known, although the checks will executed assuming that the actor is a non-member of all regions.- Parameters:
cause
- the cause, which can be a block, an entity, or a player, ornull
if unknownlocation
- the location of the blocknewMaterial
- the new material- Returns:
- true if the action is permitted
-
testBlockBreak
Test whether a block can be broken.The cause does not have to be a player. It can be
null
if the cause is not known, although the checks will executed assuming that the actor is a non-member of all regions.- Parameters:
cause
- the cause, which can be a block, an entity, or a player, ornull
if unknownblock
- the block broken- Returns:
- true if the action is permitted
-
testBlockInteract
Test whether a block can be interacted with.The cause does not have to be a player. It can be
null
if the cause is not known, although the checks will executed assuming that the actor is a non-member of all regions.- Parameters:
cause
- the cause, which can be a block, an entity, or a player, ornull
if unknownblock
- the block that is interacted with- Returns:
- true if the action is permitted
-
testEntityPlace
public boolean testEntityPlace(@Nullable Object cause, org.bukkit.Location location, org.bukkit.entity.EntityType type) Test whether an entity can be placed.The cause does not have to be a player. It can be
null
if the cause is not known, although the checks will executed assuming that the actor is a non-member of all regions.- Parameters:
cause
- the cause, which can be a block, an entity, or a player, ornull
if unknownlocation
- the location that the entity will be spawned attype
- the type that is to be spawned- Returns:
- true if the action is permitted
-
testEntityDestroy
Test whether an entity can be destroyed.The cause does not have to be a player. It can be
null
if the cause is not known, although the checks will executed assuming that the actor is a non-member of all regions.- Parameters:
cause
- the cause, which can be a block, an entity, or a player, ornull
if unknownentity
- the entity broken- Returns:
- true if the action is permitted
-
testEntityInteract
Test whether an entity can be interacted with.The cause does not have to be a player. It can be
null
if the cause is not known, although the checks will executed assuming that the actor is a non-member of all regions.- Parameters:
cause
- the cause, which can be a block, an entity, or a player, ornull
if unknownentity
- the entity interacted with- Returns:
- true if the action is permitted
-
testEntityDamage
Test whether an entity can be damaged.The cause does not have to be a player. It can be
null
if the cause is not known, although the checks will executed assuming that the actor is a non-member of all regions.- Parameters:
cause
- the cause, which can be a block, an entity, or a player, ornull
if unknownentity
- the entity damaged- Returns:
- true if the action is permitted
-