Protected armor stands.
This commit is contained in:
parent
4d59f90543
commit
71412a12c2
|
|
@ -453,8 +453,8 @@ class EntityEventHandler implements Listener
|
||||||
//don't track in worlds where claims are not enabled
|
//don't track in worlds where claims are not enabled
|
||||||
if(!GriefPrevention.instance.claimsEnabledForWorld(event.getEntity().getWorld())) return;
|
if(!GriefPrevention.instance.claimsEnabledForWorld(event.getEntity().getWorld())) return;
|
||||||
|
|
||||||
//if the damaged entity is a claimed item frame, the damager needs to be a player with container trust in the claim
|
//if the damaged entity is a claimed item frame or armor stand, the damager needs to be a player with container trust in the claim
|
||||||
if(subEvent.getEntityType() == EntityType.ITEM_FRAME)
|
if(subEvent.getEntityType() == EntityType.ITEM_FRAME || subEvent.getEntityType() == EntityType.ARMOR_STAND)
|
||||||
{
|
{
|
||||||
//decide whether it's claimed
|
//decide whether it's claimed
|
||||||
Claim cachedClaim = null;
|
Claim cachedClaim = null;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ import org.bukkit.entity.Animals;
|
||||||
import org.bukkit.entity.Boat;
|
import org.bukkit.entity.Boat;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Hanging;
|
import org.bukkit.entity.Hanging;
|
||||||
import org.bukkit.entity.Horse;
|
import org.bukkit.entity.Horse;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -801,8 +802,8 @@ class PlayerEventHandler implements Listener
|
||||||
//allow horse protection to be overridden to allow management from other plugins
|
//allow horse protection to be overridden to allow management from other plugins
|
||||||
if (!GriefPrevention.instance.config_claims_protectHorses && entity instanceof Horse) return;
|
if (!GriefPrevention.instance.config_claims_protectHorses && entity instanceof Horse) return;
|
||||||
|
|
||||||
//don't allow interaction with item frames in claimed areas without build permission
|
//don't allow interaction with item frames or armor stands in claimed areas without build permission
|
||||||
if(entity instanceof Hanging)
|
if(entity.getType() == EntityType.ARMOR_STAND || entity instanceof Hanging)
|
||||||
{
|
{
|
||||||
String noBuildReason = GriefPrevention.instance.allowBuild(player, entity.getLocation(), Material.ITEM_FRAME);
|
String noBuildReason = GriefPrevention.instance.allowBuild(player, entity.getLocation(), Material.ITEM_FRAME);
|
||||||
if(noBuildReason != null)
|
if(noBuildReason != null)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user