mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 04:35:50 +01:00
fix selection issue
This commit is contained in:
parent
c57ca76b4f
commit
1e8237a097
Binary file not shown.
@ -137,7 +137,8 @@ public class EventListen implements Listener {
|
||||
|
||||
NPC npc = npcManager.getNPC(event.getEntity());
|
||||
Player player = (Player) event.getTarget();
|
||||
if (player.getMetadata("selected").size() == 0 || player.getMetadata("selected").get(0).asInt() != npc.getId()) {
|
||||
if (!player.hasMetadata("selected") || player.getMetadata("selected").size() == 0
|
||||
|| player.getMetadata("selected").get(0).asInt() != npc.getId()) {
|
||||
if (player.getItemInHand().getTypeId() == Setting.SELECTION_ITEM.asInt()
|
||||
&& (npc.getTrait(Owner.class).getOwner().equals(player.getName()) || player
|
||||
.hasPermission("citizens.admin"))) {
|
||||
|
Loading…
Reference in New Issue
Block a user