Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- Inventory-Name: &6PrivateBau
- Diretorio: plugins/PrivateChest/players/%player%/
- Sem-Permissao: &6[PrivateChest] &cVoce nao tem permissao para isso
- Inventory-Saved: &6[PrivateChest] &aInventario %{_int-chest}% foi Salvo
- on load:
- if file "plugins/PrivateChest/config.yml" doesn't exists:
- create file "plugins/PrivateChest/config.yml"
- set "Version" to "1.0.0" in yaml file "plugins/PrivateChest/config.yml"
- command /chest [<integer>]:
- trigger:
- if arg 1 is not set:
- set {_baus::*} to all files in "plugins/PrivateChest/players/%player%"
- replace all ".yml" with "" in {_baus::*}
- replace all " and " with ", " in {_baus::*}
- if size of {_baus::*} = 0:
- send "&cVoce nao tem Baus!"
- else:
- send "&6/chest <bau>"
- send "&6Seus Baus: &f%{_baus::*}%"
- if player has permission "privatechest.open.%arg-1%" or "privatechest.open.*":
- if arg 1 is set:
- open chest with 6 rows named "{@Inventory-Name} - &7%arg-1%" to player
- wait a tick
- set {_chestitems::*} to configuration section "Serializable-Items" get of "plugins/PrivateChest/players/%player%/%arg-1%.yml"
- loop {_chestitems::*}:
- set {_x} to loop-value parsed as integer
- set {_item} to value "Serializable-Items.%loop-value%.Item" get of "plugins/PrivateChest/players/%player%/%arg-1%.yml"
- set {_nbt} to value "Serializable-Items.%loop-value%.NBT" get of "plugins/PrivateChest/players/%player%/%arg-1%.yml"
- set {_separeted::*} to {_item} split at " named "
- set {_item} to {_separeted::1} parsed as itemtype
- set slot {_x} of player's current inventory to {_item} with nbt "%{_nbt}%"
- else:
- send "{@Sem-Permissao}"
- on inventory close:
- set {_name} to inventory name of player's current inventory
- set {_split::*} to {_name} split at " - "
- set {_int-chest} to "%uncoloured {_split::2}%"
- replace all "&a", "&b", "&c", "&d", "&e", "&f", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9", "&0" and "&r" with "" in {_int-chest}
- if {_split::1} contains "{@Inventory-Name}":
- delete file "plugins/PrivateChest/players/%player%/%{_int-chest}%.yml"
- if file "plugins/PrivateChest/players/%player%/%{_int-chest}%.yml" doesn't exists:
- create file "plugins/PrivateChest/players/%player%/%{_int-chest}%.yml"
- set {_count} to 0
- loop 53 times:
- set {_item} to slot {_count} of player's current inventory
- if {_item} is not air:
- set "Serializable-Items.%{_count}%.Item" to "%{_item}%" in yaml file "plugins/PrivateChest/players/%player%/%{_int-chest}%.yml"
- set "Serializable-Items.%{_count}%.NBT" to "%nbt of {_item}%" in yaml file "plugins/PrivateChest/players/%player%/%{_int-chest}%.yml"
- add 1 to {_count}
- send "{@Inventory-Saved}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement