Enforce controllable permission for players
This commit is contained in:
parent
c0be235538
commit
94a798ca45
|
@ -88,9 +88,14 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ownerRequired && !npc.getOrAddTrait(Owner.class).isOwnedBy(player)) {
|
if (!player.hasPermission(
|
||||||
|
"citizens.npc.controllable." + npc.getEntity().getType().name().toLowerCase().replace("_", ""))
|
||||||
|
|| !player.hasPermission("citizens.npc.controllable"))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
if (ownerRequired && !npc.getOrAddTrait(Owner.class).isOwnedBy(player))
|
||||||
|
return;
|
||||||
|
|
||||||
NMS.mount(npc.getEntity(), player);
|
NMS.mount(npc.getEntity(), player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue