/pp add | /pp help finished and working

This commit is contained in:
Esophose 2018-10-05 21:01:28 -06:00
parent 4532455ccc
commit 15a1d9c74e
19 changed files with 210 additions and 79 deletions

View file

@ -1,14 +1,18 @@
package com.esophose.playerparticles.command;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import com.esophose.playerparticles.manager.DataManager;
import com.esophose.playerparticles.manager.LangManager;
import com.esophose.playerparticles.manager.LangManager.Lang;
import com.esophose.playerparticles.manager.ParticleManager;
import com.esophose.playerparticles.manager.PermissionManager;
import com.esophose.playerparticles.manager.LangManager.Lang;
import com.esophose.playerparticles.particles.PPlayer;
import com.esophose.playerparticles.particles.ParticleEffect;
import com.esophose.playerparticles.particles.ParticleEffect.NoteColor;
@ -116,15 +120,59 @@ public class AddCommandModule implements CommandModule {
}
}
}
ParticleGroup group = pplayer.getActiveParticleGroup();
group.getParticles().add(new ParticlePair(pplayer.getUniqueId(), pplayer.getNextActiveParticleId(), effect, style, blockData, blockData, colorData, noteColorData));
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
}
ParticleGroup group = pplayer.getActiveParticleGroup();
ParticlePair newParticle = new ParticlePair(pplayer.getUniqueId(), pplayer.getNextActiveParticleId(), effect, style, blockData, blockData, colorData, noteColorData);
group.getParticles().add(newParticle);
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
LangManager.sendMessage(pplayer, Lang.COMMAND_ADD_PARTICLE_APPLIED, newParticle.getEffect().getName(), newParticle.getStyle().getName(), newParticle.getDataString());
}
public List<String> onTabComplete(PPlayer pplayer, String[] args) {
return null;
Player p = pplayer.getPlayer();
List<String> matches = new ArrayList<String>();
System.out.println("Args in AddCommandModule: " + Arrays.toString(args) + " " + args.length);
if (args.length <= 1) { // Effect name
if (args.length == 0) matches = PermissionManager.getEffectsUserHasPermissionFor(p);
else StringUtil.copyPartialMatches(args[0], PermissionManager.getEffectsUserHasPermissionFor(p), matches);
} else if (args.length == 2) { // Style name
StringUtil.copyPartialMatches(args[1], PermissionManager.getStylesUserHasPermissionFor(p), matches);
} else if (args.length >= 3) { // Data
ParticleEffect effect = ParticleEffect.fromName(args[0]);
if (effect != null) {
if (effect.hasProperty(ParticleProperty.COLORABLE)) {
List<String> possibleValues = new ArrayList<String>();
if (effect == ParticleEffect.NOTE) { // Note data
if (args.length == 3) {
possibleValues.add("<0-23>");
possibleValues.add("rainbow");
}
} else { // Color data
if (args.length <= 5 && !args[2].equalsIgnoreCase("rainbow")) {
possibleValues.add("<0-255>");
}
if (args.length <= 4 && !args[2].equalsIgnoreCase("rainbow")) {
possibleValues.add("<0-255> <0-255>");
}
if (args.length <= 3) {
possibleValues.add("<0-255> <0-255> <0-255>");
possibleValues.add("rainbow");
}
}
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
} else if (args.length == 3 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) { // Block material
matches = StringUtil.copyPartialMatches(args[2], ParticleUtils.getAllBlockMaterials(), matches);
} else if (effect == ParticleEffect.ITEM) { // Item material
matches = StringUtil.copyPartialMatches(args[2], ParticleUtils.getAllItemMaterials(), matches);
}
}
}
}
return matches;
}
public String getName() {

View file

@ -1,11 +1,14 @@
package com.esophose.playerparticles.command;
import java.text.MessageFormat;
import java.util.List;
import com.esophose.playerparticles.manager.LangManager;
import com.esophose.playerparticles.manager.LangManager.Lang;
import com.esophose.playerparticles.particles.PPlayer;
import net.md_5.bungee.api.ChatColor;
public interface CommandModule {
/**
@ -59,7 +62,24 @@ public interface CommandModule {
* @param command The command to display usage for
*/
public static void printUsage(PPlayer pplayer, CommandModule command) {
LangManager.sendCustomMessage(pplayer, String.format("/{0} {1}", command.getName(), command.getArguments()));
Object[] args = new Object[] { command.getName(), command.getArguments() };
LangManager.sendCustomMessage(pplayer, new MessageFormat(ChatColor.YELLOW + "/pp {0} {1}").format(args));
}
/**
* Displays a command's usage (with its description) to the player
*
* @param pplayer The PPlayer to display the command usage to
* @param command The command to display usage for
*/
public static void printUsageWithDescription(PPlayer pplayer, CommandModule command) {
if (command.getArguments().length() == 0) {
Object[] args = new Object[] { command.getName(), LangManager.getText(command.getDescription()) };
LangManager.sendCustomMessage(pplayer, new MessageFormat(ChatColor.YELLOW + "/pp {0} - {1}").format(args));
} else {
Object[] args = new Object[] { command.getName(), command.getArguments(), LangManager.getText(command.getDescription()) };
LangManager.sendCustomMessage(pplayer, new MessageFormat(ChatColor.YELLOW + "/pp {0} {1} - {2}").format(args));
}
}
/**
@ -71,7 +91,8 @@ public interface CommandModule {
* @param subCommandArgs The sub-command's arguments
*/
public static void printSubcommandUsage(PPlayer pplayer, CommandModule command, String subCommandName, String subCommandArgs) {
LangManager.sendCustomMessage(pplayer, String.format("/{0} {1} {2}", command.getName(), subCommandName, subCommandArgs));
Object[] args = new Object[] { command.getName(), subCommandName, subCommandArgs };
LangManager.sendCustomMessage(pplayer, new MessageFormat(ChatColor.YELLOW + "/pp {0} {1} {2}").format(args));
}
}

View file

@ -1,7 +1,10 @@
package com.esophose.playerparticles.command;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.util.StringUtil;
import com.esophose.playerparticles.manager.LangManager.Lang;
import com.esophose.playerparticles.particles.PPlayer;
@ -13,7 +16,14 @@ public class DefaultCommandModule implements CommandModule {
}
public List<String> onTabComplete(PPlayer pplayer, String[] args) {
return null;
List<String> matches = new ArrayList<String>();
List<String> commandNames = ParticleCommandHandler.getCommandNames();
if (args.length == 0) return commandNames;
StringUtil.copyPartialMatches(args[0], commandNames, matches);
return matches;
}
public String getName() {

View file

@ -8,7 +8,10 @@ import com.esophose.playerparticles.particles.PPlayer;
public class HelpCommandModule implements CommandModule {
public void onCommandExecute(PPlayer pplayer, String[] args) {
// TODO: Rewrite to be dynamically generated from the ParticleCommandHandler's registered CommandModules
List<CommandModule> cmds = ParticleCommandHandler.getCommands();
for (CommandModule cmd : cmds) {
CommandModule.printUsageWithDescription(pplayer, cmd);
}
}
public List<String> onTabComplete(PPlayer pplayer, String[] args) {

View file

@ -57,6 +57,27 @@ public class ParticleCommandHandler implements CommandExecutor, TabCompleter {
return commandModule;
return null;
}
/**
* Get a list of all available commands
*
* @return A List of all CommandModules registered
*/
public static List<CommandModule> getCommands() {
return commands;
}
/**
* Get all available command names
*
* @return All available command names
*/
public static List<String> getCommandNames() {
List<String> commandNames = new ArrayList<String>();
for (CommandModule cmd : commands)
commandNames.add(cmd.getName());
return commandNames;
}
/**
* Called when a player executes a /pp command
@ -110,10 +131,14 @@ public class ParticleCommandHandler implements CommandExecutor, TabCompleter {
if (!(sender instanceof Player)) return new ArrayList<String>();
if (cmd.getName().equalsIgnoreCase("pp")) {
if (args.length > 1) {
System.out.println("Args in onTabComplete: " + Arrays.toString(args) + " " + args.length);
if (args.length <= 1) {
CommandModule commandModule = findMatchingCommand(""); // Get the default command module
return commandModule.onTabComplete(DataManager.getPPlayer(((Player) sender).getUniqueId()), args);
} else if (args.length >= 2) {
CommandModule commandModule = findMatchingCommand(args[0]);
String[] cmdArgs = Arrays.copyOfRange(args, 1, args.length);
if (commandModule != null) {
String[] cmdArgs = Arrays.copyOfRange(args, 1, args.length);
return commandModule.onTabComplete(DataManager.getPPlayer(((Player) sender).getUniqueId()), cmdArgs);
}

View file

@ -250,7 +250,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
particles.clear();
particles.add(particle);
ParticleGroup group = new ParticleGroup(null, particles);
ParticleGroup group = new ParticleGroup(ParticleGroup.DEFAULT_NAME, particles);
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
}
@ -264,7 +264,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
particles.clear();
particles.add(particle);
ParticleGroup group = new ParticleGroup(null, particles);
ParticleGroup group = new ParticleGroup(ParticleGroup.DEFAULT_NAME, particles);
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
}
@ -278,7 +278,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
particles.clear();
particles.add(particle);
ParticleGroup group = new ParticleGroup(null, particles);
ParticleGroup group = new ParticleGroup(ParticleGroup.DEFAULT_NAME, particles);
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
}
@ -292,7 +292,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
particles.clear();
particles.add(particle);
ParticleGroup group = new ParticleGroup(null, particles);
ParticleGroup group = new ParticleGroup(ParticleGroup.DEFAULT_NAME, particles);
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
}
@ -306,7 +306,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
particles.clear();
particles.add(particle);
ParticleGroup group = new ParticleGroup(null, particles);
ParticleGroup group = new ParticleGroup(ParticleGroup.DEFAULT_NAME, particles);
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
}
@ -320,7 +320,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
particles.clear();
particles.add(particle);
ParticleGroup group = new ParticleGroup(null, particles);
ParticleGroup group = new ParticleGroup(ParticleGroup.DEFAULT_NAME, particles);
DataManager.saveParticleGroup(pplayer.getUniqueId(), group);
}

View file

@ -88,9 +88,10 @@ public class DataManager {
"WHERE g.owner_uuid = ?"; // @formatter:on
try (PreparedStatement statement = connection.prepareStatement(groupQuery)) {
statement.setString(1, playerUUID.toString());
System.out.println("Executing particle query");
ResultSet result = statement.executeQuery();
while (result.next()) {
System.out.println("Particle result found");
// Group properties
String groupName = result.getString("name");
@ -103,6 +104,15 @@ public class DataManager {
NoteColor noteColor = new NoteColor(result.getInt("note"));
OrdinaryColor color = new OrdinaryColor(result.getInt("r"), result.getInt("g"), result.getInt("b"));
ParticlePair particle = new ParticlePair(playerUUID, id, effect, style, itemMaterial, blockMaterial, color, noteColor);
System.out.println("==============================");
System.out.println(result.getInt("id"));
System.out.println(result.getString("effect"));
System.out.println(result.getString("style"));
System.out.println(result.getString("item_material"));
System.out.println(result.getString("block_material"));
System.out.println(result.getInt("note"));
System.out.println(result.getInt("r") + " " + result.getInt("g") + " " + result.getInt("b"));
// Try to add particle to an existing group
boolean groupAlreadyExists = false;
@ -155,7 +165,7 @@ public class DataManager {
}
if (groups.size() == 0) { // If there aren't any groups then this is a brand new PPlayer and we need to save a new active group for them
ParticleGroup activeGroup = new ParticleGroup(null, new ArrayList<ParticlePair>());
ParticleGroup activeGroup = new ParticleGroup(ParticleGroup.DEFAULT_NAME, new ArrayList<ParticlePair>());
saveParticleGroup(playerUUID, activeGroup);
groups.add(activeGroup);
}
@ -222,15 +232,15 @@ public class DataManager {
particlesStatement.setInt(11, particle.getColor().getBlue());
particlesStatement.addBatch();
}
particlesStatement.executeBatch();
}
});
});
getPPlayer(playerUUID, (pplayer) -> {
String groupName = group.getName() == null ? "" : group.getName();
for (ParticleGroup existing : pplayer.getParticles()) {
String existingName = existing.getName() == null ? "" : existing.getName();
if (groupName.equalsIgnoreCase(existingName)) {
if (group.getName().equalsIgnoreCase(existing.getName())) {
pplayer.getParticles().remove(existing);
break;
}
@ -298,7 +308,7 @@ public class DataManager {
try (PreparedStatement statement = connection.prepareStatement(particleQuery)) {
ParticlePair particle = fixedEffect.getParticlePair();
statement.setString(1, particleUUID);
statement.setString(2, null);
statement.setNull(2, java.sql.Types.VARCHAR);
statement.setInt(3, fixedEffect.getId());
statement.setString(4, particle.getEffect().getName());
statement.setString(5, particle.getStyle().getName());

View file

@ -5,6 +5,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.MessageFormat;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
@ -55,6 +56,9 @@ public class LangManager {
COMMAND_DESCRIPTION_GROUP_LOAD,
COMMAND_DESCRIPTION_GROUP_REMOVE,
// Add Command
COMMAND_ADD_PARTICLE_APPLIED,
// Effects
EFFECT_NO_PERMISSION,
EFFECT_INVALID,
@ -158,8 +162,8 @@ public class LangManager {
*
* @return The message
*/
private String get(String... replacements) {
return String.format(this.message, (Object[]) replacements);
private String get(Object... replacements) {
return new MessageFormat(this.message).format(replacements);
}
}
@ -198,8 +202,8 @@ public class LangManager {
/**
* Loads the target .lang file as defined in the config and grabs its YamlConfiguration
* If it doesn't exist, default to en_US.lang
* If en_US.lang doesn't exist, copy the file from this .jar to the target directory
* If it doesn't exist, default to default.lang
* If default.lang doesn't exist, copy the file from this .jar to the target directory
*
* @param config The plugin's configuration file
* @return The YamlConfiguration of the target .lang file
@ -209,21 +213,21 @@ public class LangManager {
langFileName = config.getString("lang-file");
File targetLangFile = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + langFileName);
if (!targetLangFile.exists()) { // Target .lang file didn't exist, default to en_US.lang
if (!langFileName.equals("en_US.lang")) {
PlayerParticles.getPlugin().getLogger().warning("Couldn't find lang file '" + langFileName + "', defaulting to en_US.lang");
if (!targetLangFile.exists()) { // Target .lang file didn't exist, default to default.lang
if (!langFileName.equals("default.lang")) {
PlayerParticles.getPlugin().getLogger().warning("Couldn't find lang file '" + langFileName + "', defaulting to default.lang");
}
langFileName = "en_US.lang";
langFileName = "default.lang";
targetLangFile = new File(pluginDataFolder.getAbsolutePath() + "/lang/" + langFileName);
if (!targetLangFile.exists()) { // en_US.lang didn't exist, create it
try (InputStream stream = PlayerParticles.getPlugin().getResource("lang/en_US.lang")) {
if (!targetLangFile.exists()) { // default.lang didn't exist, create it
try (InputStream stream = PlayerParticles.getPlugin().getResource("lang/default.lang")) {
targetLangFile.getParentFile().mkdir(); // Make sure the directory always exists
Files.copy(stream, Paths.get(targetLangFile.getAbsolutePath()));
return YamlConfiguration.loadConfiguration(targetLangFile);
} catch (IOException ex) {
ex.printStackTrace();
PlayerParticles.getPlugin().getLogger().severe("Unable to write en_US.lang to disk! All messages for the plugin have been disabled until this is fixed!");
PlayerParticles.getPlugin().getLogger().severe("Unable to write default.lang to disk! All messages for the plugin have been disabled until this is fixed!");
return null;
}
}
@ -238,7 +242,7 @@ public class LangManager {
* @param messageType The message type to get
* @param replacements The replacements fot the message
*/
public static String getText(Lang messageType, String... replacements) {
public static String getText(Lang messageType, Object... replacements) {
return messageType.get(replacements);
}
@ -248,7 +252,7 @@ public class LangManager {
* @param player The player to send the message to
* @param messageType The message to send to the player
*/
public static void sendMessage(Player player, Lang messageType, String... replacements) {
public static void sendMessage(Player player, Lang messageType, Object... replacements) {
if (!messagesEnabled) return;
String message = messageType.get(replacements);
@ -270,8 +274,8 @@ public class LangManager {
* @param pplayer The player to send the message to
* @param messageType The message to send to the player
*/
public static void sendMessage(PPlayer pplayer, Lang messageType, String... replacements) {
sendMessage(pplayer, messageType, replacements);
public static void sendMessage(PPlayer pplayer, Lang messageType, Object... replacements) {
sendMessage(pplayer.getPlayer(), messageType, replacements);
}
/**

View file

@ -131,13 +131,11 @@ public class ParticleManager extends BukkitRunnable implements Listener {
// Don't show their particles if they are in spectator mode
// Don't spawn particles if the world doesn't allow it
if (player != null && player.getGameMode() != GameMode.SPECTATOR && !DataManager.isWorldDisabled(player.getWorld().getName())) {
Location loc = player.getLocation();
loc.setY(loc.getY() + 1);
for (ParticlePair particles : pplayer.getActiveParticles())
displayParticles(particles, loc);
for (ParticlePair particles : pplayer.getActiveParticles()) {
displayParticles(particles, player.getLocation().clone().add(0, 1, 0));
}
}
// Loop for FixedParticleEffects
// Don't spawn particles if the world doesn't allow it
for (FixedParticleEffect effect : pplayer.getFixedParticles())

View file

@ -96,7 +96,7 @@ public class PPlayer {
*/
public ParticleGroup getActiveParticleGroup() {
for (ParticleGroup group : this.particleGroups)
if (group.getName() == null)
if (group.getName().equals(ParticleGroup.DEFAULT_NAME))
return group;
return null; // This should never return null, there will always be at least one ParticleGroup
}

View file

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List;
public class ParticleGroup {
public static final String DEFAULT_NAME = "active";
private String name;
private List<ParticlePair> particles;
@ -38,7 +40,7 @@ public class ParticleGroup {
* @return The default empty active ParticleGroup
*/
public static ParticleGroup getDefaultGroup() {
return new ParticleGroup(null, new ArrayList<ParticlePair>());
return new ParticleGroup(DEFAULT_NAME, new ArrayList<ParticlePair>());
}
}

View file

@ -23,7 +23,7 @@ public class ParticleStyleBlockBreak implements ParticleStyle, Listener {
List<PParticle> particles = new ArrayList<PParticle>();
for (int i = 0; i < 15; i++)
particles.add(new PParticle(location.clone().add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.05F));
particles.add(new PParticle(location.add(0.5, 0.5, 0.5), 0.5F, 0.5F, 0.5F, 0.05F));
return particles;
}
@ -46,7 +46,7 @@ public class ParticleStyleBlockBreak implements ParticleStyle, Listener {
PPlayer pplayer = DataManager.getPPlayer(player.getUniqueId());
if (pplayer != null) {
for (ParticlePair particle : pplayer.getActiveParticlesForStyle(DefaultStyles.BLOCKBREAK)) {
Location loc = event.getBlock().getLocation();
Location loc = event.getBlock().getLocation().clone();
ParticleManager.displayParticles(particle, DefaultStyles.BLOCKBREAK.getParticles(particle, loc));
}
}

View file

@ -54,7 +54,7 @@ public class ParticleStyleBlockEdit implements ParticleStyle, Listener {
PPlayer pplayer = DataManager.getPPlayer(player.getUniqueId());
if (pplayer != null) {
for (ParticlePair particle : pplayer.getActiveParticlesForStyle(DefaultStyles.BLOCKEDIT)) {
Location loc = event.getBlock().getLocation();
Location loc = event.getBlock().getLocation().clone();
ParticleManager.displayParticles(particle, DefaultStyles.BLOCKPLACE.getParticles(particle, loc));
}
}

View file

@ -23,7 +23,7 @@ public class ParticleStyleBlockPlace implements ParticleStyle, Listener {
List<PParticle> particles = new ArrayList<PParticle>();
for (int i = 0; i < 15; i++)
particles.add(new PParticle(location.clone().add(0.5, 0.5, 0.5), 0.75F, 0.75F, 0.75F, 0.05F));
particles.add(new PParticle(location.add(0.5, 0.5, 0.5), 0.75F, 0.75F, 0.75F, 0.05F));
return particles;
}
@ -46,7 +46,7 @@ public class ParticleStyleBlockPlace implements ParticleStyle, Listener {
PPlayer pplayer = DataManager.getPPlayer(player.getUniqueId());
if (pplayer != null) {
for (ParticlePair particle : pplayer.getActiveParticlesForStyle(DefaultStyles.BLOCKPLACE)) {
Location loc = event.getBlock().getLocation();
Location loc = event.getBlock().getLocation().clone();
ParticleManager.displayParticles(particle, DefaultStyles.BLOCKPLACE.getParticles(particle, loc));
}
}

View file

@ -70,7 +70,7 @@ public class ParticleStyleCube implements ParticleStyle {
VectorUtils.rotateAroundAxisX(v, angleX);
VectorUtils.rotateAroundAxisY(v, angleY);
VectorUtils.rotateVector(v, xRotation, yRotation, zRotation);
pparticles.add(new PParticle(location.clone().add(v)));
pparticles.add(new PParticle(location.add(v)));
}
}
for (int p = 0; p <= particles; p++) {
@ -78,7 +78,7 @@ public class ParticleStyleCube implements ParticleStyle {
v.setY(edgeLength * p / particles - a);
VectorUtils.rotateAroundAxisY(v, angleY);
VectorUtils.rotateVector(v, xRotation, yRotation, zRotation);
pparticles.add(new PParticle(location.clone().add(v)));
pparticles.add(new PParticle(location.add(v)));
}
}
}

View file

@ -38,7 +38,7 @@ public class ParticleStyleMove implements ParticleStyle, Listener {
PPlayer pplayer = DataManager.getPPlayer(e.getPlayer().getUniqueId());
if (pplayer != null) {
for (ParticlePair particle : pplayer.getActiveParticlesForStyle(DefaultStyles.MOVE)) {
Location loc = e.getPlayer().getLocation();
Location loc = e.getPlayer().getLocation().clone();
loc.setY(loc.getY() + 0.05);
ParticleManager.displayParticles(particle, DefaultStyles.MOVE.getParticles(particle, loc));
}

View file

@ -6,6 +6,21 @@ import java.util.List;
import org.bukkit.Material;
public class ParticleUtils {
private static List<String> blockMaterials, itemMaterials;
static {
blockMaterials = new ArrayList<String>();
itemMaterials = new ArrayList<String>();
for (Material mat : Material.values()) {
if (mat.isBlock()) {
blockMaterials.add(mat.name().toLowerCase());
} else {
itemMaterials.add(mat.name().toLowerCase());
}
}
}
/**
* Finds a block/item as a material from a string
@ -45,19 +60,11 @@ public class ParticleUtils {
}
public static List<String> getAllBlockMaterials() {
List<String> materials = new ArrayList<String>();
for (Material mat : Material.values())
if (mat.isBlock())
materials.add(mat.name().toLowerCase());
return materials;
return blockMaterials;
}
public static List<String> getAllItemMaterials() {
List<String> materials = new ArrayList<String>();
for (Material mat : Material.values())
if (!mat.isBlock())
materials.add(mat.name().toLowerCase());
return materials;
return itemMaterials;
}
/**

View file

@ -20,8 +20,8 @@ version: 5.3
check-updates: true
# The .lang file to use in the ./lang/ folder
# Default: 'en_US.lang'
lang-file: 'en_US.lang'
# Default: 'default.lang'
lang-file: 'default.lang'
# If you're using other plugins to execute commands you may wish to turn off messages
# Default: true

View file

@ -1,5 +1,5 @@
# ================================================================ #
# en_US.lang MESSAGE CONFIGURATION #
# default.lang (English) MESSAGE CONFIGURATION #
# Important Notes: #
# * You can use the & symbol to color the messages #
# * {#} Will be replaced with whatever that message requires #
@ -17,7 +17,7 @@ command-description-add: 'Add a particle to your active particles'
command-description-data: 'Check what type of data an effect uses'
command-description-default: 'The main command. By default, opens the GUI.'
command-description-edit: 'Edit the effect, style, or data of an active particle'
command-description-effect: 'This command has been removed, use /pp help to find new commands'
command-description-effect: '&cThis command has been removed, use &b/pp help &cto find new commands'
command-description-effects: 'Display a list of effects you can use'
command-description-fixed: 'Create, edit, and remove fixed particle effects'
command-description-group: 'Save, load, and remove your particle groups'
@ -27,20 +27,23 @@ command-description-info: 'Gets the description of one of your active particles'
command-description-list: 'Lists the ids of your active particles'
command-description-remove: 'Removes one of your active particles'
command-description-reset: 'Removes all your active particles'
command-description-style: 'This command has been removed, use /pp help to find new commands'
command-description-style: '&cThis command has been removed, use &b/pp help &cto find new commands'
command-description-styles: 'Display a list of styles you can use'
command-description-version: 'Display the current version of the plugin and the author'
command-description-worlds: 'Find out what worlds PlayerParticles is disabled in'
command-description-worlds: 'Find out what worlds particles is disabled in'
# Sub-Command Usage
command-description-fixed-create: '/pp fixed create <x> <y> <z> <effect> <style> [data] - Creates a new fixed effect'
command-description-fixed-remove: '/pp fixed remove <id> - Removes a fixed effect by its id'
command-description-fixed-list: '/pp fixed list - Lists all ids of your fixed effects'
command-description-fixed-info: '/pp fixed info <id> - Gets info on one of your fixed effects'
command-description-fixed-clear: '/pp fixed clear <radius> - Clears all fixed effects of all players within the given radius'
command-description-group-save: '/pp group save <name> - Saves all currently applied particles under a given name'
command-description-group-load: '/pp group load <name> - Loads all particles saved under a given name'
command-description-group-remove: '/pp group remove <name> - Removes all particles saved under a given name'
command-description-fixed-create: '&e/pp fixed create <x> <y> <z> <effect> <style> [data] - Creates a new fixed effect'
command-description-fixed-remove: '&e/pp fixed remove <id> - Removes a fixed effect by its id'
command-description-fixed-list: '&e/pp fixed list - Lists all ids of your fixed effects'
command-description-fixed-info: '&e/pp fixed info <id> - Gets info on one of your fixed effects'
command-description-fixed-clear: '&e/pp fixed clear <radius> - Clears all fixed effects of all players within the given radius'
command-description-group-save: '&e/pp group save <name> - Saves all currently applied particles under a given name'
command-description-group-load: '&e/pp group load <name> - Loads all particles saved under a given name'
command-description-group-remove: '&e/pp group remove <name> - Removes all particles saved under a given name'
# Add Command
command-add-particle-applied: '&aA new particle has been applied with the effect &b{0}&a, style &b{1}&a, and data &b{2}&a!'
# Effects
effect-no-permission: '&cYou do not have permission to use the effect &b{0} &c!'