mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-02-11 03:29:53 +00:00
Fixed bug when trying to use '/pp remove fishing'
This commit is contained in:
parent
426313ca7e
commit
2521f01d9a
1 changed files with 12 additions and 5 deletions
|
@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue