2019-10-17 16:04:43 -06:00
|
|
|
package dev.esophose.playerparticles.command;
|
2018-09-26 02:07:46 -06:00
|
|
|
|
2018-10-07 21:18:19 -06:00
|
|
|
import java.util.ArrayList;
|
2018-09-26 02:07:46 -06:00
|
|
|
import java.util.List;
|
|
|
|
|
2019-12-09 12:04:06 -07:00
|
|
|
import dev.esophose.playerparticles.PlayerParticles;
|
2018-09-26 23:31:00 -06:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2019-10-17 16:04:43 -06:00
|
|
|
import dev.esophose.playerparticles.manager.LangManager;
|
|
|
|
import dev.esophose.playerparticles.manager.LangManager.Lang;
|
|
|
|
import dev.esophose.playerparticles.manager.PermissionManager;
|
|
|
|
import dev.esophose.playerparticles.particles.PPlayer;
|
2018-09-26 02:07:46 -06:00
|
|
|
|
|
|
|
public class StylesCommandModule implements CommandModule {
|
|
|
|
|
2018-09-27 18:16:50 -06:00
|
|
|
public void onCommandExecute(PPlayer pplayer, String[] args) {
|
|
|
|
Player p = pplayer.getPlayer();
|
|
|
|
|
2019-12-09 12:04:06 -07:00
|
|
|
List<String> styleNames = PlayerParticles.getInstance().getManager(PermissionManager.class).getStyleNamesUserHasPermissionFor(p);
|
2019-04-28 00:17:08 -06:00
|
|
|
StringBuilder toSend = new StringBuilder();
|
2018-10-07 16:33:13 -06:00
|
|
|
for (String name : styleNames) {
|
2019-04-28 00:17:08 -06:00
|
|
|
toSend.append(name).append(", ");
|
2018-09-26 23:31:00 -06:00
|
|
|
}
|
2018-10-07 16:33:13 -06:00
|
|
|
|
2019-04-28 00:17:08 -06:00
|
|
|
if (toSend.toString().endsWith(", ")) {
|
|
|
|
toSend = new StringBuilder(toSend.substring(0, toSend.length() - 2));
|
2018-09-26 23:31:00 -06:00
|
|
|
}
|
2018-09-27 18:16:50 -06:00
|
|
|
|
2019-04-28 00:17:08 -06:00
|
|
|
LangManager.sendMessage(pplayer, Lang.STYLE_LIST, toSend.toString());
|
2018-09-27 18:16:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
public List<String> onTabComplete(PPlayer pplayer, String[] args) {
|
2019-04-28 00:17:08 -06:00
|
|
|
return new ArrayList<>();
|
2018-09-27 18:16:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
return "styles";
|
|
|
|
}
|
|
|
|
|
2019-12-09 12:04:06 -07:00
|
|
|
public String getDescriptionKey() {
|
|
|
|
return "command-description-styles";
|
2018-09-27 18:16:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getArguments() {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean requiresEffects() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-16 01:32:45 -06:00
|
|
|
public boolean canConsoleExecute() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-09-26 02:07:46 -06:00
|
|
|
}
|