Fixed /givepet not working in PvP worlds.
This commit is contained in:
parent
db10863616
commit
31aa352648
|
|
@ -921,7 +921,7 @@ class PlayerEventHandler implements Listener
|
|||
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||
|
||||
//if entity is tameable and has an owner, apply special rules
|
||||
if(entity instanceof Tameable && !GriefPrevention.instance.config_pvp_enabledWorlds.contains(entity.getLocation().getWorld()))
|
||||
if(entity instanceof Tameable)
|
||||
{
|
||||
Tameable tameable = (Tameable)entity;
|
||||
if(tameable.isTamed() && tameable.getOwner() != null)
|
||||
|
|
@ -943,6 +943,8 @@ class PlayerEventHandler implements Listener
|
|||
return;
|
||||
}
|
||||
|
||||
if(!GriefPrevention.instance.config_pvp_enabledWorlds.contains(entity.getLocation().getWorld()))
|
||||
{
|
||||
//otherwise disallow
|
||||
OfflinePlayer owner = GriefPrevention.instance.getServer().getOfflinePlayer(ownerID);
|
||||
String ownerName = owner.getName();
|
||||
|
|
@ -955,6 +957,7 @@ class PlayerEventHandler implements Listener
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//don't allow interaction with item frames or armor stands in claimed areas without build permission
|
||||
if(entity.getType() == EntityType.ARMOR_STAND || entity instanceof Hanging)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user