This commit is contained in:
Ajneb97 2026-06-02 14:51:59 -04:00
parent 61a6445450
commit 79f916158d
4 changed files with 13 additions and 2 deletions

View file

@ -6,7 +6,7 @@
<groupId>pk.ajneb97</groupId>
<artifactId>PlayerKits2</artifactId>
<version>1.22.1</version>
<version>1.22.2</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>

View file

@ -405,6 +405,9 @@ public class KitsManager {
case "playsound":
ActionUtils.playSound(player,actionLine);
break;
case "playsound_resource_pack":
ActionUtils.playSoundResourcePack(player,actionLine);
break;
case "actionbar":
ActionUtils.actionbar(player,actionLine,plugin);
break;

View file

@ -111,7 +111,7 @@ public class VerifyManager {
String[] actionText = action.getAction().split(" ");
String actionName = actionText[0];
if(actionName.equals("console_command:") || actionName.equals("player_command:")
|| actionName.equals("playsound:") || actionName.equals("actionbar:")
|| actionName.equals("playsound:") || actionName.equals("playsound_resource_pack:") || actionName.equals("actionbar:")
|| actionName.equals("title:") || actionName.equals("firework:")
|| actionName.equals("close_inventory") || actionName.equals("message:")){
continue;

View file

@ -54,6 +54,14 @@ public class ActionUtils {
player.playSound(player.getLocation(), sound, volume, pitch);
}
public static void playSoundResourcePack(Player player, String soundLine){
String[] sep = soundLine.split(";");
String sound = sep[0];
float volume = Float.parseFloat(sep[1]);
float pitch = Float.parseFloat(sep[2]);
player.playSound(player.getLocation(), sound, volume, pitch);
}
private static Sound getSoundByName(String name){
try {
Class<?> soundTypeClass = Class.forName("org.bukkit.Sound");