Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flag for storage unit access #195

Merged
merged 6 commits into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions SkyBlock/SKYBLOCK.SK/Functions/checkislandaccess.sk
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,11 @@ function checkflagevent(x:number,y:number,z:number,event:text,playertype:text,bl
else:
if {SB::config::defaultisflag::%{_playertype}%::jetboots} is set:
return {SB::config::defaultisflag::%{_playertype}%::jetboots}
#
# > This flag is for storage units, it gets triggered if the player opens a storage unit.
else if {_event} is "storageunit":
if {SB::island::%{_x}%_%{_y}%_%{_z}%::flag::%{_playertype}%::storageunit} is set:
return {SB::island::%{_x}%_%{_y}%_%{_z}%::flag::%{_playertype}%::storageunit}
else:
if {SB::config::defaultisflag::%{_playertype}%::storageunit} is set:
return {SB::config::defaultisflag::%{_playertype}%::storageunit}
3 changes: 3 additions & 0 deletions SkyBlock/SKYBLOCK.SK/Functions/configmetaloader.sk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# configmetaloader.sk is part of the SKYBLOCK.SK functions.
# ==============

import:
java.util.ArrayList

#
# > Function - loadconfigarray
# > Parameters:
Expand Down
6 changes: 3 additions & 3 deletions SkyBlock/addons/obsidian2lava.sk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# ==============
# obsidian2lava.sk v0.0.3
# obsidian2lava.sk v0.0.4
# ==============
# Let users revert obsidian back to lava.
# ==============
Expand Down Expand Up @@ -45,6 +45,6 @@ on block form of obsidian:
loop all players:
if distance between loop-player and event-location < 30:
set {_lang} to getlangcode(loop-player)
set {_prefix} to getlang("prefix",{_lang})
set {_msg} to getlang("og_o2lforminfo",{_lang})
set {_prefix} to getlang("prefix",{_lang})
set {_msg} to getlang("og_o2lforminfo",{_lang})
send "%{_prefix}% %{_msg}%" to loop-player
4 changes: 2 additions & 2 deletions SkyBlock/addons/storage.sk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# ==============
# storage.sk v0.0.4
# storage.sk v0.0.5
# ==============
# Let players create efficient storage units without the need to building big hopper storage systems.
# ==============
Expand Down Expand Up @@ -318,7 +318,7 @@ on inventory open:
if slot 26 of event-inventory is clay:
if line 2 of lore of slot 26 of event-inventory is "STORAGE":
set {_loc} to block at event-inventory.getHolder().getLocation()
set {_allowed} to checkislandaccess(player,{_loc},"PlayerInteractEvent",block at {_loc})
set {_allowed} to checkislandaccess(player,{_loc},"storageunit",block at {_loc})
if {_allowed} is true:
openstoragemenu(player,event-inventory,{_loc})
cancel event
Expand Down
12 changes: 12 additions & 0 deletions SkyBlock/config/flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ defaultislandflags-foreign:
#
# > Allow others to use jetboots on the island of the player. True = allowed, false = denied.
- jetboots: false
#
# > Allow others to access to the storage unit. True = allowed, false = denied.
- storageunit: false

#
# > Default Flags for player islands (trusted flags):
Expand Down Expand Up @@ -91,6 +94,9 @@ defaultislandflags-trusted:
#
# > Allow others to use jetboots on the island of the player. True = allowed, false = denied.
- jetboots: true
#
# > Allow others to access to the storage unit. True = allowed, false = denied.
- storageunit: false

#
# > Default Flags for player islands (member flags):
Expand Down Expand Up @@ -132,6 +138,9 @@ defaultislandflags-member:
#
# > Allow others to use jetboots on the island of the player. True = allowed, false = denied.
- jetboots: true
#
# > Allow others to access to the storage unit. True = allowed, false = denied.
- storageunit: false

#
# > Flags for not inhabited islands:
Expand Down Expand Up @@ -174,3 +183,6 @@ defaultlobbyflag:
#
# > Allow others to use jetboots on the island of the player. True = allowed, false = denied.
- jetboots: false
#
# > Allow others to access to the storage unit. True = allowed, false = denied.
- storageunit: false
2 changes: 2 additions & 0 deletions SkyBlock/lang/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ language:
- flag_entityclickt: "&rEntities"
- flag_redstonet: "&rRedstone"
- flag_jetbootst: "&rJetBoots"
- flag_storageunitt: "&rLagersystem"
- flag_flagst: "Flags"
- flag_foreignt: "Flags für Fremde"
- flag_trustedt: "Flags für Vertraute"
Expand All @@ -264,6 +265,7 @@ language:
- flag_entityclickd: <s1>Erlaubt diesen Spielern,<nl><s1>Entities anzuklicken.
- flag_redstoned: <s1>Erlaubt diesen Spielern,<nl><s1>Redstone Einstellungen<nl><s1>zu ändern.
- flag_jetbootsd: <s1>Erlaubt diesen Spielern,<nl><s1>JetBoots zu verwenden.
- flag_storageunitd: <s1>Erlaubt diesen Spielern,<nl><s1>auf das Lagersystem<nl><s1>zuzugreifen.
- flag_foreignd: <s1>Erlaube Fremden diverse<nl><s1>Aktionen auf deiner Insel<nl><s1>auszuführen, ändere<nl><s1>diese Einstellungen hier.
- flag_trustedd: <s1>Erlaube Vertrauten diverse<nl><s1>Aktionen auf deiner Insel<nl><s1>auszuführen, ändere<nl><s1>diese Einstellungen hier.
- flag_memberd: <s1>Erlaube Mitgliedern diverse<nl><s1>Aktionen auf deiner Insel<nl><s1>auszuführen, ändere<nl><s1>diese Einstellungen hier.
Expand Down