#
# @param p = player
# @param type = Shop name
# @param item = Edit shop item
#
function guiShopsManager(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
create gui with virtual chest inventory with 6 rows named "@Editör [%{_type} ? "&4&lERROR"%&r]" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
cancel event
edit gui last gui:
{_type} is "@anemys":
set {_items::*} to getShops() if {shops::created::*} is set
else:
getShops() contains {_type}:
set {_items::*} to getShopItems({_type})
make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
open guiShopsManager({_p}, "@anemys", {_item}) for {_p}
make gui slot "N" with {NBT::heads::1} named "&eüʀüɴ ᴇᴋʟᴇ &8[&6&l+&8]" with lore "", "&7üʀüɴü süʀüᴋʟᴇʏɪᴘ ʙᴜ sʟᴏᴛᴀ" and "&7ʏᴇʀʟᴇşᴛɪʀɪɴ.":
cursor slot of {_p} doesn't contain air:
eventHandlerProfile({_p}, "1", "forGui", "entity.enderman.teleport", "0.1", "thin")
set {_cursor} to cursor slot of {_p}
addShopItems("%metadata value "uiEditorMETA" of {_p}%", {_cursor})
open guiShopsManager({_p}, metadata value "uiEditorMETA" of {_p}, {_item}) for {_p}
else:
set {_items::*} to getShopsRequirement({_type}, {_i})
loop {_split::*}:
{_items::%loop-counter%} is set:
{_type} is "@anemys":
set {_i} to getGuiItem("@setup", {_type}, "%{_items::%loop-counter%}%", {NBT::heads::4})
else:
set {_i} to getGuiItem("@setup", {_type}, "", {_items::%loop-counter%})
make gui slot loop-value with {_i}:
gui click type is not double click, left mouse with shift or drop key with control:
eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
set {_i} to {_items::%index of event-slot + 1%}
{_type} is "@anemys":
open guiShopsManager({_p}, {_i}, {_item}) for {_p}
set metadata value "uiEditorMETA" of {_p} to {_i}
else:
getShops() contains {_i}:
set metadata value "uiEditorMETA" of {_p} to {_i}
open guiShopsManager({_p}, {_i}, {_item}) for {_p}
else:
open guiShopsEditor({_p}, "%metadata value "uiEditorMETA" of {_p}%", {_i}) for {_p}
else:
gui click type is drop key with control:
eventHandlerProfile({_p}, "1", "forGui", "block.note_block.bell", "0.1", "thin")
{_type} is "@anemys":
set {_has} to {_items::%index of event-slot + 1%}
removeShop({_has})
delete {manager::slot::%{_has}%::*}
delete {manager::items::%{_has}%::*}
open guiShopsManager({_p}, "@anemys", {_item}) for {_p}
else:
removeShopItems({_type}, {_items::%index of event-slot + 1%})
open guiShopsManager({_p}, {_type}, {_item}) for {_p}
else:
eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
send title "&4&l!" with subtitle "&cʟüᴛғᴇɴ ʙɪʀᴀᴢ ɴᴀᴢɪᴋ ᴏʟᴜɴ" to player for 5 seconds with fadein 0 second
close {_p}'s inventory
stop loop if {_items::%loop-counter + 1%} is not set
return last gui
#
# @param p = player
# @param type = Shop name
# @param item = Edit shop item
#
function guiShopsEditor(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
set {_name} to name of {_item} ? "&a%raw name of {_item}%"
create gui with virtual chest inventory with 6 rows named "@Item [%{_type} ? "&4&lERROR"%&r] - %{_name}%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
cancel event
make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
open guiShopsManager({_p}, {_type}, {_item}) for {_p}
make gui slot "M" with {NBT::heads::5} named "&eɢᴇʀᴇᴋsɪɴɪᴍ ekle &8[&6&l+&8]" with lore "", "&7üʀüɴü süʀüᴋʟᴇʏɪᴘ ʙᴜ sʟᴏᴛᴀ" and "&7ʏᴇʀʟᴇşᴛɪʀɪɴ.":
cursor slot of {_p} doesn't contain air:
eventHandlerProfile({_p}, "1", "forGui", "entity.enderman.teleport", "0.1", "thin")
addShopsRequirement({_type}, {_item}, cursor slot of {_p})
open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
set {_lore} to name of {_item} ? "&a%raw name of {_item}%"
set {_slotNumber} to {manager::slot::%{_type}%::%{_item}%}
make gui slot "S" with {_item} named "&eᴅüᴢᴇɴʟᴇɴᴇɴ üʀüɴ" with lore "", "&8ʙɪʟɢɪ:", " &7● &fᴀᴅı: %{_lore}%", "" and "&6► &eᴏᴛᴏᴍᴀᴛɪᴋ ᴋᴀʏᴅᴇᴅɪʟɪʀ"
make gui slot "O" with {NBT::heads::6} named "&esʟᴏᴛ ɴᴜᴍᴀʀᴀsı sᴇç" with lore "", "&8ʙɪʟɢɪ:", " &7● &fsʟᴏᴛ ɴᴜᴍᴀʀᴀsı:&b %({_slotNumber} -1) ? -1%", "" and "&6► &esʟᴏᴛ ɴᴜᴍᴀʀᴀsı sᴇçᴍᴇᴋ ɪçɪɴ &6[ᴛıᴋʟᴀ]":
eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
open openSlotEditor({_p}, {_type}, {_item}) for {_p}
set {_items::*} to getShopsRequirement({_type}, {_item})
loop {_split::*}:
{_items::%loop-counter%} is set:
make gui slot loop-value with getGuiItem("@setup", {_item}, "@Item", {_items::%loop-counter%}) :
gui click type is drop key with control:
eventHandlerProfile({_p}, "1", "forGui", "block.note_block.bell", "0.1", "thin")
removeShopsRequirement({_type}, {_item}, {_items::%index of event-slot + 1%})
open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
return last gui
#
# @param p = player
# @param type = Shop name
# @param item = Editing item
#
function openSlotEditor(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
set {_name} to name of {_item} ? "&a%raw name of {_item}%"
create gui with virtual chest inventory with 6 rows named "@Slot [%{_type} ? "&4&lERROR"%] - %{_name}%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
set {_items::*} to getShopItems({_type})
loop {_split::*}:
set {_n} to loop-counter
{manager::slot::%{_type}%::%{_item}%} != {_n}:
make gui slot loop-value with white stained glass pane named "&fsʟᴏᴛ: &e%{_n}-1% &8[&6##ID-%{_split::%{_n}%}%&o/@%{_type}%&8]"
set {manager::slot::%{_type}%::%{_item}%} to {_n}
open openSlotEditor({_p}, {_type}, {_item}) for {_p}
else:
make gui slot loop-value with (* stained glass pane of sharpness 1) named "&fsʟᴏᴛ: &e%{_n}-1% &8[&6##ID-%{_split::%{_n}%}%&o/@%{_type}%&8]"
stop loop if loop-counter = 45
make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f"
make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
return last gui
#
# @param p = player
# @param type = Shop name
#
function openShop(p: OFFLINE PLAYER, type: STRING) :: INVENTORY:
create gui with virtual chest inventory with 6 rows named "%{_type} ? "&4&lERROR"%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
#make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
# cancel event
set {_items::*} to getShopItems({_type})
loop {_split::*}:
add 1 to {_n}
{_items::%{_n}%} is set:
set {_getSlotNumber} to {_split::%{manager::slot::%{_type}%::%{_items::%{_n}%}%}%}
make gui slot {_getSlotNumber} with getGuiItem("@anemys", {_type}, "@Item", {_items::%{_n}%}) :
gui click type is not double click:
set {_i} to {_items::%{_n}%}
set {_list::*} to getShopsRequirement({_type}, {_i})
player has getShopsRequirement({_type}, {_i}):
remove getShopsRequirement({_type}, {_i}) from {_p}'s inventory
give {_i} to {_p}
else:
eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
send title "&4&l!" with subtitle "&cɢᴇʀᴇᴋsɪɴɪᴍʟᴇʀɪ ᴋᴀʀşıʟᴀᴍıʏᴏʀsᴜɴᴜᴢ" to player for 5 seconds with fadein 0 second
close {_p}'s inventory
else:
eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
send title "&4&l!" with subtitle "&cʟüᴛғᴇɴ ʙɪʀᴀᴢ ɴᴀᴢɪᴋ ᴏʟᴜɴ" to player for 5 seconds with fadein 0 second
close {_p}'s inventory
return last gui