########################################### # Made by Smellyonionman for Smellycraft. # # onion@smellycraft.com # # Tested on Denizen-1.1.2-b4566-DEV # # Version 1.3.2 # #-----------------------------------------# # Updates and notes are found at: # # https://smellycraft.com/d/smellytunes # #-----------------------------------------# # You may use, modify or share this # # script, provided you don't remove # # or alter lines 1-13 of this file. # ########################################### sc_tu_init: type: task debug: false script: - define namespace:sc_tu - define admin:> - define targets:]].include[].deduplicate||> - define filename: - if ]>: - if : - ~yaml unload id:sc_tu - ~yaml load:../Smellycraft/<[filename]> id:sc_tu - else: - ~yaml create id:sc_tu - ~yaml loadtext: id:sc_tu - if ].not>: - define msg:'>' - narrate <[msg].unescaped.parse_color> targets:<[targets]> - stop - foreach >> as:task: - if ]||]>>]>].not>: - define placeholder:> - narrate '<[placeholder].replace[[script]].with[<[task]>].separated_by[&sp].unescaped.parse_color>' targets:<[targets]> - stop - ~yaml savefile:../Smellycraft/<[filename]> id:sc_tu - if : - ~yaml load:../Smellycraft/data/jukeboxes.yml id:sc_tu_jb - foreach as:jukebox: - yaml set <[jukebox]>.state:finished id:sc_tu_jb - else: - ~yaml create id:sc_tu_jb - define feedback:> - inject >]> sc_tu_cmd: type: command debug: false name: smellytunes description: usage: /smellytunes (reload|enable|disable|update|redstone|range|max|credits) script: - define namespace:sc_tu - if : - define admin:> - if : - if ]||false> || || : - define arg: - inject - else if : - define feedback:&9made&spby&spyour&spfriend&sp&6smellyonionman&9!&nl&9Go&spto&sp&ahttps&co//smellycraft.com/smellytunes&sp&9for&spinfo. - else if : - if ]||false> || || : - if : - stop - ~yaml set settings.enabled:false - define feedback:> - else: - define feedback:> - else if : - if ]||false> || || : - if : - stop - yaml set settings.enabled:true - define feedback:> - else: - define feedback:> - if <[feedback].exists>: - inject >]> sc_tu_listener: type: world debug: true events: on reload scripts: - if ].not||false>: - inject on server start priority:1: - inject on shutdown: - define namespace:sc_tu - inject - yaml savefile:../Smellycraft/data/jukeboxes.yml id:sc_tu_jb - yaml unload id:sc_tu - yaml unload id:sc_tu_jb on delta time hourly: - define namespace:sc_tu - define silent:true - inject - if : - inject >]> on player right clicks jukebox: - define namespace:sc_tu - inject - if : - if >: - determine fulfilled - determine passively cancelled - define use:> - if ]> || : - define max: - foreach : - if .state].matches[playing]>: - define playing:++ - define bypass:> - if <[playing].is[LESS].than[<[max]>]||true> || ]> || : - define redstone:> - if <[redstone].not.or[]>: - if : - take - yaml set .track: id:sc_tu_jb - yaml set .scriptname: id:sc_tu_jb - yaml set .queue: id:sc_tu_jb - yaml set .state:playing id:sc_tu_jb - yaml set sc_tu.playcount.:++ id:sc_ - ~yaml savefile:../Smellycraft/data/jukeboxes.yml id:sc_tu_jb - define range:> - define volume:].pass[]>].fail[<[range]>]> - define feedback:><&sp> - inject >]> - define dir:> - ~midi file:<[dir]>/ volume:<[volume]> - yaml set .state:finished id:sc_tu_jb - ~yaml savefile:../Smellycraft/data/jukeboxes.yml id:sc_tu_jb - else: - define feedback:> - else: - define feedback:> - else: - define feedback:> - if <[feedback].exists>: - inject >]> on player breaks jukebox: - define namespace:sc_tu - modifyblock air naturally - inject sc_tu_eject: type: task debug: true script: - foreach as:jukebox: - if <[jukebox].matches[]>: - determine passively cancelled - if .state].matches[playing|finished]>: - if .state].matches[playing]>: - midi cancel - define queue:.queue]||null> - if ]>: - queue ]> stop - drop .scriptname]>]> - yaml set <[jukebox]>:! id:sc_tu_jb - ~yaml savefile:../Smellycraft/data/jukeboxes.yml id:sc_tu_jb - stop sc_tu_data: type: yaml data version: 1.3.2 filename: smellytunes.yml scripts: reload: sc_tu_init save: sc_common_save update: sc_common_update sc_tu_defaults: type: yaml data poorly_disguised_comments: if_you_delete_jukeboxes_dot_yml: 'All of your players jukeboxes will be irreversibly emptied.' download_common_files_at: 'https://smellycraft.com/denizen/common' coming_soon: 'admin gui, redstone controls, vinyl press, surround sound' warning: 'this plugin was meant for high performance servers. Set "max" accordingly.' settings: max: 3 redstone: false range: 5 enabled: true dir: smellytunes update: true permissions: use: smellytunes.use bypass: smellytunes.bypass admin: smellytunes.admin scripts: narrator: sc_common_feedback GUI: sc_common_marquee messages: prefix: '&9[&aSmelly&2Tunes&9]' description: 'Interfaces with the Smellytunes plugin.' reload: '&9Plugin has been successfully reloaded.' missing_common: '&This plugin uses code contained in sc_common.yml. Visit https://smellycraft.com/d/common for the most recent version.' missing_script: '&9 Script &a[script] &9was not detected. &c Installation not complete. &9An alternative is available in the Common Files.' wait: '&9Please wait...' playing: '&9Now playing:' playcount: '&cToo many songs playing.' nosignal: '&cRedstone signal required.' enabled: '&9Plugin has been &aenabled&9.' disabled: '&9Plugin has been &cdisabled&9.' titlecolor: &a lorecolor: &9