Add bypass permission
This commit is contained in:
parent
2ab2381579
commit
8cb2ed7648
|
|
@ -117,6 +117,7 @@ bukkit {
|
||||||
children = listOf(
|
children = listOf(
|
||||||
"playershops.shop.create",
|
"playershops.shop.create",
|
||||||
"playershops.shop.break.other",
|
"playershops.shop.break.other",
|
||||||
|
"playershops.shop.open.other",
|
||||||
"playershops.shop.use",
|
"playershops.shop.use",
|
||||||
"playershops.shop.use.buy",
|
"playershops.shop.use.buy",
|
||||||
"playershops.shop.use.sell",
|
"playershops.shop.use.sell",
|
||||||
|
|
@ -142,6 +143,10 @@ bukkit {
|
||||||
"playershops.shop.break",
|
"playershops.shop.break",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
register("playershops.shop.open.other") {
|
||||||
|
description = "Allows players to open other players shops."
|
||||||
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
||||||
|
}
|
||||||
register("playershops.shop.use") {
|
register("playershops.shop.use") {
|
||||||
description = "Allows players to use all playershops."
|
description = "Allows players to use all playershops."
|
||||||
default = BukkitPluginDescription.Permission.Default.FALSE
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ public class PlayerListener extends EventListener {
|
||||||
|
|
||||||
// todo add bypass permission to open shop containers?
|
// todo add bypass permission to open shop containers?
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (player.getUniqueId().equals(playerShop.getOwnerUUID()))
|
if (player.getUniqueId().equals(playerShop.getOwnerUUID()) || player.hasPermission("playershops.shop.open.other"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user