Follow command sounds setting

This commit is contained in:
cyberpwn 2021-08-29 09:39:00 -04:00
parent f3d899cbf5
commit 7997d52df5

View File

@ -19,6 +19,7 @@
package com.volmit.iris.util.decree;
import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.decree.virtual.VirtualDecreeCommand;
import com.volmit.iris.util.format.C;
@ -59,9 +60,12 @@ public interface DecreeSystem extends CommandExecutor, TabCompleter {
v.removeDuplicates();
if(sender instanceof Player)
{
if(IrisSettings.get().getGeneral().isCommandSounds())
{
((Player)sender).playSound(((Player)sender).getLocation(), Sound.BLOCK_AMETHYST_BLOCK_CHIME, 0.25f, RNG.r.f(0.125f, 1.95f));
}
}
return v;
}
@ -75,16 +79,22 @@ public interface DecreeSystem extends CommandExecutor, TabCompleter {
J.aBukkit(() -> {
if (!call(new VolmitSender(sender), args)) {
if(IrisSettings.get().getGeneral().isCommandSounds())
{
if(sender instanceof Player)
{
((Player)sender).playSound(((Player)sender).getLocation(), Sound.BLOCK_ANCIENT_DEBRIS_BREAK, 1f, 0.25f);
((Player)sender).playSound(((Player)sender).getLocation(), Sound.BLOCK_RESPAWN_ANCHOR_DEPLETE, 0.2f, 1.95f);
}
}
sender.sendMessage(C.RED + "Unknown Iris Command");
}
else
{
if(IrisSettings.get().getGeneral().isCommandSounds())
{
if(sender instanceof Player)
{
@ -92,6 +102,7 @@ public interface DecreeSystem extends CommandExecutor, TabCompleter {
((Player)sender).playSound(((Player)sender).getLocation(), Sound.BLOCK_RESPAWN_ANCHOR_CHARGE, 0.125f, 2.99f);
}
}
}
});
return true;
}