mirror of
https://github.com/TotalFreedomMC/OpenInv.git
synced 2024-12-22 16:05:03 +00:00
Add permissions to alter the default state of Any/SilentChest (#76)
This commit is contained in:
parent
2195677651
commit
e3d1af010b
3 changed files with 37 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,6 +3,7 @@
|
|||
**/.project
|
||||
**/.classpath
|
||||
**/.idea
|
||||
**/.iml
|
||||
**/target
|
||||
**/bin
|
||||
**/out
|
||||
|
|
|
@ -271,7 +271,16 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
|||
|
||||
@Override
|
||||
public boolean getPlayerAnyChestStatus(final OfflinePlayer player) {
|
||||
return this.getConfig().getBoolean("toggles.any-chest." + this.accessor.getPlayerDataManager().getPlayerDataID(player), false);
|
||||
boolean defaultState = false;
|
||||
|
||||
if (player.isOnline()) {
|
||||
Player onlinePlayer = player.getPlayer();
|
||||
if (onlinePlayer != null) {
|
||||
defaultState = onlinePlayer.hasPermission("openinv.anychest.default");
|
||||
}
|
||||
}
|
||||
|
||||
return this.getConfig().getBoolean("toggles.any-chest." + this.accessor.getPlayerDataManager().getPlayerDataID(player), defaultState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -281,7 +290,16 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
|||
|
||||
@Override
|
||||
public boolean getPlayerSilentChestStatus(final OfflinePlayer player) {
|
||||
return this.getConfig().getBoolean("toggles.silent-chest." + this.accessor.getPlayerDataManager().getPlayerDataID(player), false);
|
||||
boolean defaultState = false;
|
||||
|
||||
if (player.isOnline()) {
|
||||
Player onlinePlayer = player.getPlayer();
|
||||
if (onlinePlayer != null) {
|
||||
defaultState = onlinePlayer.hasPermission("openinv.silentchest.default");
|
||||
}
|
||||
}
|
||||
|
||||
return this.getConfig().getBoolean("toggles.silent-chest." + this.accessor.getPlayerDataManager().getPlayerDataID(player), defaultState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,16 @@ author: lishid
|
|||
authors: [Jikoo, ShadowRanger]
|
||||
description: >
|
||||
This plugin allows you to open a player's inventory as a chest and interact with it in real time.
|
||||
|
||||
permissions:
|
||||
openinv:
|
||||
anychest.default:
|
||||
description: Permission for AnyContainer to default on prior to toggling.
|
||||
default: false
|
||||
silentchest.default:
|
||||
description: Permission for SilentChest to default on prior to toggling.
|
||||
default: false
|
||||
|
||||
commands:
|
||||
openinv:
|
||||
aliases: [oi, inv, open]
|
||||
|
@ -31,15 +41,15 @@ commands:
|
|||
usage: |-
|
||||
/<command> <item> [MinAmount] - Item is the ID or the Bukkit Material, MinAmount is the minimum amount required
|
||||
silentchest:
|
||||
aliases: [sc, silent]
|
||||
description: Toggle silent chest function, which stops sounds and animations when using containers.
|
||||
aliases: [sc, silent, silentcontainer]
|
||||
description: Toggle SilentContainer function, which stops sounds and animations when using containers.
|
||||
permission: OpenInv.*;OpenInv.silent
|
||||
usage: |-
|
||||
/<command> [Check] - Check or toggle silent chest
|
||||
anychest:
|
||||
aliases: [ac]
|
||||
description: Toggle anychest function, which allows opening of blocked chests.
|
||||
permission: OpenInv.*;OpenInv.anychest
|
||||
anycontainer:
|
||||
aliases: [ac, anychest]
|
||||
description: Toggle AnyContainer function, which allows opening of blocked containers.
|
||||
permission: OpenInv.*;OpenInv.anychest;OpenInv.anycontainer
|
||||
usage: |-
|
||||
/<command> [Check] - Checks or toggle anychest
|
||||
searchenchant:
|
||||
|
|
Loading…
Reference in a new issue