mirror of
https://github.com/TotalFreedomMC/OpenInv.git
synced 2025-08-06 12:33:24 +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
|
**/.project
|
||||||
**/.classpath
|
**/.classpath
|
||||||
**/.idea
|
**/.idea
|
||||||
|
**/.iml
|
||||||
**/target
|
**/target
|
||||||
**/bin
|
**/bin
|
||||||
**/out
|
**/out
|
||||||
|
|
|
@ -271,7 +271,16 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getPlayerAnyChestStatus(final OfflinePlayer player) {
|
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
|
@Override
|
||||||
|
@ -281,7 +290,16 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getPlayerSilentChestStatus(final OfflinePlayer player) {
|
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
|
@Override
|
||||||
|
|
|
@ -5,6 +5,16 @@ author: lishid
|
||||||
authors: [Jikoo, ShadowRanger]
|
authors: [Jikoo, ShadowRanger]
|
||||||
description: >
|
description: >
|
||||||
This plugin allows you to open a player's inventory as a chest and interact with it in real time.
|
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:
|
commands:
|
||||||
openinv:
|
openinv:
|
||||||
aliases: [oi, inv, open]
|
aliases: [oi, inv, open]
|
||||||
|
@ -31,15 +41,15 @@ commands:
|
||||||
usage: |-
|
usage: |-
|
||||||
/<command> <item> [MinAmount] - Item is the ID or the Bukkit Material, MinAmount is the minimum amount required
|
/<command> <item> [MinAmount] - Item is the ID or the Bukkit Material, MinAmount is the minimum amount required
|
||||||
silentchest:
|
silentchest:
|
||||||
aliases: [sc, silent]
|
aliases: [sc, silent, silentcontainer]
|
||||||
description: Toggle silent chest function, which stops sounds and animations when using containers.
|
description: Toggle SilentContainer function, which stops sounds and animations when using containers.
|
||||||
permission: OpenInv.*;OpenInv.silent
|
permission: OpenInv.*;OpenInv.silent
|
||||||
usage: |-
|
usage: |-
|
||||||
/<command> [Check] - Check or toggle silent chest
|
/<command> [Check] - Check or toggle silent chest
|
||||||
anychest:
|
anycontainer:
|
||||||
aliases: [ac]
|
aliases: [ac, anychest]
|
||||||
description: Toggle anychest function, which allows opening of blocked chests.
|
description: Toggle AnyContainer function, which allows opening of blocked containers.
|
||||||
permission: OpenInv.*;OpenInv.anychest
|
permission: OpenInv.*;OpenInv.anychest;OpenInv.anycontainer
|
||||||
usage: |-
|
usage: |-
|
||||||
/<command> [Check] - Checks or toggle anychest
|
/<command> [Check] - Checks or toggle anychest
|
||||||
searchenchant:
|
searchenchant:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue