Preset groups finished, Rework permissions/settings

This commit is contained in:
Esophose 2018-10-30 03:17:23 -06:00
parent 22c7610259
commit 3077ddaa35
20 changed files with 684 additions and 201 deletions

View file

@ -19,6 +19,7 @@ import com.esophose.playerparticles.particles.ParticleEffect.ParticleProperty;
import com.esophose.playerparticles.particles.ParticleGroup;
import com.esophose.playerparticles.particles.ParticlePair;
import com.esophose.playerparticles.styles.api.ParticleStyle;
import com.esophose.playerparticles.styles.api.ParticleStyleManager;
import com.esophose.playerparticles.util.ParticleUtils;
public class AddCommandModule implements CommandModule {
@ -29,6 +30,12 @@ public class AddCommandModule implements CommandModule {
return;
}
int maxParticlesAllowed = PermissionManager.getMaxParticlesAllowed(pplayer.getPlayer());
if (pplayer.getActiveParticles().size() >= maxParticlesAllowed) {
LangManager.sendMessage(pplayer, Lang.ADD_REACHED_MAX, maxParticlesAllowed);
return;
}
ParticleEffect effect = ParticleEffect.fromName(args[0]);
if (effect == null) {
LangManager.sendMessage(pplayer, Lang.EFFECT_INVALID, args[0]);
@ -125,6 +132,10 @@ public class AddCommandModule implements CommandModule {
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
LangManager.sendMessage(pplayer, Lang.ADD_PARTICLE_APPLIED, newParticle.getEffect().getName(), newParticle.getStyle().getName(), newParticle.getDataString());
if (ParticleStyleManager.isCustomHandled(newParticle.getStyle())) {
LangManager.sendMessage(pplayer, Lang.STYLE_EVENT_SPAWNING_INFO, newParticle.getStyle().getName());
}
}
public List<String> onTabComplete(PPlayer pplayer, String[] args) {