File tree Expand file tree Collapse file tree
modules/actions/src/main/java/top/mrxiaom/pluginbase/actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,17 +22,17 @@ public class ActionSound implements IAction {
2222 if (sound != null ) {
2323 float volume = ConfigUtils .getFloat (section , "volume" , 1.0f );
2424 float pitch = ConfigUtils .getFloat (section , "pitch" , 1.0f );
25- return new ActionSound (sound , volume , pitch );
25+ return new ActionSound (sound . toLowerCase () , volume , pitch );
2626 }
2727 }
2828 } else {
2929 String s = String .valueOf (input );
3030 if (s .startsWith ("[sound]" )) {
31- String [] split = s .split ("," );
32- String sound = split [0 ];
33- float volume = split .length > 1 ? Util .parseFloat (split [1 ]).orElse (1.0f ) : 1.0f ;
34- float pitch = split .length > 2 ? Util .parseFloat (split [2 ]).orElse (1.0f ) : 1.0f ;
35- return new ActionSound (sound , volume , pitch );
31+ String [] split = s .substring ( 7 ). split ("," );
32+ String sound = split [0 ]. trim () ;
33+ float volume = split .length > 1 ? Util .parseFloat (split [1 ]. trim () ).orElse (1.0f ) : 1.0f ;
34+ float pitch = split .length > 2 ? Util .parseFloat (split [2 ]. trim () ).orElse (1.0f ) : 1.0f ;
35+ return new ActionSound (sound . toLowerCase () , volume , pitch );
3636 }
3737 }
3838 return null ;
You can’t perform that action at this time.
0 commit comments