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