9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2026-01-06 15:41:35 +00:00

Add title animation sound

This commit is contained in:
SamB440
2021-10-10 17:02:59 +01:00
parent a41941bc5f
commit 02054b2b78
3 changed files with 12 additions and 0 deletions

View File

@@ -1,11 +1,13 @@
package net.islandearth.rpgregions.utils;
import net.islandearth.rpgregions.api.IRPGRegionsAPI;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.List;
import java.util.Locale;
public class TitleAnimator {
@@ -30,6 +32,13 @@ public class TitleAnimator {
plugin.getConfig().getInt("settings.server.discoveries.discovered.title.fadein"),
plugin.getConfig().getInt("settings.server.discoveries.discovered.title.stay"),
plugin.getConfig().getInt("settings.server.discoveries.discovered.title.fadeout"));
final String animationSound = plugin.getConfig().getString("settings.server.discoveries.discovered.title.animation_sound", Sound.BLOCK_TRIPWIRE_CLICK_ON.name());
final int animationSoundPitch = plugin.getConfig().getInt("settings.server.discoveries.discovered.title.animation_sound_pitch", 1);
if (current >= 1) {
final Sound sound = Sound.valueOf(animationSound.toUpperCase(Locale.ROOT));
player.playSound(player.getLocation(), sound, 1f, animationSoundPitch);
}
current++;
}
}.runTaskTimer((JavaPlugin) plugin, 0L, speed);

View File

@@ -237,6 +237,7 @@ public class RPGRegionsCommand extends BaseCommand {
public void onDelete(CommandSender sender, Player player) {
if (player != null) {
plugin.getManagers().getStorageManager().deleteAccount(player.getUniqueId());
sender.sendMessage(ChatColor.GREEN + "Deleted account of player.");
} else {
sender.sendMessage(ChatColor.RED + "That player cannot be found.");
}

View File

@@ -39,6 +39,8 @@ settings:
fadeout: 20
animation_speed: 20 # Controls how fast the animation moves to the next frame
cooldown: 0
animation_sound: BLOCK_TRIPWIRE_CLICK_ON # Sound to play during animation
animation_sound_pitch: 1
sound:
name: UI_TOAST_CHALLENGE_COMPLETE
pitch: 1