Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on script load:
- reloadRecipes()
- command /recipemaker:
- permission: skript.admin
- trigger:
- openRecipeMakerMenu(player)
- command /recipes:
- permission: skript.admin
- trigger:
- openRecipesListMenu(player)
- command /officialRecipe [<text>]:
- permission: skript.admin
- trigger:
- if player's tool is not set:
- send "&c&l操作したいアイテムを手に持ってください。"
- stop
- if arg-1 is not "add" or "remove":
- send "&c&ladd &7or &c&lremove"
- stop
- if arg-1 is "add":
- if {officialRecipe::*} contains "%id of player's tool%":
- send "&c&lそのアイテムは既に追加されています。"
- stop
- add "%id of player's tool%" to {officialRecipe::*}
- send "&a&l%player's tool%&7を追加しました!"
- stop
- if {officialRecipe::*} doesn't contain "%id of player's tool%":
- send "&c&lそのアイテムは追加されていません。"
- stop
- remove "%id of player's tool%" from {officialRecipe::*}
- send "&a&l%player's tool%&7を削除しました!"
- on craft:
- if name of event-item contains "&d&lレシピペーパー":
- slot 5 of player's current inventory is air
- send "&c&lこのアイテムは作成できません。"
- cancel event
- else:
- {officialRecipe::*} doesn't contain "%id of event-item%"
- {unlockedRecipe::%player's uuid%::*} doesn't contain "%id of event-item%"
- cancel event
- send "&c&l未開放のアイテムのため作成できません。"
- on right click with paper:
- name of player's tool starts with "&d&lレシピペーパー"
- cancel event
- set {_string} to uncoloured name of player's tool
- set {_length} to length of {_string}
- set {_item} to last {_length} - 8 character of {_string}
- loop all items:
- "%type of loop-item%" is {_item}
- set {_item} to loop-item
- set {_id} to id of loop-item
- exit loop
- add "%{_id}%" to {unlockedRecipe::%player's uuid%::*}
- send "&b&l%{_item}%&7のレシピを開放しました!"
- remove 1 of player's tool from player's inventory
- on inventory click: #Toggle (shaped | shapeless) mode
- name of event-inventory is "&a&lRecipe &e&lMaker"
- clicked slot is 41
- cancel event
- if clicked item is lime wool block:
- itemPutter(red wool named "&c素材の並びを限定しない", 41, 1, 1, player, false)
- else:
- itemPutter(lime wool named "&a素材の並びを限定する", 41, 1, 1, player, false)
- on inventory click: #Show item recipe
- name of event-inventory is "&a&lRecipes &e&lList"
- slot (clicked slot) of player's current inventory is not air
- clicked type is not right mouse button with shift
- cancel event
- close player's inventory
- wait 3 tick
- set {_slot} to clicked slot
- add 1 to {_slot}
- if {customRecipe::%{_slot}%::shaped::product} is set:
- set {_item} to {customRecipe::%{_slot}%::shaped::product}
- else:
- set {_item} to {customRecipe::%{_slot}%::shapeless::product}
- if name of {_item} is set:
- set {_item} to name of {_item}
- else:
- set {_item} to "%type of {_item}%"
- openRecipeMaterialMenu(player, {_item}, {_slot})
- on inventory click: #Remove item recipe
- name of event-inventory is "&a&lRecipes &e&lList"
- clicked type is right mouse button with shift
- slot (clicked slot) of player's current inventory is not air
- cancel event
- set {_slot} to clicked slot
- add 1 to {_slot}
- delete {customRecipe::%{_slot}%::shaped::product}
- delete {customRecipe::%{_slot}%::shapeless::product}
- loop 9 times:
- delete {customRecipe::%{_slot}%::material::%loop-number%}
- delete {customRecipe::%{_slot}%}
- set slot (clicked slot) of player's current inventory to air
- reloadRecipes()
- send "&c&lレシピを消去しました。 &7反映させるにはサーバーを再起動してください。"
- on inventory click: #Listener of recipe maker
- name of event-inventory is "&a&lRecipe &e&lMaker"
- clicked slot is 44
- cancel event
- if slot 25 of player's current inventory is air:
- send "&cレシピにより作成されるアイテムを右のスロットに置いてください。"
- stop
- else:
- slot 10 of player's current inventory is air
- slot 11 of player's current inventory is air
- slot 12 of player's current inventory is air
- slot 19 of player's current inventory is air
- slot 20 of player's current inventory is air
- slot 21 of player's current inventory is air
- slot 28 of player's current inventory is air
- slot 29 of player's current inventory is air
- slot 30 of player's current inventory is air
- send "&c最低一つは素材を指定してください。"
- stop
- set {_item1} to slot 10 of player's current inventory
- set {_item2} to slot 11 of player's current inventory
- set {_item3} to slot 12 of player's current inventory
- set {_item4} to slot 19 of player's current inventory
- set {_item5} to slot 20 of player's current inventory
- set {_item6} to slot 21 of player's current inventory
- set {_item7} to slot 28 of player's current inventory
- set {_item8} to slot 29 of player's current inventory
- set {_item9} to slot 30 of player's current inventory
- set {_recipeFor} to slot 25 of player's current inventory
- set {_indexSize} to size of indexes of {customRecipe::*}
- add 1 to {_indexSize}
- if type of slot 41 of player's current inventory is lime wool block:
- set {customRecipe::%{_indexSize}%::shaped::product} to {_recipeFor}
- register new shaped recipe for {_recipeFor} using {_item1}, {_item2}, {_item3}, {_item4}, {_item5}, {_item6}, {_item7}, {_item8}, {_item9}
- else:
- set {customRecipe::%{_indexSize}%::shapeless::product} to {_recipeFor}
- register new shapeless recipe for {_recipeFor} using {_item1}, {_item2}, {_item3}, {_item4}, {_item5}, {_item6}, {_item7}, {_item8}, {_item9}
- loop 9 times:
- set {customRecipe::%{_indexSize}%::material::%loop-number%} to {_item%loop-number%}
- send "&a新たなレシピを登録しました。"
- function openRecipeMakerMenu(player: player):
- set {_player} to {_player}
- open chest with 5 rows named "&a&lRecipe &e&lMaker" to {_player}
- wait 1 tick
- itemPutter(white glass pane, 0, 1, 5, {_player}, true)
- itemPutter(white glass pane, 9, 9, 3, {_player}, true)
- itemPutter(white glass pane, 13, 9, 3, {_player}, true)
- itemPutter(white glass pane, 36, 1, 5, {_player}, true)
- itemPutter(white glass pane, 15, 1, 3, {_player}, true)
- itemPutter(white glass pane, 24, 0, 1, {_player}, true)
- itemPutter(white glass pane, 26, 0, 1, {_player}, true)
- itemPutter(white glass pane, 33, 1, 3, {_player}, true)
- itemPutter(lime wool named "&a素材の並びを限定する", 41, 1, 1, {_player}, false)
- itemPutter(workbench named "&6&lレシピを登録する", 44, 1, 1, {_player}, false)
- itemPutter(gray glass pane, 5, 1, 4, {_player}, true)
- itemPutter(gray glass pane, 14, 9, 3, {_player}, true)
- itemPutter(gray glass pane, 42, 1, 2, {_player}, true)
- function reloadRecipes():
- loop indexes of {customRecipe::*}:
- loop 9 times:
- if "%{customRecipe::%loop-value-1%::material::%loop-number%}%" is "0 air":
- set {_material::%loop-number%} to air
- else:
- set {_material::%loop-number%} to {customRecipe::%loop-value-1%::material::%loop-number%}
- if "%indexes of {customRecipe::%loop-value%::*}%" contains "shaped":
- register new shaped recipe for {customRecipe::%loop-value%::shaped::product} parsed as item using {_material::1}, {_material::2}, {_material::3}, {_material::4}, {_material::5}, {_material::6}, {_material::7}, {_material::8}, {_material::9}
- else:
- register new shapeless recipe for {customRecipe::%loop-value%::shapeless::product} parsed as item using {_material::1}, {_material::2}, {_material::3}, {_material::4}, {_material::5}, {_material::6}, {_material::7}, {_material::8}, {_material::9}
- loop all items:
- register new shaped recipe for paper named "&d&lレシピペーパー &3%loop-value%" using paper, paper, paper, paper, type of loop-item, paper, paper, paper, paper
- function openRecipesListMenu(player: player):
- set {_player} to {_player}
- open chest with 6 rows named "&a&lRecipes &e&lList" to {_player}
- wait 1 tick
- loop indexes of {customRecipe::*}:
- if {customRecipe::%loop-value%::shaped::product} is set:
- set {_item} to {customRecipe::%loop-value%::shaped::product}
- else:
- set {_item} to {customRecipe::%loop-value%::shapeless::product}
- set {_int} to (loop-value parsed as integer) - 1
- set lore of {_item} to "" and "&7レシピを消去する &8--- &c&lShif + 右クリック"
- itemPutter({_item}, {_int}, 1, 1, {_player}, false)
- function openRecipeMaterialMenu(player: player, title :text, index: integer):
- set {_player} to {_player}
- open chest with 5 rows named "&b%{_title}%" to {_player}
- wait 1 tick
- itemPutter(white glass pane, 0, 1, 5, {_player}, true)
- itemPutter(white glass pane, 9, 9, 3, {_player}, true)
- itemPutter(white glass pane, 13, 9, 3, {_player}, true)
- itemPutter(white glass pane, 36, 1, 5, {_player}, true)
- itemPutter(white glass pane, 15, 1, 3, {_player}, true)
- itemPutter(white glass pane, 24, 0, 1, {_player}, true)
- itemPutter(white glass pane, 26, 0, 1, {_player}, true)
- itemPutter(white glass pane, 33, 1, 3, {_player}, true)
- itemPutter(gray glass pane, 5, 1, 4, {_player}, true)
- itemPutter(gray glass pane, 14, 9, 3, {_player}, true)
- itemPutter(gray glass pane, 41, 1, 4, {_player}, true)
- if {customRecipe::%{_index}%::shaped::product} is set:
- set {_item} to {customRecipe::%{_index}%::shaped::product}
- else:
- set {_item} to {customRecipe::%{_index}%::shapeless::product}
- itemPutter({_item}, 25, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::1}, 10, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::2}, 11, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::3}, 12, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::4}, 19, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::5}, 20, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::6}, 21, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::7}, 28, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::8}, 29, 1, 1, {_player}, true)
- itemPutter({customRecipe::%{_index}%::material::9}, 30, 1, 1, {_player}, true)
- function itemPutter(item: item, start: integer, interval: integer, time: integer, player: player, unstealable: boolean):
- loop {_time} times:
- if {_unstealable} is true:
- format slot {_start} of {_player} with {_item} to be unstealable
- else:
- set slot {_start} of {_player}'s current inventory to {_item}
- add {_interval} to {_start}
Advertisement
Add Comment
Please, Sign In to add comment