mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-07-14 09:44:22 +00:00
Update to v4.1
Update to v4.1 Added additional documentation
This commit is contained in:
parent
bf485fcfcc
commit
cd76219ac7
20 changed files with 754 additions and 247 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright Esophose 2016
|
||||||
|
* While using any of the code provided by this plugin
|
||||||
|
* you must not claim it as your own. This plugin may
|
||||||
|
* be modified and installed on a server, but may not
|
||||||
|
* be distributed to any person by any means.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.esophose.playerparticles;
|
package com.esophose.playerparticles;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -17,16 +25,36 @@ import com.esophose.playerparticles.styles.api.ParticleStyle;
|
||||||
|
|
||||||
public class PPlayer {
|
public class PPlayer {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The UUID of the player
|
||||||
|
*/
|
||||||
private final UUID playerUUID;
|
private final UUID playerUUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The effect and style the player is using
|
||||||
|
*/
|
||||||
private ParticleEffect particleEffect;
|
private ParticleEffect particleEffect;
|
||||||
private ParticleStyle particleStyle;
|
private ParticleStyle particleStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All data used to display custom particles
|
||||||
|
*/
|
||||||
private ItemData particleItemData;
|
private ItemData particleItemData;
|
||||||
private BlockData particleBlockData;
|
private BlockData particleBlockData;
|
||||||
private OrdinaryColor particleColorData;
|
private OrdinaryColor particleColorData;
|
||||||
private NoteColor particleNoteColorData;
|
private NoteColor particleNoteColorData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new PPlayer
|
||||||
|
*
|
||||||
|
* @param uuid The player UUID
|
||||||
|
* @param effect The player's effect
|
||||||
|
* @param style The player's style
|
||||||
|
* @param itemData The player's item data
|
||||||
|
* @param blockData The player's block data
|
||||||
|
* @param colorData The player's color data
|
||||||
|
* @param noteColorData The player's note color data
|
||||||
|
*/
|
||||||
public PPlayer(UUID uuid, ParticleEffect effect, ParticleStyle style, ItemData itemData, BlockData blockData, OrdinaryColor colorData, NoteColor noteColorData) {
|
public PPlayer(UUID uuid, ParticleEffect effect, ParticleStyle style, ItemData itemData, BlockData blockData, OrdinaryColor colorData, NoteColor noteColorData) {
|
||||||
this.playerUUID = uuid;
|
this.playerUUID = uuid;
|
||||||
this.particleEffect = effect;
|
this.particleEffect = effect;
|
||||||
|
@ -37,58 +65,128 @@ public class PPlayer {
|
||||||
this.particleNoteColorData = noteColorData;
|
this.particleNoteColorData = noteColorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's UUID
|
||||||
|
*
|
||||||
|
* @return The player's UUID
|
||||||
|
*/
|
||||||
public UUID getUniqueId() {
|
public UUID getUniqueId() {
|
||||||
return this.playerUUID;
|
return this.playerUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's particle effect
|
||||||
|
*
|
||||||
|
* @return The player's particle effect
|
||||||
|
*/
|
||||||
public ParticleEffect getParticleEffect() {
|
public ParticleEffect getParticleEffect() {
|
||||||
return this.particleEffect;
|
return this.particleEffect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's particle style
|
||||||
|
*
|
||||||
|
* @return The player's particle style
|
||||||
|
*/
|
||||||
public ParticleStyle getParticleStyle() {
|
public ParticleStyle getParticleStyle() {
|
||||||
return this.particleStyle;
|
return this.particleStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's item data
|
||||||
|
*
|
||||||
|
* @return The player's item data
|
||||||
|
*/
|
||||||
public ItemData getItemData() {
|
public ItemData getItemData() {
|
||||||
return this.particleItemData;
|
return this.particleItemData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's block data
|
||||||
|
*
|
||||||
|
* @return The player's block data
|
||||||
|
*/
|
||||||
public BlockData getBlockData() {
|
public BlockData getBlockData() {
|
||||||
return this.particleBlockData;
|
return this.particleBlockData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's color data
|
||||||
|
*
|
||||||
|
* @return The player's color data
|
||||||
|
*/
|
||||||
public OrdinaryColor getColorData() {
|
public OrdinaryColor getColorData() {
|
||||||
return this.particleColorData;
|
return this.particleColorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's note color data
|
||||||
|
*
|
||||||
|
* @return The player's note color data
|
||||||
|
*/
|
||||||
public NoteColor getNoteColorData() {
|
public NoteColor getNoteColorData() {
|
||||||
return this.particleNoteColorData;
|
return this.particleNoteColorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player's particle effect
|
||||||
|
*
|
||||||
|
* @param effect The player's new particle effect
|
||||||
|
*/
|
||||||
public void setParticleEffect(ParticleEffect effect) {
|
public void setParticleEffect(ParticleEffect effect) {
|
||||||
this.particleEffect = effect;
|
this.particleEffect = effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player's particle style
|
||||||
|
*
|
||||||
|
* @param effect The player's new particle style
|
||||||
|
*/
|
||||||
public void setParticleStyle(ParticleStyle style) {
|
public void setParticleStyle(ParticleStyle style) {
|
||||||
this.particleStyle = style;
|
this.particleStyle = style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player's item data
|
||||||
|
*
|
||||||
|
* @param effect The player's new item data
|
||||||
|
*/
|
||||||
public void setItemData(ItemData itemData) {
|
public void setItemData(ItemData itemData) {
|
||||||
this.particleItemData = itemData;
|
this.particleItemData = itemData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player's block data
|
||||||
|
*
|
||||||
|
* @param effect The player's new block data
|
||||||
|
*/
|
||||||
public void setBlockData(BlockData blockData) {
|
public void setBlockData(BlockData blockData) {
|
||||||
this.particleBlockData = blockData;
|
this.particleBlockData = blockData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player's color data
|
||||||
|
*
|
||||||
|
* @param effect The player's new color data
|
||||||
|
*/
|
||||||
public void setColorData(OrdinaryColor colorData) {
|
public void setColorData(OrdinaryColor colorData) {
|
||||||
this.particleColorData = colorData;
|
this.particleColorData = colorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player's note color data
|
||||||
|
*
|
||||||
|
* @param effect The player's new note color data
|
||||||
|
*/
|
||||||
public void setNoteColorData(NoteColor noteColorData) {
|
public void setNoteColorData(NoteColor noteColorData) {
|
||||||
this.particleNoteColorData = noteColorData;
|
this.particleNoteColorData = noteColorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the data the current particle effect will spawn with
|
||||||
|
*
|
||||||
|
* @return The ParticleData the current particle effect requires
|
||||||
|
*/
|
||||||
public ParticleData getParticleSpawnData() {
|
public ParticleData getParticleSpawnData() {
|
||||||
if (particleEffect.hasProperty(ParticleProperty.REQUIRES_DATA)) {
|
if (particleEffect.hasProperty(ParticleProperty.REQUIRES_DATA)) {
|
||||||
if (particleEffect == ParticleEffect.BLOCK_CRACK || particleEffect == ParticleEffect.BLOCK_DUST || particleEffect == ParticleEffect.FALLING_DUST) {
|
if (particleEffect == ParticleEffect.BLOCK_CRACK || particleEffect == ParticleEffect.BLOCK_DUST || particleEffect == ParticleEffect.FALLING_DUST) {
|
||||||
|
@ -100,6 +198,11 @@ public class PPlayer {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the color the current particle effect will spawn with
|
||||||
|
*
|
||||||
|
* @return Gets the ParticleColor the current particle effect will spawn with
|
||||||
|
*/
|
||||||
public ParticleColor getParticleSpawnColor() {
|
public ParticleColor getParticleSpawnColor() {
|
||||||
if (particleEffect.hasProperty(ParticleProperty.COLORABLE)) {
|
if (particleEffect.hasProperty(ParticleProperty.COLORABLE)) {
|
||||||
if (particleEffect == ParticleEffect.NOTE) {
|
if (particleEffect == ParticleEffect.NOTE) {
|
||||||
|
@ -109,6 +212,13 @@ public class PPlayer {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a default PPlayer
|
||||||
|
* Used for when a new PPlayer is being created
|
||||||
|
*
|
||||||
|
* @param playerUUID The player's UUID
|
||||||
|
* @return A default PPlayer
|
||||||
|
*/
|
||||||
public static PPlayer getNewPPlayer(UUID playerUUID) {
|
public static PPlayer getNewPPlayer(UUID playerUUID) {
|
||||||
ParticleEffect particleEffect = ParticleEffect.NONE;
|
ParticleEffect particleEffect = ParticleEffect.NONE;
|
||||||
ParticleStyle particleStyle = DefaultStyles.NONE;
|
ParticleStyle particleStyle = DefaultStyles.NONE;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright Esophose 2016
|
||||||
|
* While using any of the code provided by this plugin
|
||||||
|
* you must not claim it as your own. This plugin may
|
||||||
|
* be modified and installed on a server, but may not
|
||||||
|
* be distributed to any person by any means.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.esophose.playerparticles;
|
package com.esophose.playerparticles;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
@ -15,6 +23,7 @@ import com.esophose.playerparticles.library.ParticleEffect.OrdinaryColor;
|
||||||
import com.esophose.playerparticles.library.ParticleEffect.ParticleProperty;
|
import com.esophose.playerparticles.library.ParticleEffect.ParticleProperty;
|
||||||
import com.esophose.playerparticles.manager.ConfigManager;
|
import com.esophose.playerparticles.manager.ConfigManager;
|
||||||
import com.esophose.playerparticles.manager.MessageManager;
|
import com.esophose.playerparticles.manager.MessageManager;
|
||||||
|
import com.esophose.playerparticles.manager.MessageManager.MessageType;
|
||||||
import com.esophose.playerparticles.manager.PermissionManager;
|
import com.esophose.playerparticles.manager.PermissionManager;
|
||||||
import com.esophose.playerparticles.styles.DefaultStyles;
|
import com.esophose.playerparticles.styles.DefaultStyles;
|
||||||
import com.esophose.playerparticles.styles.api.ParticleStyle;
|
import com.esophose.playerparticles.styles.api.ParticleStyle;
|
||||||
|
@ -37,7 +46,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
|
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-invalid-arguments", null) + ChatColor.GREEN + " /pp help", ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.INVALID_ARGUMENTS);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
switch (args[0].toLowerCase()) {
|
switch (args[0].toLowerCase()) {
|
||||||
|
@ -69,7 +78,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
onReset(p, args);
|
onReset(p, args);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-invalid-arguments", null) + ChatColor.GREEN + " /pp help", ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.INVALID_ARGUMENTS);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -82,9 +91,8 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
* @param args The arguments for the command
|
* @param args The arguments for the command
|
||||||
*/
|
*/
|
||||||
private void onHelp(Player p, String[] args) {
|
private void onHelp(Player p, String[] args) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-available-commands", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.AVAILABLE_COMMANDS);
|
||||||
MessageManager.getInstance().sendMessage(p, "effect, effects, style, styles, data, reset, worlds, version, help", ChatColor.AQUA);
|
MessageManager.sendMessage(p, MessageType.COMMAND_USAGE);
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp <command>", ChatColor.YELLOW);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,20 +102,18 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
* @param args The arguments for the command
|
* @param args The arguments for the command
|
||||||
*/
|
*/
|
||||||
private void onWorlds(Player p, String[] args) {
|
private void onWorlds(Player p, String[] args) {
|
||||||
String worlds = "";
|
if (ConfigManager.getInstance().getDisabledWorlds() == null || ConfigManager.getInstance().getDisabledWorlds().isEmpty()) {
|
||||||
if (ConfigManager.getInstance().getDisabledWorlds() == null) {
|
MessageManager.sendMessage(p, MessageType.DISABLED_WORLDS_NONE);
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-disabled-worlds-none", null), ChatColor.GREEN);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String worlds = "";
|
||||||
for (String s : ConfigManager.getInstance().getDisabledWorlds()) {
|
for (String s : ConfigManager.getInstance().getDisabledWorlds()) {
|
||||||
worlds += s + ", ";
|
worlds += s + ", ";
|
||||||
}
|
}
|
||||||
if (worlds.length() > 2) worlds = worlds.substring(0, worlds.length() - 2);
|
if (worlds.length() > 2) worlds = worlds.substring(0, worlds.length() - 2);
|
||||||
if (worlds.equals("")) {
|
|
||||||
worlds = MessageManager.getMessageFromConfig("message-disabled-worlds-none", null);
|
MessageManager.sendCustomMessage(p, MessageType.DISABLED_WORLDS.getMessage() + " " + worlds);
|
||||||
} else {
|
|
||||||
worlds = MessageManager.getMessageFromConfig("message-disabled-worlds", null) + " " + ChatColor.AQUA + worlds;
|
|
||||||
}
|
|
||||||
MessageManager.getInstance().sendMessage(p, worlds, ChatColor.GREEN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,8 +123,8 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
* @param args The arguments for the command
|
* @param args The arguments for the command
|
||||||
*/
|
*/
|
||||||
private void onVersion(Player p, String[] args) {
|
private void onVersion(Player p, String[] args) {
|
||||||
MessageManager.getInstance().sendMessage(p, "Running PlayerParticles v" + PlayerParticles.getPlugin().getDescription().getVersion(), ChatColor.GOLD);
|
MessageManager.sendCustomMessage(p, ChatColor.GOLD + "Running PlayerParticles v" + PlayerParticles.getPlugin().getDescription().getVersion());
|
||||||
MessageManager.getInstance().sendMessage(p, "Plugin created by: Esophose", ChatColor.GOLD);
|
MessageManager.sendCustomMessage(p, ChatColor.GOLD + "Plugin created by: Esophose");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,22 +138,22 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
if ((!effect.hasProperty(ParticleProperty.REQUIRES_DATA) && !effect.hasProperty(ParticleProperty.COLORABLE)) || args.length == 1) {
|
if ((!effect.hasProperty(ParticleProperty.REQUIRES_DATA) && !effect.hasProperty(ParticleProperty.COLORABLE)) || args.length == 1) {
|
||||||
if (effect.hasProperty(ParticleProperty.COLORABLE)) {
|
if (effect.hasProperty(ParticleProperty.COLORABLE)) {
|
||||||
if (effect == ParticleEffect.NOTE) {
|
if (effect == ParticleEffect.NOTE) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-note-data-usage", null), ChatColor.YELLOW);
|
MessageManager.sendMessage(p, MessageType.DATA_USAGE, "note");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-23>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.NOTE_DATA_USAGE.getMessage());
|
||||||
} else {
|
} else {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-color-data-usage", null), ChatColor.YELLOW);
|
MessageManager.sendMessage(p, MessageType.DATA_USAGE, "color");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-255> <0-255> <0-255>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.COLOR_DATA_USAGE.getMessage());
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_DATA)) {
|
||||||
if (effect == ParticleEffect.ITEM_CRACK) {
|
if (effect == ParticleEffect.ITEM_CRACK) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-item-data-usage", null), ChatColor.YELLOW);
|
MessageManager.sendMessage(p, MessageType.DATA_USAGE, "item");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <itemName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.ITEM_DATA_USAGE.getMessage());
|
||||||
} else {
|
} else {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-block-data-usage", null), ChatColor.YELLOW);
|
MessageManager.sendMessage(p, MessageType.DATA_USAGE, "block");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <blockName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.BLOCK_DATA_USAGE.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-no-data-usage", null), ChatColor.YELLOW);
|
MessageManager.sendMessage(p, MessageType.NO_DATA_USAGE);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -158,22 +164,22 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
try {
|
try {
|
||||||
note = Integer.parseInt(args[1]);
|
note = Integer.parseInt(args[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-note-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "note");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-23>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.NOTE_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note < 0 || note > 23) {
|
if (note < 0 || note > 23) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-note-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "note");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-23>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.NOTE_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new NoteColor(note));
|
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new NoteColor(note));
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-note-data-applied", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.DATA_APPLIED, "note");
|
||||||
} else {
|
} else {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-note-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "note");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-23>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.NOTE_DATA_USAGE.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (args.length >= 4) {
|
if (args.length >= 4) {
|
||||||
|
@ -186,22 +192,22 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
g = Integer.parseInt(args[2]);
|
g = Integer.parseInt(args[2]);
|
||||||
b = Integer.parseInt(args[3]);
|
b = Integer.parseInt(args[3]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-color-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "color");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-255> <0-255> <0-255>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.COLOR_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) {
|
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-color-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "color");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-255> <0-255> <0-255>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.COLOR_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new OrdinaryColor(r, g, b));
|
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new OrdinaryColor(r, g, b));
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-color-data-applied", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.DATA_APPLIED, "color");
|
||||||
} else {
|
} else {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-color-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "color");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <0-255> <0-255> <0-255>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.COLOR_DATA_USAGE.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_DATA)) {
|
||||||
|
@ -214,33 +220,33 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
if (material == null) material = Material.matchMaterial(args[1]);
|
if (material == null) material = Material.matchMaterial(args[1]);
|
||||||
if (material == null) throw new Exception();
|
if (material == null) throw new Exception();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-item-data-unknown", args[1]), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_MATERIAL_UNKNOWN, "item");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <itemName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.ITEM_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data = Integer.parseInt(args[2]);
|
data = Integer.parseInt(args[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-item-data-usage", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "item");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <itemName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.ITEM_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (material.isBlock()) {
|
if (material.isBlock()) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-item-data-mismatch", material.name()), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_MATERIAL_MISMATCH, "item");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <itemName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.ITEM_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data < 0 || data > 15) {
|
if (data < 0 || data > 15) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-item-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "item");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <itemName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.ITEM_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new ItemData(material, (byte) data));
|
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new ItemData(material, (byte) data));
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-item-data-applied", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.DATA_APPLIED, "item");
|
||||||
} else {
|
} else {
|
||||||
Material material = null;
|
Material material = null;
|
||||||
int data = -1;
|
int data = -1;
|
||||||
|
@ -250,33 +256,33 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
if (material == null) material = Material.matchMaterial(args[1]);
|
if (material == null) material = Material.matchMaterial(args[1]);
|
||||||
if (material == null) throw new Exception();
|
if (material == null) throw new Exception();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-block-data-unknown", args[1]), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_MATERIAL_UNKNOWN, "block");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <blockName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.BLOCK_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data = Integer.parseInt(args[2]);
|
data = Integer.parseInt(args[2]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-block-data-usage", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "block");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <blockName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.BLOCK_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!material.isBlock()) {
|
if (!material.isBlock()) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-block-data-mismatch", material.name()), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_MATERIAL_MISMATCH, "block");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <blockName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.BLOCK_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data < 0 || data > 15) {
|
if (data < 0 || data > 15) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-block-data-invalid-arguments", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.DATA_INVALID_ARGUMENTS, "block");
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp data <blockName> <0-15>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.BLOCK_DATA_USAGE.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new BlockData(material, (byte) data));
|
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), new BlockData(material, (byte) data));
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-block-data-applied", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.DATA_APPLIED, "block");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,7 +295,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
*/
|
*/
|
||||||
private void onReset(Player p, String[] args) {
|
private void onReset(Player p, String[] args) {
|
||||||
ConfigManager.getInstance().resetPPlayer(p.getUniqueId());
|
ConfigManager.getInstance().resetPPlayer(p.getUniqueId());
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-reset", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.RESET);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -300,25 +306,25 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
*/
|
*/
|
||||||
private void onEffect(Player p, String[] args) {
|
private void onEffect(Player p, String[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-invalid-type", null) + ChatColor.GREEN + " /pp effects | /pp effect <type>", ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.INVALID_TYPE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String argument = args[1].replace("_", "");
|
String argument = args[1].replace("_", "");
|
||||||
if (ParticleCreator.particleFromString(argument) != null) {
|
if (ParticleCreator.particleFromString(argument) != null) {
|
||||||
ParticleEffect effect = ParticleCreator.particleFromString(argument);
|
ParticleEffect effect = ParticleCreator.particleFromString(argument);
|
||||||
if (!PermissionManager.hasEffectPermission(p, effect)) {
|
if (!PermissionManager.hasEffectPermission(p, effect)) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-no-permission", ChatColor.AQUA + effect.getName().toLowerCase() + ChatColor.RED), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.NO_PERMISSION, effect.getName().toLowerCase());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), effect);
|
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), effect);
|
||||||
if (effect != ParticleEffect.NONE) {
|
if (effect != ParticleEffect.NONE) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-now-using", ChatColor.AQUA + effect.getName().toLowerCase() + ChatColor.GREEN), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.NOW_USING, effect.getName().toLowerCase());
|
||||||
} else {
|
} else {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-cleared-particles", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.CLEARED_PARTICLES);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-invalid-type", null) + ChatColor.GREEN + " /pp effects", ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.INVALID_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -328,20 +334,22 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
* @param args The arguments for the command
|
* @param args The arguments for the command
|
||||||
*/
|
*/
|
||||||
private void onEffects(Player p, String[] args) {
|
private void onEffects(Player p, String[] args) {
|
||||||
String toSend = MessageManager.getMessageFromConfig("message-use", null) + " ";
|
String toSend = MessageType.USE.getMessage() + " ";
|
||||||
for (ParticleEffect effect : ParticleEffect.getSupportedEffects()) {
|
for (ParticleEffect effect : ParticleEffect.getSupportedEffects()) {
|
||||||
if (PermissionManager.hasEffectPermission(p, effect)) {
|
if (PermissionManager.hasEffectPermission(p, effect)) {
|
||||||
toSend += effect.getName().toLowerCase().replace("_", "") + ", ";
|
toSend += effect.getName().toLowerCase().replace("_", "") + ", ";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (toSend.equals(MessageManager.getMessageFromConfig("message-use", null) + " ")) {
|
if (toSend.endsWith(", ")) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-no-particles", null), ChatColor.RED);
|
toSend = toSend.substring(0, toSend.length() - 2);
|
||||||
|
}
|
||||||
|
if (toSend.equals(MessageType.USE.getMessage() + " " + ParticleEffect.NONE.getName())) {
|
||||||
|
MessageManager.sendMessage(p, MessageType.NO_PARTICLES);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
toSend = toSend + "clear";
|
MessageManager.sendCustomMessage(p, toSend);
|
||||||
MessageManager.getInstance().sendMessage(p, toSend, ChatColor.GREEN);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.PARTICLE_USAGE.getMessage());
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp effect <type>", ChatColor.YELLOW);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -352,25 +360,25 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
*/
|
*/
|
||||||
private void onStyle(Player p, String[] args) {
|
private void onStyle(Player p, String[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp style <type>", ChatColor.YELLOW);
|
MessageManager.sendMessage(p, MessageType.INVALID_TYPE_STYLE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String argument = args[1].replace("_", "");
|
String argument = args[1].replace("_", "");
|
||||||
if (ParticleStyleManager.styleFromString(argument) != null) {
|
if (ParticleStyleManager.styleFromString(argument) != null) {
|
||||||
ParticleStyle style = ParticleStyleManager.styleFromString(argument);
|
ParticleStyle style = ParticleStyleManager.styleFromString(argument);
|
||||||
if (!PermissionManager.hasStylePermission(p, style)) {
|
if (!PermissionManager.hasStylePermission(p, style)) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-no-permission-style", ChatColor.AQUA + style.getName().toLowerCase() + ChatColor.RED), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.NO_PERMISSION_STYLE, style.getName().toLowerCase());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), style);
|
ConfigManager.getInstance().savePPlayer(p.getUniqueId(), style);
|
||||||
if (style != DefaultStyles.NONE) {
|
if (style != DefaultStyles.NONE) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-now-using-style", ChatColor.AQUA + style.getName().toLowerCase() + ChatColor.GREEN), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.NOW_USING_STYLE, style.getName().toLowerCase());
|
||||||
} else {
|
} else {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-cleared-style", null), ChatColor.GREEN);
|
MessageManager.sendMessage(p, MessageType.CLEARED_STYLE);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-invalid-type-style", null) + ChatColor.GREEN + " /pp styles", ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.INVALID_TYPE_STYLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -380,7 +388,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
* @param args The arguments for the command
|
* @param args The arguments for the command
|
||||||
*/
|
*/
|
||||||
private void onStyles(Player p, String[] args) {
|
private void onStyles(Player p, String[] args) {
|
||||||
String toSend = MessageManager.getMessageFromConfig("message-use-style", null) + " ";
|
String toSend = MessageType.USE.getMessage() + " ";
|
||||||
for (ParticleStyle style : ParticleStyleManager.getStyles()) {
|
for (ParticleStyle style : ParticleStyleManager.getStyles()) {
|
||||||
if (PermissionManager.hasStylePermission(p, style)) {
|
if (PermissionManager.hasStylePermission(p, style)) {
|
||||||
toSend += style.getName().toLowerCase();
|
toSend += style.getName().toLowerCase();
|
||||||
|
@ -390,12 +398,12 @@ public class ParticleCommandExecutor implements CommandExecutor {
|
||||||
if (toSend.endsWith(", ")) {
|
if (toSend.endsWith(", ")) {
|
||||||
toSend = toSend.substring(0, toSend.length() - 2);
|
toSend = toSend.substring(0, toSend.length() - 2);
|
||||||
}
|
}
|
||||||
if (toSend.equals(MessageManager.getMessageFromConfig("message-use-style", null) + " " + DefaultStyles.NONE.getName().toLowerCase())) {
|
if (toSend.equals(MessageType.USE.getMessage() + " " + DefaultStyles.NONE.getName().toLowerCase())) {
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-no-styles", null), ChatColor.RED);
|
MessageManager.sendMessage(p, MessageType.NO_STYLES);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MessageManager.getInstance().sendMessage(p, toSend, ChatColor.GREEN);
|
MessageManager.sendCustomMessage(p, toSend);
|
||||||
MessageManager.getInstance().sendMessage(p, MessageManager.getMessageFromConfig("message-usage", null) + ChatColor.AQUA + " /pp style <type>", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(p, MessageType.USAGE.getMessage() + " " + MessageType.STYLE_USAGE.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ package com.esophose.playerparticles;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
@ -63,7 +64,7 @@ public class ParticleCreator extends BukkitRunnable implements Listener {
|
||||||
ConfigManager.getInstance().getPPlayer(player.getUniqueId());
|
ConfigManager.getInstance().getPPlayer(player.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateIfContains(PPlayer pplayer) {
|
public static void updateIfContains(PPlayer pplayer) {
|
||||||
for (PPlayer pp : particlePlayers) {
|
for (PPlayer pp : particlePlayers) {
|
||||||
if (pp.getUniqueId() == pplayer.getUniqueId()) {
|
if (pp.getUniqueId() == pplayer.getUniqueId()) {
|
||||||
|
@ -89,15 +90,14 @@ public class ParticleCreator extends BukkitRunnable implements Listener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main loop to display all the particles
|
* The main loop to display all the particles
|
||||||
* Updates all the timing variables
|
* Does not display particles if the world is disabled or if the player is in spectator mode
|
||||||
* Refreshes the database connection if it is enabled and it has been 30 seconds since last refresh
|
|
||||||
* Displays the particles for all players on the server
|
|
||||||
*/
|
*/
|
||||||
public void run() {
|
public void run() {
|
||||||
ParticleStyleManager.updateTimers();
|
ParticleStyleManager.updateTimers();
|
||||||
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
if (ConfigManager.getInstance().isWorldDisabled(player.getWorld().getName())) continue;
|
if (ConfigManager.getInstance().isWorldDisabled(player.getWorld().getName())) continue;
|
||||||
|
if (player.getGameMode() == GameMode.SPECTATOR) continue;
|
||||||
PPlayer pplayer = ConfigManager.getInstance().getPPlayer(player.getUniqueId());
|
PPlayer pplayer = ConfigManager.getInstance().getPPlayer(player.getUniqueId());
|
||||||
if (PermissionManager.hasEffectPermission(player, pplayer.getParticleEffect())) {
|
if (PermissionManager.hasEffectPermission(player, pplayer.getParticleEffect())) {
|
||||||
Location loc = player.getLocation();
|
Location loc = player.getLocation();
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright Esophose 2016
|
||||||
|
* While using any of the code provided by this plugin
|
||||||
|
* you must not claim it as your own. This plugin may
|
||||||
|
* be modified and installed on a server, but may not
|
||||||
|
* be distributed to any person by any means.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.esophose.playerparticles;
|
package com.esophose.playerparticles;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -6,7 +14,13 @@ import org.bukkit.Material;
|
||||||
|
|
||||||
public class ParticlesUtil {
|
public class ParticlesUtil {
|
||||||
|
|
||||||
// TODO: Find a more reliable way of doing this that works better
|
/**
|
||||||
|
* Finds a block/item as a material from a string
|
||||||
|
* There must be some better way to do this that reliably gets the correct material
|
||||||
|
*
|
||||||
|
* @param input The material name as a string
|
||||||
|
* @return The material from the string
|
||||||
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public static Material closestMatch(String input) {
|
public static Material closestMatch(String input) {
|
||||||
ArrayList<Material> matchList = new ArrayList<Material>();
|
ArrayList<Material> matchList = new ArrayList<Material>();
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
*
|
*
|
||||||
* TODO: Make sure copyright notice is on all files
|
* TODO: Make sure copyright notice is on all files
|
||||||
* TODO: Make sure all the comments are properly formatted still
|
* TODO: Make sure all the comments are properly formatted still
|
||||||
|
* TODO: Add option to config to show particles in spectator mode or not - Disabled by default
|
||||||
|
* TODO: Add message configuration for data usage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.esophose.playerparticles;
|
package com.esophose.playerparticles;
|
||||||
|
@ -20,6 +22,7 @@ import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import com.esophose.playerparticles.library.MySQL;
|
import com.esophose.playerparticles.library.MySQL;
|
||||||
|
import com.esophose.playerparticles.manager.MessageManager;
|
||||||
import com.esophose.playerparticles.styles.DefaultStyles;
|
import com.esophose.playerparticles.styles.DefaultStyles;
|
||||||
import com.esophose.playerparticles.updater.PluginUpdateListener;
|
import com.esophose.playerparticles.updater.PluginUpdateListener;
|
||||||
import com.esophose.playerparticles.updater.Updater;
|
import com.esophose.playerparticles.updater.Updater;
|
||||||
|
@ -55,6 +58,7 @@ public class PlayerParticles extends JavaPlugin {
|
||||||
*/
|
*/
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
DefaultStyles.registerStyles();
|
DefaultStyles.registerStyles();
|
||||||
|
MessageManager.setup();
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
getCommand("pp").setTabCompleter(new ParticleCommandCompleter());
|
getCommand("pp").setTabCompleter(new ParticleCommandCompleter());
|
||||||
getCommand("pp").setExecutor(new ParticleCommandExecutor());
|
getCommand("pp").setExecutor(new ParticleCommandExecutor());
|
||||||
|
|
|
@ -116,11 +116,9 @@ public abstract class Database {
|
||||||
String[] queries = query.split(";");
|
String[] queries = query.split(";");
|
||||||
for (String q : queries) {
|
for (String q : queries) {
|
||||||
statement.addBatch(q);
|
statement.addBatch(q);
|
||||||
System.out.println("Running query: " + q);
|
|
||||||
}
|
}
|
||||||
results = statement.executeBatch();
|
results = statement.executeBatch();
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Running query: " + query);
|
|
||||||
results = new int[] { statement.executeUpdate(query) };
|
results = new int[] { statement.executeUpdate(query) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,14 +47,10 @@ import com.esophose.playerparticles.library.ReflectionUtils.PackageType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modified a couple things for the plugin
|
* Modified a couple things for the plugin
|
||||||
<<<<<<< HEAD
|
*
|
||||||
* Updated to 1.10
|
* Updated to 1.10
|
||||||
*
|
*
|
||||||
* @author (of changes) Esophose
|
* @author (of changes) Esophose
|
||||||
=======
|
|
||||||
*
|
|
||||||
* @author Esophose
|
|
||||||
>>>>>>> refs/remotes/origin/master
|
|
||||||
*/
|
*/
|
||||||
public enum ParticleEffect {
|
public enum ParticleEffect {
|
||||||
|
|
||||||
|
@ -106,7 +102,9 @@ public enum ParticleEffect {
|
||||||
END_ROD("endrod", 43, 9),
|
END_ROD("endrod", 43, 9),
|
||||||
DAMAGE_INDICATOR("damageindicator", 44, 9),
|
DAMAGE_INDICATOR("damageindicator", 44, 9),
|
||||||
SWEEP_ATTACK("sweepattack", 45, 9),
|
SWEEP_ATTACK("sweepattack", 45, 9),
|
||||||
FALLING_DUST("fallingdust", 46, 10, ParticleProperty.DIRECTIONAL, ParticleProperty.REQUIRES_DATA);
|
FALLING_DUST("fallingdust", 46, 10, ParticleProperty.DIRECTIONAL, ParticleProperty.REQUIRES_DATA),
|
||||||
|
TOTEM("totem", 47, 11, ParticleProperty.DIRECTIONAL),
|
||||||
|
SPIT("spit", 48, 11, ParticleProperty.DIRECTIONAL);
|
||||||
|
|
||||||
private static final Map<String, ParticleEffect> NAME_MAP = new HashMap<String, ParticleEffect>();
|
private static final Map<String, ParticleEffect> NAME_MAP = new HashMap<String, ParticleEffect>();
|
||||||
private static final Map<Integer, ParticleEffect> ID_MAP = new HashMap<Integer, ParticleEffect>();
|
private static final Map<Integer, ParticleEffect> ID_MAP = new HashMap<Integer, ParticleEffect>();
|
||||||
|
|
157
src/com/esophose/playerparticles/library/VectorUtils.java
Normal file
157
src/com/esophose/playerparticles/library/VectorUtils.java
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014 Slikey
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
package com.esophose.playerparticles.library;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public final class VectorUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not instantiable
|
||||||
|
*/
|
||||||
|
private VectorUtils() { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotates a vector around the X axis at an angle
|
||||||
|
*
|
||||||
|
* @param v Starting vector
|
||||||
|
* @param angle How much to rotate
|
||||||
|
* @return The starting vector rotated
|
||||||
|
*/
|
||||||
|
public static final Vector rotateAroundAxisX(Vector v, double angle) {
|
||||||
|
double y, z, cos, sin;
|
||||||
|
cos = Math.cos(angle);
|
||||||
|
sin = Math.sin(angle);
|
||||||
|
y = v.getY() * cos - v.getZ() * sin;
|
||||||
|
z = v.getY() * sin + v.getZ() * cos;
|
||||||
|
return v.setY(y).setZ(z);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotates a vector around the Y axis at an angle
|
||||||
|
*
|
||||||
|
* @param v Starting vector
|
||||||
|
* @param angle How much to rotate
|
||||||
|
* @return The starting vector rotated
|
||||||
|
*/
|
||||||
|
public static final Vector rotateAroundAxisY(Vector v, double angle) {
|
||||||
|
double x, z, cos, sin;
|
||||||
|
cos = Math.cos(angle);
|
||||||
|
sin = Math.sin(angle);
|
||||||
|
x = v.getX() * cos + v.getZ() * sin;
|
||||||
|
z = v.getX() * -sin + v.getZ() * cos;
|
||||||
|
return v.setX(x).setZ(z);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotates a vector around the Z axis at an angle
|
||||||
|
*
|
||||||
|
* @param v Starting vector
|
||||||
|
* @param angle How much to rotate
|
||||||
|
* @return The starting vector rotated
|
||||||
|
*/
|
||||||
|
public static final Vector rotateAroundAxisZ(Vector v, double angle) {
|
||||||
|
double x, y, cos, sin;
|
||||||
|
cos = Math.cos(angle);
|
||||||
|
sin = Math.sin(angle);
|
||||||
|
x = v.getX() * cos - v.getY() * sin;
|
||||||
|
y = v.getX() * sin + v.getY() * cos;
|
||||||
|
return v.setX(x).setY(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotates a vector around the X, Y, and Z axes
|
||||||
|
*
|
||||||
|
* @param v The starting vector
|
||||||
|
* @param angleX The change angle on X
|
||||||
|
* @param angleY The change angle on Y
|
||||||
|
* @param angleZ The change angle on Z
|
||||||
|
* @return The starting vector rotated
|
||||||
|
*/
|
||||||
|
public static final Vector rotateVector(Vector v, double angleX, double angleY, double angleZ) {
|
||||||
|
rotateAroundAxisX(v, angleX);
|
||||||
|
rotateAroundAxisY(v, angleY);
|
||||||
|
rotateAroundAxisZ(v, angleZ);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotate a vector about a location using that location's direction
|
||||||
|
*
|
||||||
|
* @param v The starting vector
|
||||||
|
* @param location The location to rotate around
|
||||||
|
* @return The starting vector rotated
|
||||||
|
*/
|
||||||
|
public static final Vector rotateVector(Vector v, Location location) {
|
||||||
|
return rotateVector(v, location.getYaw(), location.getPitch());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This handles non-unit vectors, with yaw and pitch instead of X,Y,Z angles.
|
||||||
|
*
|
||||||
|
* Thanks to SexyToad!
|
||||||
|
*
|
||||||
|
* @param v The starting vector
|
||||||
|
* @param yawDegrees The yaw offset in degrees
|
||||||
|
* @param pitchDegrees The pitch offset in degrees
|
||||||
|
* @return The starting vector rotated
|
||||||
|
*/
|
||||||
|
public static final Vector rotateVector(Vector v, float yawDegrees, float pitchDegrees) {
|
||||||
|
double yaw = Math.toRadians(-1 * (yawDegrees + 90));
|
||||||
|
double pitch = Math.toRadians(-pitchDegrees);
|
||||||
|
|
||||||
|
double cosYaw = Math.cos(yaw);
|
||||||
|
double cosPitch = Math.cos(pitch);
|
||||||
|
double sinYaw = Math.sin(yaw);
|
||||||
|
double sinPitch = Math.sin(pitch);
|
||||||
|
|
||||||
|
double initialX, initialY, initialZ;
|
||||||
|
double x, y, z;
|
||||||
|
|
||||||
|
// Z_Axis rotation (Pitch)
|
||||||
|
initialX = v.getX();
|
||||||
|
initialY = v.getY();
|
||||||
|
x = initialX * cosPitch - initialY * sinPitch;
|
||||||
|
y = initialX * sinPitch + initialY * cosPitch;
|
||||||
|
|
||||||
|
// Y_Axis rotation (Yaw)
|
||||||
|
initialZ = v.getZ();
|
||||||
|
initialX = x;
|
||||||
|
z = initialZ * cosYaw - initialX * sinYaw;
|
||||||
|
x = initialZ * sinYaw + initialX * cosYaw;
|
||||||
|
|
||||||
|
return new Vector(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the angle toward the X axis
|
||||||
|
*
|
||||||
|
* @param vector
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static final double angleToXAxis(Vector vector) {
|
||||||
|
return Math.atan2(vector.getX(), vector.getY());
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,7 @@ import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
|
@ -399,10 +399,9 @@ public class ConfigManager {
|
||||||
*
|
*
|
||||||
* @return All world names that are disabled
|
* @return All world names that are disabled
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
public List<String> getDisabledWorlds() {
|
||||||
public ArrayList<String> getDisabledWorlds() {
|
|
||||||
if (PlayerParticles.getPlugin().getConfig().get("disabled-worlds") != null) {
|
if (PlayerParticles.getPlugin().getConfig().get("disabled-worlds") != null) {
|
||||||
return ((ArrayList<String>) PlayerParticles.getPlugin().getConfig().get("disabled-worlds"));
|
return PlayerParticles.getPlugin().getConfig().getStringList("disabled-worlds");
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
package com.esophose.playerparticles.manager;
|
package com.esophose.playerparticles.manager;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.esophose.playerparticles.PlayerParticles;
|
import com.esophose.playerparticles.PlayerParticles;
|
||||||
|
@ -16,80 +17,148 @@ import com.esophose.playerparticles.PlayerParticles;
|
||||||
public class MessageManager {
|
public class MessageManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The instance of the MessageManager, we only need one of these
|
* Contains the location in the config of every chat message
|
||||||
*/
|
*/
|
||||||
private static MessageManager instance = new MessageManager();
|
public static enum MessageType {
|
||||||
|
|
||||||
|
// Particles
|
||||||
|
NO_PERMISSION("message-no-permission"),
|
||||||
|
NO_PARTICLES("message-no-particles"),
|
||||||
|
NOW_USING("message-now-using"),
|
||||||
|
CLEARED_PARTICLES("message-cleared-particles"),
|
||||||
|
INVALID_TYPE("message-invalid-type"),
|
||||||
|
PARTICLE_USAGE("message-particle-usage"),
|
||||||
|
|
||||||
|
// Styles
|
||||||
|
NO_PERMISSION_STYLE("message-no-permission-style"),
|
||||||
|
NO_STYLES("message-no-styles"),
|
||||||
|
NOW_USING_STYLE("message-now-using-style"),
|
||||||
|
CLEARED_STYLE("message-cleared-style"),
|
||||||
|
USE_STYLE("message-use-style"),
|
||||||
|
INVALID_TYPE_STYLE("message-invalid-type-style"),
|
||||||
|
STYLE_USAGE("message-style-usage"),
|
||||||
|
|
||||||
|
// Data
|
||||||
|
DATA_USAGE("message-data-usage"),
|
||||||
|
NO_DATA_USAGE("message-no-data-usage"),
|
||||||
|
DATA_APPLIED("message-data-applied"),
|
||||||
|
DATA_INVALID_ARGUMENTS("message-data-invalid-arguments"),
|
||||||
|
DATA_MATERIAL_UNKNOWN("message-data-material-unknown"),
|
||||||
|
DATA_MATERIAL_MISMATCH("message-data-material-mismatch"),
|
||||||
|
NOTE_DATA_USAGE("message-note-data-usage"),
|
||||||
|
COLOR_DATA_USAGE("message-color-data-usage"),
|
||||||
|
ITEM_DATA_USAGE("message-item-data-usage"),
|
||||||
|
BLOCK_DATA_USAGE("message-block-data-usage"),
|
||||||
|
|
||||||
|
// Prefixes
|
||||||
|
USE("message-use"),
|
||||||
|
USAGE("message-usage"),
|
||||||
|
RESET("message-reset"),
|
||||||
|
|
||||||
|
// Other
|
||||||
|
INVALID_ARGUMENTS("message-invalid-arguments"),
|
||||||
|
AVAILABLE_COMMANDS("message-available-commands"),
|
||||||
|
DISABLED_WORLDS_NONE("message-disabled-worlds-none"),
|
||||||
|
DISABLED_WORLDS("message-disabled-worlds"),
|
||||||
|
COMMAND_USAGE("message-command-usage");
|
||||||
|
|
||||||
|
public String configLocation;
|
||||||
|
|
||||||
|
MessageType(String configLocation) {
|
||||||
|
this.configLocation = configLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the message with the given config path
|
||||||
|
*
|
||||||
|
* @return The message from the config
|
||||||
|
*/
|
||||||
|
public String getMessage() {
|
||||||
|
return ChatColor.translateAlternateColorCodes('&', config.getString(this.configLocation));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Values contained in the config used for custom messages
|
* Stores the main config for quick access
|
||||||
*/
|
*/
|
||||||
private boolean messagesEnabled, prefixEnabled;
|
private static FileConfiguration config;
|
||||||
|
/**
|
||||||
|
* Stores if messages and their prefixes should be displayed
|
||||||
|
*/
|
||||||
|
private static boolean messagesEnabled, prefixEnabled;
|
||||||
/**
|
/**
|
||||||
* The prefix to place before all sent messages contained in the config
|
* The prefix to place before all sent messages contained in the config
|
||||||
*/
|
*/
|
||||||
private String messagePrefix;
|
private static String messagePrefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up all the above variables with values from the plugin config
|
* Used to set up the MessageManager
|
||||||
|
* This should only get called once by the PlayerParticles class, however
|
||||||
|
* calling it multiple times wont affect anything negatively
|
||||||
*/
|
*/
|
||||||
private MessageManager() {
|
public static void setup() {
|
||||||
this.messagesEnabled = PlayerParticles.getPlugin().getConfig().getBoolean("messages-enabled");
|
config = PlayerParticles.getPlugin().getConfig();
|
||||||
this.prefixEnabled = PlayerParticles.getPlugin().getConfig().getBoolean("use-message-prefix");
|
messagesEnabled = config.getBoolean("messages-enabled");
|
||||||
this.messagePrefix = PlayerParticles.getPlugin().getConfig().getString("message-prefix");
|
prefixEnabled = config.getBoolean("use-message-prefix");
|
||||||
this.messagePrefix = ChatColor.translateAlternateColorCodes('&', this.messagePrefix);
|
messagePrefix = parseColors(config.getString("message-prefix"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the instance of the MessageManager
|
* Sends a message to the given player
|
||||||
*
|
*
|
||||||
* @return The instance of the MessageManager
|
* @param player The player to send the message to
|
||||||
|
* @param messageType The message to send to the player
|
||||||
*/
|
*/
|
||||||
public static MessageManager getInstance() {
|
public static void sendMessage(Player player, MessageType messageType) {
|
||||||
return instance;
|
if (!messagesEnabled) return;
|
||||||
|
|
||||||
|
String message = messageType.getMessage();
|
||||||
|
if (prefixEnabled) {
|
||||||
|
message = messagePrefix + " " + message;
|
||||||
|
}
|
||||||
|
player.sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a message to a player
|
* Sends a message to the given player and allows for replacing {TYPE}
|
||||||
|
* @param player The player to send the message to
|
||||||
|
* @param messageType The message to send to the player
|
||||||
|
* @param typeReplacement What {TYPE} should be replaced with
|
||||||
|
*/
|
||||||
|
public static void sendMessage(Player player, MessageType messageType, String typeReplacement) {
|
||||||
|
if (!messagesEnabled) return;
|
||||||
|
|
||||||
|
String message = messageType.getMessage().replaceAll("\\{TYPE\\}", typeReplacement);
|
||||||
|
if (prefixEnabled) {
|
||||||
|
message = messagePrefix + " " + message;
|
||||||
|
}
|
||||||
|
player.sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a custom message
|
||||||
|
* Used in cases of string building
|
||||||
*
|
*
|
||||||
* @param player The player to send the message to
|
* @param player The player to send the message to
|
||||||
* @param message The message to send to the player
|
* @param message The message to send to the player
|
||||||
* @param color The chat color to put before the message
|
|
||||||
*/
|
*/
|
||||||
public void sendMessage(Player player, String message, ChatColor color) {
|
public static void sendCustomMessage(Player player, String message) {
|
||||||
if (!this.messagesEnabled) return;
|
if (!messagesEnabled) return;
|
||||||
if (this.prefixEnabled) {
|
|
||||||
message = this.messagePrefix + color + " " + message;
|
if (prefixEnabled) {
|
||||||
} else {
|
message = messagePrefix + " " + message;
|
||||||
message = color + message;
|
|
||||||
}
|
}
|
||||||
player.sendMessage(message);
|
player.sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a player a message without any custom coloring
|
* Translates all & symbols into the Minecraft chat color symbol
|
||||||
* This will become the default in v4.1
|
|
||||||
*
|
*
|
||||||
* @param player The player to send the message to
|
* @param message The input
|
||||||
* @param message The message to send to the player
|
* @return The output, parsed
|
||||||
*/
|
*/
|
||||||
public void sendMessage(Player player, String message) {
|
public static String parseColors(String message) {
|
||||||
if (!this.messagesEnabled) return;
|
return ChatColor.translateAlternateColorCodes('&', message);
|
||||||
if (this.prefixEnabled) {
|
|
||||||
message = this.messagePrefix + message;
|
|
||||||
}
|
|
||||||
player.sendMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a message from the config with the formatting specified
|
|
||||||
*
|
|
||||||
* @param target The string to find in the config
|
|
||||||
* @param replacement The replacement for {TYPE}, can be null
|
|
||||||
* @return The message requested with the applied formatting
|
|
||||||
*/
|
|
||||||
public static String getMessageFromConfig(String target, String replacement) {
|
|
||||||
String message = ChatColor.translateAlternateColorCodes('&', PlayerParticles.getPlugin().getConfig().getString(target));
|
|
||||||
if (replacement != null) message = message.replaceAll("\\{TYPE\\}", replacement);
|
|
||||||
return message;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ public class PermissionManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a player has permission to use an effect
|
* Checks if a player has permission to use an effect
|
||||||
|
* Always returns true for 'none'
|
||||||
*
|
*
|
||||||
* @param player The player to check the permission for
|
* @param player The player to check the permission for
|
||||||
* @param effect The effect to check
|
* @param effect The effect to check
|
||||||
|
|
|
@ -9,6 +9,9 @@ import com.esophose.playerparticles.styles.api.ParticleStyleManager;
|
||||||
|
|
||||||
public class DefaultStyles {
|
public class DefaultStyles {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All the styles that are available by default from this plugin
|
||||||
|
*/
|
||||||
public static ParticleStyle NONE = new ParticleStyleNone();
|
public static ParticleStyle NONE = new ParticleStyleNone();
|
||||||
public static ParticleStyle SPIRAL = new ParticleStyleSpiral();
|
public static ParticleStyle SPIRAL = new ParticleStyleSpiral();
|
||||||
public static ParticleStyle HALO = new ParticleStyleHalo();
|
public static ParticleStyle HALO = new ParticleStyleHalo();
|
||||||
|
@ -18,7 +21,11 @@ public class DefaultStyles {
|
||||||
public static ParticleStyle QUADHELIX = new ParticleStyleQuadhelix();
|
public static ParticleStyle QUADHELIX = new ParticleStyleQuadhelix();
|
||||||
public static ParticleStyle ORBIT = new ParticleStyleOrbit();
|
public static ParticleStyle ORBIT = new ParticleStyleOrbit();
|
||||||
public static ParticleStyle FEET = new ParticleStyleFeet();
|
public static ParticleStyle FEET = new ParticleStyleFeet();
|
||||||
|
public static ParticleStyle CUBE = new ParticleStyleCube();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers all the default styles to the ParticleStyleManager
|
||||||
|
*/
|
||||||
public static void registerStyles() {
|
public static void registerStyles() {
|
||||||
ParticleStyleManager.registerStyle(NONE);
|
ParticleStyleManager.registerStyle(NONE);
|
||||||
ParticleStyleManager.registerStyle(SPIRAL);
|
ParticleStyleManager.registerStyle(SPIRAL);
|
||||||
|
@ -29,8 +36,9 @@ public class DefaultStyles {
|
||||||
ParticleStyleManager.registerStyle(QUADHELIX);
|
ParticleStyleManager.registerStyle(QUADHELIX);
|
||||||
ParticleStyleManager.registerStyle(ORBIT);
|
ParticleStyleManager.registerStyle(ORBIT);
|
||||||
ParticleStyleManager.registerStyle(FEET);
|
ParticleStyleManager.registerStyle(FEET);
|
||||||
|
ParticleStyleManager.registerStyle(CUBE);
|
||||||
|
|
||||||
Bukkit.getServer().getPluginManager().registerEvents((Listener) MOVE, PlayerParticles.getPlugin());
|
Bukkit.getPluginManager().registerEvents((Listener) MOVE, PlayerParticles.getPlugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014 Slikey
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
package com.esophose.playerparticles.styles;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import com.esophose.playerparticles.PPlayer;
|
||||||
|
import com.esophose.playerparticles.library.VectorUtils;
|
||||||
|
import com.esophose.playerparticles.styles.api.PParticle;
|
||||||
|
import com.esophose.playerparticles.styles.api.ParticleStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credit goes to Slikey who made all this logic for drawing a cube out of particles
|
||||||
|
* The project this is from is called EffectLib and can be found here:
|
||||||
|
* https://github.com/Slikey/EffectLib
|
||||||
|
*/
|
||||||
|
public class ParticleStyleCube implements ParticleStyle {
|
||||||
|
|
||||||
|
private float edgeLength = 2;
|
||||||
|
private double angularVelocityX = (Math.PI / 200) / 5;
|
||||||
|
private double angularVelocityY = (Math.PI / 170) / 5;
|
||||||
|
private double angularVelocityZ = (Math.PI / 155) / 5;
|
||||||
|
private int particles = 8;
|
||||||
|
private int step = 0;
|
||||||
|
|
||||||
|
public PParticle[] getParticles(PPlayer pplayer, Location location) {
|
||||||
|
List<PParticle> pparticles = new ArrayList<PParticle>();
|
||||||
|
|
||||||
|
double xRotation = 0, yRotation = 0, zRotation = 0;
|
||||||
|
xRotation = step * angularVelocityX;
|
||||||
|
yRotation = step * angularVelocityY;
|
||||||
|
zRotation = step * angularVelocityZ;
|
||||||
|
float a = edgeLength / 2;
|
||||||
|
double angleX, angleY;
|
||||||
|
Vector v = new Vector();
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
angleY = i * Math.PI / 2;
|
||||||
|
for (int j = 0; j < 2; j++) {
|
||||||
|
angleX = j * Math.PI;
|
||||||
|
for (int p = 0; p <= particles; p++) {
|
||||||
|
v.setX(a).setY(a);
|
||||||
|
v.setZ(edgeLength * p / particles - a);
|
||||||
|
VectorUtils.rotateAroundAxisX(v, angleX);
|
||||||
|
VectorUtils.rotateAroundAxisY(v, angleY);
|
||||||
|
VectorUtils.rotateVector(v, xRotation, yRotation, zRotation);
|
||||||
|
pparticles.add(new PParticle(location.clone().add(v)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int p = 0; p <= particles; p++) {
|
||||||
|
v.setX(a).setZ(a);
|
||||||
|
v.setY(edgeLength * p / particles - a);
|
||||||
|
VectorUtils.rotateAroundAxisY(v, angleY);
|
||||||
|
VectorUtils.rotateVector(v, xRotation, yRotation, zRotation);
|
||||||
|
pparticles.add(new PParticle(location.clone().add(v)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pparticles.toArray(new PParticle[pparticles.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateTimers() {
|
||||||
|
step++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return "cube";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -109,6 +109,10 @@ public class ParticleStyleNone implements ParticleStyle {
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
particles[i] = new PParticle(location.add(0, 0.75, 0), 0.6F, 0.4F, 0.6F, 0.0F);
|
particles[i] = new PParticle(location.add(0, 0.75, 0), 0.6F, 0.4F, 0.6F, 0.0F);
|
||||||
return particles;
|
return particles;
|
||||||
|
} else if (particleEffect.equals(ParticleEffect.TOTEM)) {
|
||||||
|
return new PParticle[] { new PParticle(location, 0.6F, 0.6F, 0.6F, 0.0F) };
|
||||||
|
} else if (particleEffect.equals(ParticleEffect.SPIT)) {
|
||||||
|
return new PParticle[] { new PParticle(location, 0.6F, 0.6F, 0.6F, 0.0F) };
|
||||||
} else {
|
} else {
|
||||||
return new PParticle[] { new PParticle(location, 0.4F, 0.4F, 0.4F, 0.0F) };
|
return new PParticle[] { new PParticle(location, 0.4F, 0.4F, 0.4F, 0.0F) };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,20 @@
|
||||||
|
/**
|
||||||
|
* Copyright Esophose 2016
|
||||||
|
* While using any of the code provided by this plugin
|
||||||
|
* you must not claim it as your own. This plugin may
|
||||||
|
* be modified and installed on a server, but may not
|
||||||
|
* be distributed to any person by any means.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.esophose.playerparticles.styles.api;
|
package com.esophose.playerparticles.styles.api;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
public class PParticle {
|
public class PParticle {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data that affects the particle
|
||||||
|
*/
|
||||||
private Location location;
|
private Location location;
|
||||||
private float speed;
|
private float speed;
|
||||||
private float xOff, yOff, zOff;
|
private float xOff, yOff, zOff;
|
||||||
|
|
|
@ -14,6 +14,13 @@ import com.esophose.playerparticles.PPlayer;
|
||||||
|
|
||||||
public interface ParticleStyle {
|
public interface ParticleStyle {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets all the particles to display based on the style's logic
|
||||||
|
*
|
||||||
|
* @param pplayer The PPlayer to display the particles for
|
||||||
|
* @param location The central location of the particles
|
||||||
|
* @return A list of all PParticles' to spawn
|
||||||
|
*/
|
||||||
public PParticle[] getParticles(PPlayer pplayer, Location location);
|
public PParticle[] getParticles(PPlayer pplayer, Location location);
|
||||||
|
|
||||||
public void updateTimers();
|
public void updateTimers();
|
||||||
|
|
|
@ -1,12 +1,28 @@
|
||||||
|
/**
|
||||||
|
* Copyright Esophose 2016
|
||||||
|
* While using any of the code provided by this plugin
|
||||||
|
* you must not claim it as your own. This plugin may
|
||||||
|
* be modified and installed on a server, but may not
|
||||||
|
* be distributed to any person by any means.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.esophose.playerparticles.styles.api;
|
package com.esophose.playerparticles.styles.api;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class ParticleStyleManager {
|
public class ParticleStyleManager {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Arrays that contain all registered styles
|
||||||
|
*/
|
||||||
private static ArrayList<ParticleStyle> styles = new ArrayList<ParticleStyle>();
|
private static ArrayList<ParticleStyle> styles = new ArrayList<ParticleStyle>();
|
||||||
private static ArrayList<ParticleStyle> customHandledStyles = new ArrayList<ParticleStyle>();
|
private static ArrayList<ParticleStyle> customHandledStyles = new ArrayList<ParticleStyle>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a style that is put into the plugin's update loop
|
||||||
|
*
|
||||||
|
* @param style The style to add
|
||||||
|
*/
|
||||||
public static void registerStyle(ParticleStyle style) {
|
public static void registerStyle(ParticleStyle style) {
|
||||||
for (ParticleStyle testAgainst : styles) {
|
for (ParticleStyle testAgainst : styles) {
|
||||||
if (testAgainst.getName().replace("_", "").equalsIgnoreCase(style.getName())) {
|
if (testAgainst.getName().replace("_", "").equalsIgnoreCase(style.getName())) {
|
||||||
|
@ -18,15 +34,30 @@ public class ParticleStyleManager {
|
||||||
styles.add(style);
|
styles.add(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a style that isn't updated on the normal update loop
|
||||||
|
*
|
||||||
|
* @param style The style to register
|
||||||
|
*/
|
||||||
public static void registerCustomHandledStyle(ParticleStyle style) {
|
public static void registerCustomHandledStyle(ParticleStyle style) {
|
||||||
registerStyle(style);
|
registerStyle(style);
|
||||||
customHandledStyles.add(style);
|
customHandledStyles.add(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns if a given style is customly handled
|
||||||
|
*
|
||||||
|
* @param style The style to check
|
||||||
|
* @return If the style is handled in a custom manner
|
||||||
|
*/
|
||||||
public static boolean isCustomHandled(ParticleStyle style) {
|
public static boolean isCustomHandled(ParticleStyle style) {
|
||||||
return customHandledStyles.contains(style);
|
return customHandledStyles.contains(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets all registered styles
|
||||||
|
* @return An ArrayList of all registered styles
|
||||||
|
*/
|
||||||
public static ArrayList<ParticleStyle> getStyles() {
|
public static ArrayList<ParticleStyle> getStyles() {
|
||||||
return styles;
|
return styles;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,14 +21,14 @@ public class PluginUpdateListener implements Listener {
|
||||||
/**
|
/**
|
||||||
* Called when a player joins and notifies ops if an update is available
|
* Called when a player joins and notifies ops if an update is available
|
||||||
*
|
*
|
||||||
* @param e The event
|
* @param e The join event
|
||||||
*/
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||||
if (e.getPlayer().isOp()) {
|
if (e.getPlayer().isOp()) {
|
||||||
if (PlayerParticles.updateVersion != null) {
|
if (PlayerParticles.updateVersion != null) {
|
||||||
MessageManager.getInstance().sendMessage(e.getPlayer(), "An update (" + ChatColor.AQUA + "v" + PlayerParticles.updateVersion + ChatColor.YELLOW + ") is available! You are running " + ChatColor.AQUA + "v" + PlayerParticles.getPlugin().getDescription().getVersion(), ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(e.getPlayer(), ChatColor.YELLOW + "An update (" + ChatColor.AQUA + "v" + PlayerParticles.updateVersion + ChatColor.YELLOW + ") is available! You are running " + ChatColor.AQUA + "v" + PlayerParticles.getPlugin().getDescription().getVersion());
|
||||||
MessageManager.getInstance().sendMessage(e.getPlayer(), "Download from: http://dev.bukkit.org/bukkit-plugins/playerparticles/", ChatColor.YELLOW);
|
MessageManager.sendCustomMessage(e.getPlayer(), ChatColor.YELLOW + "Download from: http://dev.bukkit.org/bukkit-plugins/playerparticles/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
193
src/config.yml
193
src/config.yml
|
@ -1,5 +1,5 @@
|
||||||
# __________.__ __________ __ .__ .__ _____
|
# ____________ __________ __ __ __ _____
|
||||||
# \______ \ | _____ ___.__. __________\______ \_____ ________/ |_|__| ____ | | ____ ______ ___ __/ | |
|
# \______ \ | _____ ___ __ __________\______ \_____ ________/ |_|__| ____ | | ____ ______ ___ __/ | |
|
||||||
# | ___/ | \__ \< | |/ __ \_ __ \ ___/\__ \\_ __ \ __\ |/ ___\| | _/ __ \ / ___/ \ \/ / | |_
|
# | ___/ | \__ \< | |/ __ \_ __ \ ___/\__ \\_ __ \ __\ |/ ___\| | _/ __ \ / ___/ \ \/ / | |_
|
||||||
# | | | |__/ __ \\___ \ ___/| | \/ | / __ \| | \/| | | \ \___| |_\ ___/ \___ \ \ / ^ /
|
# | | | |__/ __ \\___ \ ___/| | \/ | / __ \| | \/| | | \ \___| |_\ ___/ \___ \ \ / ^ /
|
||||||
# |____| |____(____ / ____|\___ >__| |____| (____ /__| |__| |__|\___ >____/\___ >____ > \_/\____ |
|
# |____| |____(____ / ____|\___ >__| |____| (____ /__| |__| |__|\___ >____/\___ >____ > \_/\____ |
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
# Changing this value will reset your config on the next server reload/restart.
|
# Changing this value will reset your config on the next server reload/restart.
|
||||||
# I don't recommend changing it
|
# I don't recommend changing it
|
||||||
version: 4
|
version: 4.1
|
||||||
|
|
||||||
# How many ticks to wait before spawning more particles
|
# How many ticks to wait before spawning more particles
|
||||||
# Increasing this value may cause less lag, but will decrease prettiness
|
# Increasing this value may cause less lag, but will decrease prettiness
|
||||||
|
@ -27,6 +27,7 @@ ticks-per-particle: 1
|
||||||
check-updates: true
|
check-updates: true
|
||||||
|
|
||||||
# The worlds which this plugin is disabled in
|
# The worlds which this plugin is disabled in
|
||||||
|
# Remove the [] before you enter worlds names
|
||||||
# Default: []
|
# Default: []
|
||||||
disabled-worlds: []
|
disabled-worlds: []
|
||||||
# - your_world_name_here
|
# - your_world_name_here
|
||||||
|
@ -43,12 +44,13 @@ use-message-prefix: true
|
||||||
# The prefix to use for all PlayerParticle messages
|
# The prefix to use for all PlayerParticle messages
|
||||||
# Use & to set color / format
|
# Use & to set color / format
|
||||||
# This is useless if use-message-prefix is set to false
|
# This is useless if use-message-prefix is set to false
|
||||||
# Default: '&c[&ePlayerParticles&c]'
|
# Default: '&7[&3PlayerParticles&7]'
|
||||||
message-prefix: '&7[&3PlayerParticles&7]'
|
message-prefix: '&7[&3PlayerParticles&7]'
|
||||||
|
|
||||||
# ================================================================ #
|
# ================================================================ #
|
||||||
# MESSAGE CONFIGURATION #
|
# MESSAGE CONFIGURATION #
|
||||||
# Important Notes: #
|
# Important Notes: #
|
||||||
|
# * You can use the & symbol to color the messages #
|
||||||
# * {TYPE} Will be replaced with whatever that message requires #
|
# * {TYPE} Will be replaced with whatever that message requires #
|
||||||
# * You can not use the apostrophe character! ( ' ) #
|
# * You can not use the apostrophe character! ( ' ) #
|
||||||
# ================================================================ #
|
# ================================================================ #
|
||||||
|
@ -58,153 +60,146 @@ message-prefix: '&7[&3PlayerParticles&7]'
|
||||||
# ------------- #
|
# ------------- #
|
||||||
|
|
||||||
# No Particle Permission
|
# No Particle Permission
|
||||||
# Default: 'You do not have permission to use {TYPE} particles!'
|
# Default: '&cYou do not have permission to use &b{TYPE} &cparticles!'
|
||||||
message-no-permission: 'You do not have permission to use {TYPE} particles!'
|
message-no-permission: '&cYou do not have permission to use &b{TYPE} &cparticles!'
|
||||||
|
|
||||||
# /pp list No Particles
|
# /pp list No Particles
|
||||||
# Default: 'You do not have permission to use any particles!'
|
# Default: '&cYou do not have permission to use any particles!'
|
||||||
message-no-particles: 'You do not have permission to use any particles!'
|
message-no-particles: '&cYou do not have permission to use any particles!'
|
||||||
|
|
||||||
# Now Using Particles
|
# Now Using Particles
|
||||||
# Default: 'Now using {TYPE} particles!'
|
# Default: '&aNow using &b{TYPE} &aparticles!'
|
||||||
message-now-using: 'Now using {TYPE} particles!'
|
message-now-using: '&aNow using &b{TYPE} &aparticles!'
|
||||||
|
|
||||||
# Cleared Particles
|
# Cleared Particles
|
||||||
# Default: 'Your particles have been cleared!'
|
# Default: '&aYour particles have been cleared!'
|
||||||
message-cleared-particles: 'Your particles have been cleared!'
|
message-cleared-particles: '&aYour particles have been cleared!'
|
||||||
|
|
||||||
# You Can Use Particles
|
|
||||||
# Default: 'You can use:'
|
|
||||||
message-use: 'You can use:'
|
|
||||||
|
|
||||||
# Invalid Particle Type
|
# Invalid Particle Type
|
||||||
# Default: 'Invalid particle type!'
|
# Default: '&cInvalid particle type! &b/pp effects'
|
||||||
message-invalid-type: 'Invalid particle type!'
|
message-invalid-type: '&cInvalid particle type! &b/pp effects &c| &b/pp effect <type>'
|
||||||
|
|
||||||
|
# Particle Command Usage
|
||||||
|
# You should not change the text here, only the coloring
|
||||||
|
# Default: '&b/pp effect <type>'
|
||||||
|
message-particle-usage: '&b/pp effect <type>'
|
||||||
|
|
||||||
# -------------- #
|
# -------------- #
|
||||||
# Styles #
|
# Styles #
|
||||||
# -------------- #
|
# -------------- #
|
||||||
|
|
||||||
# No Style Permission
|
# No Style Permission
|
||||||
# Default: 'You do not have permission to use the style type {TYPE}!'
|
# Default: '&cYou do not have permission to use the style type &b{TYPE}&c!'
|
||||||
message-no-permission-style: 'You do not have permission to use the style type {TYPE}!'
|
message-no-permission-style: '&cYou do not have permission to use the style type &b{TYPE}&c!'
|
||||||
|
|
||||||
# /pp styles No Styles
|
# /pp styles No Styles
|
||||||
# Default: 'You do not have permission to use any particles!'
|
# Default: '&cYou do not have permission to use any styles!'
|
||||||
message-no-styles: 'You do not have permission to use any styles!'
|
message-no-styles: '&cYou do not have permission to use any styles!'
|
||||||
|
|
||||||
# Now Using Style
|
# Now Using Style
|
||||||
# Default: 'Now using the style type {TYPE}!'
|
# Default: '&aNow using the style type &b{TYPE}&a!'
|
||||||
message-now-using-style: 'Now using the style type {TYPE}!'
|
message-now-using-style: '&aNow using the style type &b{TYPE}&a!'
|
||||||
|
|
||||||
# Cleared Style
|
# Cleared Style
|
||||||
# Default: 'Cleared your particles!'
|
# Default: '&aYour style has been cleared!'
|
||||||
message-cleared-style: 'Your style has been cleared!'
|
message-cleared-style: '&aYour style has been cleared!'
|
||||||
|
|
||||||
# You Can Use Styles
|
|
||||||
# Default: 'You can use:'
|
|
||||||
message-use-style: 'You can use:'
|
|
||||||
|
|
||||||
# Invalid Style Type
|
# Invalid Style Type
|
||||||
# Default: 'Invalid style type!'
|
# Default: '&cInvalid style type! &b/pp styles &c| &b/pp style <type>'
|
||||||
message-invalid-type-style: 'Invalid style type!'
|
message-invalid-type-style: '&cInvalid style type! &b/pp styles &c| &b/pp style <type>'
|
||||||
|
|
||||||
|
# Style Command Usage
|
||||||
|
# You should not change the text here, only the coloring
|
||||||
|
# Default: '&b/pp style <type>'
|
||||||
|
message-style-usage: '&b/pp style <type>'
|
||||||
|
|
||||||
# ------------ #
|
# ------------ #
|
||||||
# Data #
|
# Data #
|
||||||
# ------------ #
|
# ------------ #
|
||||||
|
|
||||||
# Note Data Usage
|
# Data Usage
|
||||||
# Default: 'Your current effect requires note data.'
|
# Default: '&eYour current effect requires &b{TYPE} &edata!'
|
||||||
message-note-data-usage: 'Your current effect requires note data.'
|
message-data-usage: '&eYour current effect requires &b{TYPE} &edata!'
|
||||||
|
|
||||||
# Color Data Usage
|
|
||||||
# Default: 'Your current effect requires color data.'
|
|
||||||
message-color-data-usage: 'Your current effect requires color data.'
|
|
||||||
|
|
||||||
# Block Data Usage
|
|
||||||
# Default: 'Your current effect requires block data.'
|
|
||||||
message-block-data-usage: 'Your current effect requires block data.'
|
|
||||||
|
|
||||||
# Item Data Usage
|
|
||||||
# Default: 'Your current effect requires item data.'
|
|
||||||
message-item-data-usage: 'Your current effect requires item data.'
|
|
||||||
|
|
||||||
# No Data Required
|
# No Data Required
|
||||||
# Default: 'Your current effect does not use any data.'
|
# Default: '&eYour current effect does not use any data!'
|
||||||
message-no-data-usage: 'Your current effect does not use any data.'
|
message-no-data-usage: '&eYour current effect does not use any data!'
|
||||||
|
|
||||||
# Note Data Applied
|
# Data Applied
|
||||||
# Default: 'Your note data has been applied!'
|
# Default: '&aYour &b{TYPE} &adata has been applied!'
|
||||||
message-note-data-applied: 'Your note data has been applied!'
|
message-data-applied: '&aYour &b{TYPE} &adata has been applied!'
|
||||||
|
|
||||||
# Color Data Applied
|
# Invalid Data Arguments
|
||||||
# Default: 'Your color data has been applied!'
|
# Default: '&cInvalid &b{TYPE} &cdata arguments!'
|
||||||
message-color-data-applied: 'Your color data has been applied!'
|
message-data-invalid-arguments: '&cInvalid &b{TYPE} &cdata arguments!'
|
||||||
|
|
||||||
# Block Data Applied
|
# Unknown Material
|
||||||
# Default: 'Your block data has been applied!'
|
# Default: '&cThe {TYPE} name you supplied is invalid!'
|
||||||
message-block-data-applied: 'Your block data has been applied!'
|
message-data-material-unknown: '&cThe &b{TYPE} &cname you supplied is invalid!'
|
||||||
|
|
||||||
# Item Data Applied
|
# Mismatched Material
|
||||||
# Default: 'Your item data has been applied!'
|
# Default: '&cThe material supplied is not of type &b{TYPE}&c!'
|
||||||
message-item-data-applied: 'Your item data has been applied!'
|
message-data-material-mismatch: '&cThe material supplied is not of type &b{TYPE}&c!'
|
||||||
|
|
||||||
# Invalid Note Data Arguments
|
# Note Data Usage
|
||||||
# Default: 'Invalid note data arguments!'
|
# You should not change the text here, only the coloring
|
||||||
message-note-data-invalid-arguments: 'Invalid note data arguments!'
|
# Default: '&b/pp data <0-23>'
|
||||||
|
message-note-data-usage: '&b/pp data <0-23>'
|
||||||
|
|
||||||
# Invalid Color Data Arguments
|
# Color Data Usage
|
||||||
# Default: 'Invalid color data arguments!'
|
# You should not change the text here, only the coloring
|
||||||
message-color-data-invalid-arguments: 'Invalid color data arguments!'
|
# Default: '&b/pp data <0-255> <0-255> <0-255>'
|
||||||
|
message-color-data-usage: '&b/pp data <0-255> <0-255> <0-255>'
|
||||||
|
|
||||||
# Invalid Block Data Arguments
|
# Item Data Usage
|
||||||
# Default: 'Invalid block data arguments!'
|
# You should not change the text here, only the coloring
|
||||||
message-block-data-invalid-arguments: 'Invalid block data arguments!'
|
# Default: '&b/pp data <itemName> <0-15>'
|
||||||
|
message-item-data-usage: '&b/pp data <itemName> <0-15>'
|
||||||
|
|
||||||
# Invalid Item Data Arguments
|
# Block Data Usage
|
||||||
# Default: 'Invalid item data arguments!'
|
# You should not change the text here, only the coloring
|
||||||
message-item-data-invalid-arguments: 'Invalid item data arguments!'
|
# Default: '&b/pp data <blockName> <0-15>'
|
||||||
|
message-block-data-usage: '&b/pp data <blockName> <0-15>'
|
||||||
|
|
||||||
# Unknown Block Material
|
# ---------------- #
|
||||||
# Default: 'The block name you supplied is invalid'
|
# Prefixes #
|
||||||
message-block-data-material-unknown: 'The block name you supplied is invalid'
|
# ---------------- #
|
||||||
|
|
||||||
# Unknown Item Material
|
# You Can Use Particles
|
||||||
# Default: 'The item name you supplied is invalid'
|
# Default: '&eYou can use:'
|
||||||
message-item-data-material-unknown: 'The item name you supplied is invalid'
|
message-use: '&eYou can use:&b'
|
||||||
|
|
||||||
<<<<<<< HEAD
|
# Usage
|
||||||
=======
|
# Default: '&eUsage:'
|
||||||
|
message-usage: '&eUsage:'
|
||||||
|
|
||||||
|
# Available Commands
|
||||||
|
# Default: '&eAvailable commands: &beffect, effects, style, styles, data, reset, worlds, version, help'
|
||||||
|
message-available-commands: '&eAvailable commands: &beffect, effects, style, styles, data, reset, worlds, version, help'
|
||||||
|
|
||||||
|
# Disabled Worlds
|
||||||
|
# Default: '&eParticles are disabled in these worlds:&b'
|
||||||
|
message-disabled-worlds: '&eParticles are disabled in these worlds:&b'
|
||||||
|
|
||||||
>>>>>>> refs/remotes/origin/master
|
|
||||||
# ------------- #
|
# ------------- #
|
||||||
# Other #
|
# Other #
|
||||||
# ------------- #
|
# ------------- #
|
||||||
|
|
||||||
# Usage
|
|
||||||
# Default: 'Usage:'
|
|
||||||
message-usage: 'Usage:'
|
|
||||||
|
|
||||||
# Reset
|
# Reset
|
||||||
# Default: 'Your effect, style, and data have all been reset!'
|
# Default: '&aYour effect, style, and data have all been reset!'
|
||||||
message-reset: 'Your effect, style, and data have all been reset!'
|
message-reset: '&aYour effect, style, and data have all been reset!'
|
||||||
|
|
||||||
# Invalid Arguments
|
# Invalid Arguments
|
||||||
# Default: 'Invalid arguments!'
|
# Default: '&cInvalid arguments! &a/pp help'
|
||||||
message-invalid-arguments: 'Invalid arguments!'
|
message-invalid-arguments: '&cInvalid arguments! &b/pp help'
|
||||||
|
|
||||||
# Available Commands
|
|
||||||
# Default: 'Available commands:'
|
|
||||||
message-available-commands: 'Available commands:'
|
|
||||||
|
|
||||||
# Disabled Worlds None
|
# Disabled Worlds None
|
||||||
# Default: 'Particles are not disabled in any worlds!'
|
# Default: '&eParticles are not disabled in any worlds!'
|
||||||
message-disabled-worlds-none: 'Particles are not disabled in any worlds!'
|
message-disabled-worlds-none: '&eParticles are not disabled in any worlds!'
|
||||||
|
|
||||||
# Disabled Worlds
|
# Command Usage
|
||||||
# Default: 'Particles are disabled in these worlds:'
|
# Default: '&eCommand Usage: /pp <command>'
|
||||||
message-disabled-worlds: 'Particles are disabled in these worlds:'
|
message-command-usage: '&eCommand Usage: &b/pp <command>'
|
||||||
|
|
||||||
# ================================================================ #
|
# ================================================================ #
|
||||||
# DATABASE CONFIGURATION #
|
# DATABASE CONFIGURATION #
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: PlayerParticles
|
name: PlayerParticles
|
||||||
main: com.esophose.playerparticles.PlayerParticles
|
main: com.esophose.playerparticles.PlayerParticles
|
||||||
version: 4
|
version: 4.1
|
||||||
description: Make particles around players.
|
description: Make particles around players.
|
||||||
author: Esophose
|
author: Esophose
|
||||||
website: http://dev.bukkit.org/bukkit-plugins/playerparticles/
|
website: http://dev.bukkit.org/bukkit-plugins/playerparticles/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue