diff --git a/lohub/src/main/java/com/loki/lohub/actions/impl/SoundAction.java b/lohub/src/main/java/com/loki/lohub/actions/impl/SoundAction.java index b742fef..e1e3cb5 100644 --- a/lohub/src/main/java/com/loki/lohub/actions/impl/SoundAction.java +++ b/lohub/src/main/java/com/loki/lohub/actions/impl/SoundAction.java @@ -16,9 +16,14 @@ public class SoundAction implements Action { Sound parsedSound; try { - parsedSound = Sound.valueOf(parts[0].toUpperCase()); + String soundName = parts[0].toUpperCase().trim(); + parsedSound = Sound.valueOf(soundName); } catch (IllegalArgumentException e) { - parsedSound = Sound.ENTITY_EXPERIENCE_ORB_PICKUP; + try { + parsedSound = Sound.ENTITY_EXPERIENCE_ORB_PICKUP; + } catch (NoSuchFieldError ex) { + parsedSound = Sound.valueOf("ENTITY_EXPERIENCE_ORB_PICKUP"); + } } this.sound = parsedSound; @@ -28,7 +33,9 @@ public class SoundAction implements Action { @Override public void execute(Player player) { - player.playSound(player.getLocation(), sound, volume, pitch); + if (player != null && sound != null) { + player.playSound(player.getLocation(), sound, volume, pitch); + } } @Override diff --git a/spacelegacy-config.yml b/spacelegacy-config.yml new file mode 100644 index 0000000..f5decd4 --- /dev/null +++ b/spacelegacy-config.yml @@ -0,0 +1,344 @@ +# ╔══════════════════════════════════════════════════════════════════════════════╗ +# ║ LoHub Configuration - SpaceLegacy ║ +# ║ Hub plugin for Paper/Folia 1.20.1+ ║ +# ╚══════════════════════════════════════════════════════════════════════════════╝ + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | GENERAL SETTINGS | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +check-updates: true + +# Disabled worlds (plugin won't work there) +disabled-worlds: + invert: false + worlds: + - world_nether + - witp + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | SPAWN SETTINGS | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +spawn: + teleport-on-join: true + teleport-on-respawn: true + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | WORLDGUARD INTEGRATION | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +worldguard: + auto-create-region: true + region-radius: 100 + region-name: "lohub_spawn" + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | WORLD PROTECTION | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +world_settings: + disable_hunger_loss: true + disable_fall_damage: true + disable_player_pvp: true + disable_void_death: true + disable_fire_damage: true + disable_drowning: true + disable_off_hand_swap: true + disable_weather_change: true + disable_death_message: true + disable_mob_spawning: true + disable_item_drop: true + disable_item_pickup: false + disable_block_break: true + disable_block_place: true + disable_block_interact: true + disable_block_burn: true + disable_block_fire_spread: true + disable_block_leaf_decay: true + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | LAUNCHPAD | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +launchpad: + enabled: true + launch_power: 3.0 + launch_power_y: 1.0 + top_block: STONE_PRESSURE_PLATE + bottom_block: REDSTONE_BLOCK + actions: + - '[SOUND] ENTITY_BAT_TAKEOFF' + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | DOUBLE JUMP | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +double_jump: + enabled: false + launch_power: 1.0 + launch_power_y: 0.9 + cooldown: 3 + actions: + - '[SOUND] ENTITY_BAT_TAKEOFF' + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | COMMAND BLOCKER | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +command_block: + enabled: true + blocked_commands: + - /pl + - /plugins + - /? + - /bukkit:? + - /bukkit:plugins + - /bukkit:pl + - /bukkit:help + - /ver + - /version + - /bukkit:version + - /bukkit:ver + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | ANTI-SWEAR | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +anti_swear: + enabled: true + blocked_words: + - блять + - сука + - пизда + - хуй + - ебать + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | PLAYER JOIN | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +join_leave_messages: + enabled: true + join_message: "&#B798A8&l▶ ẲE9%player% &7присоединился" + quit_message: "&c&l◀ &#B798A8%player% &7вышел" + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | SERVER SWITCH MESSAGES | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +server_switch_messages: + enabled: true + switch_message: "&#B798A8&l▶ ẲE9%player% &7подключился к &#B798A8%server%" + server_names: + hub: "Хабу" + vanilla: "Ванилле" + grif: "Грифу" + darktown: "Даркауну" + +join_events: + - "[CONSOLE] effect clear %player%" + - "[MESSAGE] &#B798A8&m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + - "[MESSAGE] &r" + - "[MESSAGE] &7Добро пожаловать, ẲE9&n%player%&r&7!" + - "[MESSAGE] &r" + - "[MESSAGE] &#B798A8&l♦ &#B798A8s&#B192AFp&#AA8BB5a&#A485BCc E7EC2e⚖C9l⏔CFeB6BD6gⅵDCaE5EE3cẲE9y" + - "[MESSAGE] &#B798A8&l♦ САЙТ ẲE9spacelegacy.ru" + - "[MESSAGE] &#B798A8&l♦ DISCORD &f/discord" + - "[MESSAGE] &r" + - "[MESSAGE] &7&oЖелаем приятной игры!" + - "[MESSAGE] &#B798A8&m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + - "[TITLE] &#B798A8s&#B192AFp&#AA8BB5a&#A485BCc E7EC2e⚖C9l⏔CFeB6BD6gⅵDCaE5EE3cẲE9y;&fДобро пожаловать!;1;3;1" + - "[SOUND] ENTITY_PLAYER_LEVELUP" + - "[GAMEMODE] survival" + +join_settings: + spawn_join: true + heal: true + extinguish: true + clear_inventory: false + + firework: + enabled: true + first_join_only: true + type: BALL_LARGE + power: 1 + flicker: true + trail: true + colors: + - PURPLE + - WHITE + - BLUE + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | CUSTOM JOIN ITEMS | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +custom_join_items: + enabled: true + disable_inventory_movement: true + + items: + parkour: + material: FEATHER + amount: 1 + slot: 0 + display_name: "&#B798A8&l♦ ẲE9Паркур" + lore: + - "&7Нажми ПКМ, чтобы перейти на паркур" + actions: + - "[MESSAGE] &#B798A8&m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + - "[MESSAGE] &#B798A8&l♦ &fТелепортация на ẲE9Паркур&f..." + - "[MESSAGE] &#B798A8&m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + - "[CONSOLE] ip forcejoin %player%" + - "[SOUND] ENTITY_ENDERMAN_TELEPORT" + + server_selector: + material: NETHER_STAR + amount: 1 + slot: 4 + display_name: "&#B798A8&l♦ ẲE9Выбор Режима" + lore: + - "&7Нажми ПКМ, чтобы выбрать режим" + actions: + - "[MENU] serverselector" + + player_hider: + material: LIME_DYE + amount: 1 + slot: 8 + display_name: '&a&l♦ ẲE9Игроки видны &7(ПКМ)' + lore: + - '&7Скрыть лишних игроков' + actions: + - "[PLAYER_HIDER]" + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | PLAYER HIDER | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +player_hider: + enabled: true + slot: 8 + disable_inventory_movement: true + cooldown: 3 + + not_hidden: + material: LIME_DYE + amount: 1 + display_name: '&a&l♦ ẲE9Игроки видны &7(ПКМ)' + lore: + - '&7Нажми, чтобы скрыть' + + hidden: + material: GRAY_DYE + amount: 1 + display_name: '&c&l♦ &#B798A8Игроки скрыты &7(ПКМ)' + lore: + - '&7Нажми, чтобы показать' + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | SCOREBOARD | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +scoreboard: + enabled: false + + display_delay: + server_enter: 60 + world_change: 40 + + refresh: + enabled: true + rate: 200 + + title: "&#B798A8s&#B192AFp&#AA8BB5a&#A485BCc E7EC2e⚖C9l⏔CFeB6BD6gⅵDCaE5EE3cẲE9y" + lines: + - "&#B798A8&m━━━━━━━━━━━━━━━━━━━━━━" + - "&#B798A8◆ &fИгрокẲE9:" + - " &7%player%" + - "" + - "&#B798A8◆ &fРангẲE9:" + - " ẲE9%vault_rank%" + - "" + - "&#B798A8◆ &fОнлайнẲE9:" + - " &f%online% игроков" + - "&#B798A8&m━━━━━━━━━━━━━━━━━━━━━━" + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | TABLIST | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +tablist: + enabled: true + + refresh: + enabled: true + rate: 400 + + header: + - "" + - " &#B798A8s&#B192AFp&#AA8BB5a&#A485BCc E7EC2e⚖C9l⏔CFeB6BD6gⅵDCaE5EE3cẲE9y " + - "&fСервер: &#B798A8s&#B192AFp&#AA8BB5a&#A485BCc E7EC2e⚖C9l⏔CFeB6BD6gⅵDCaE5EE3cẲE9y.ru &7| &fОнлайн: ẲE9%online%" + - "" + + footer: + - "" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "&#B798A8◆ &fНаш DiscordẲE9: &7/discord" + - "&#B798A8◆ &fСайтẲE9: &fspacelegacy.ru" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "" + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | ANNOUNCEMENTS | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + +announcements: + enabled: true + delay: 120 + required_players: 1 + + sound: + enabled: true + value: BLOCK_NOTE_BLOCK_PLING + volume: 1.0 + pitch: 1.5 + + announcements: + announce1: + - "&r" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "&#B798A8&l♦ ОБЪЯВЛЕНИЕ" + - "&7Добро пожаловать на &#B798A8s&#B192AFp&#AA8BB5a&#A485BCc E7EC2e⚖C9l⏔CFeB6BD6gⅵDCaE5EE3cẲE9y&7!" + - "&7Приятной игры и честных сражений!" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "&r" + announce2: + - "&r" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "&#B798A8&l♦ ОБЪЯВЛЕНИЕ" + - "&7Наш Discord для связи с тех-поддержкой:" + - "ẲE9/discord или /links" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "&r" + announce3: + - "&r" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "&#B798A8&l♦ ОБЪЯВЛЕНИЕ" + - "&7Наш сайт: ẲE9spacelegacy.ru" + - "&7Следи за обновлениями сервера!" + - "&#B798A8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + - "&r" + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | CUSTOM COMMANDS | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# All custom commands are now in commands.yml +# You can create custom commands with actions there + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# | MESSAGES | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +# All messages are now in messages.yml +# You can customize the plugin prefix and all messages there