mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
if (ownerRequired && !npc.getOrAddTrait(Owner.class).isOwnedBy(player))
|
||||
return;
|
||||
|
||||
NMS.mount(npc.getEntity(), player);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user