Fixed bug when trying to use '/pp remove fishing'

This commit is contained in:
Esophose 2020-05-19 17:16:13 -06:00
parent 426313ca7e
commit 2521f01d9a

View file

@ -54,6 +54,8 @@ public class RemoveCommandModule implements CommandModule {
ParticleEffect effect = ParticleEffect.fromName(args[0]);
ParticleStyle style = ParticleStyle.fromName(args[0]);
boolean removed = false;
if (effect != null) {
Set<Integer> toRemove = new HashSet<>();
ParticleGroup activeGroup = pplayer.getActiveParticleGroup();
@ -66,10 +68,13 @@ public class RemoveCommandModule implements CommandModule {
if (toRemove.size() > 0) {
PlayerParticlesAPI.getInstance().savePlayerParticleGroup(pplayer.getPlayer(), activeGroup);
localeManager.sendMessage(pplayer, "remove-effect-success", StringPlaceholders.builder("amount", toRemove.size()).addPlaceholder("effect", effect.getName()).build());
} else {
removed = true;
} else if (style == null) {
localeManager.sendMessage(pplayer, "remove-effect-none", StringPlaceholders.single("effect", effect.getName()));
}
} else if (style != null) {
}
if (style != null) {
Set<Integer> toRemove = new HashSet<>();
ParticleGroup activeGroup = pplayer.getActiveParticleGroup();
for (int id : activeGroup.getParticles().keySet())
@ -81,12 +86,14 @@ public class RemoveCommandModule implements CommandModule {
if (toRemove.size() > 0) {
PlayerParticlesAPI.getInstance().savePlayerParticleGroup(pplayer.getPlayer(), activeGroup);
localeManager.sendMessage(pplayer, "remove-style-success", StringPlaceholders.builder("amount", toRemove.size()).addPlaceholder("style", style.getName()).build());
} else {
removed = true;
} else if (effect == null) {
localeManager.sendMessage(pplayer, "remove-style-none", StringPlaceholders.single("style", style.getName()));
}
} else {
localeManager.sendMessage(pplayer, "remove-unknown", StringPlaceholders.single("name", args[0]));
}
if (!removed)
localeManager.sendMessage(pplayer, "remove-unknown", StringPlaceholders.single("name", args[0]));
}
}