Add bypass permission

This commit is contained in:
Len 2022-09-26 08:32:19 +02:00
parent 2ab2381579
commit 8cb2ed7648
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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);