mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-08-08 05:22:58 +00:00
Fix exception for '/pp fixed looking' with invalid effect/style args
This commit is contained in:
parent
de44a43f6f
commit
108a209193
1 changed files with 10 additions and 0 deletions
|
@ -148,6 +148,16 @@ public class FixedCommandModule implements CommandModule {
|
|||
}
|
||||
}
|
||||
|
||||
// Pad the args with the coordinates so we don't have to adjust all the indices
|
||||
if (args[0].equalsIgnoreCase("looking")) {
|
||||
String[] paddedArgs = new String[args.length + 2];
|
||||
paddedArgs[0] = String.valueOf(location.getX());
|
||||
paddedArgs[1] = String.valueOf(location.getY());
|
||||
paddedArgs[2] = String.valueOf(location.getZ());
|
||||
System.arraycopy(args, 1, paddedArgs, 3, args.length - 1);
|
||||
args = paddedArgs;
|
||||
}
|
||||
|
||||
ParticleEffect effect = inputParser.next(ParticleEffect.class);
|
||||
if (effect == null) {
|
||||
localeManager.sendMessage(pplayer, "fixed-create-effect-invalid", StringPlaceholders.single("effect", args[3]));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue