The v4.3 Update

This commit marks the end of the v4.3 update. Future commits will be on
future versions.
This commit is contained in:
Esophose 2017-04-04 20:31:48 -06:00
parent 97799955de
commit 3f5cd1ce69
9 changed files with 100 additions and 41 deletions

View file

@ -1,5 +1,21 @@
== UPDATING WILL DELETE YOUR CONFIG.YML ==
* Create a backup of your config.yml if you wish to import all your old settings!
=== v4.3 ===
* Fix effects and styles not defaulting to 'none' if the player no longer has permission
* Fix errors printing to console resulting from offline players trying to spawn particles
* Fix arrow style particles staying after an arrow is considered dead (in rare cases this occurred)
* Fix SQL queries getting logged to console when database-enable is set to true
* Fix tab completion, it stopped working at one point and I didn't notice until now
* Fix style 'arrows' not working with tipped/spectral arrows
* Fix 1.7 support being broken. It is now supported again!
* The style 'beam' now moves up and down rather than just up
* Added fixed particle effects, see how to use them on the main plugin page
* Requires permission playerparticles.fixed or playerparticles.*
* Infinite fixed effects with permission playerparticles.fixed.unlimited (playerparticles.* does not grant this permission)
* Ability to remove all fixed effects of any player within a given radius with /pp fixed clear <radius> and the permission playerparticles.fixed.clear (playerparticles.* does not grant this permission)
* Added new style 'thick'
* Added ability to force reset a player's particle effect, style, and data using /pp reset <playerName>
* Requires permission playerparticles.forcereset
=== v4.2 ===
* Rainbow particles are back! /pp data rainbow (for colorable particles)
* Added new style 'arrows'

View file

@ -9,6 +9,7 @@
package com.esophose.playerparticles;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@ -325,7 +326,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
private void onReset(Player p, String[] args) {
if (args.length >= 1) {
String altPlayerName = args[0];
if (!PermissionManager.canExecuteForOthers(p)) {
if (!PermissionManager.canUseForceReset(p)) {
MessageManager.sendMessage(p, MessageType.FAILED_EXECUTE_NO_PERMISSION, altPlayerName);
} else {
Player altPlayer = getOnlinePlayerByName(altPlayerName);
@ -468,6 +469,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_REMOVE);
MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_LIST);
MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_INFO);
if (p.hasPermission("playerparticles.fixed.clear")) MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_CLEAR);
return;
}
@ -541,7 +543,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
MessageManager.sendMessage(p, MessageType.CREATE_FIXED_NO_PERMISSION_STYLE, args[4]);
return;
}
if (!style.canBeFixed()) {
MessageManager.sendMessage(p, MessageType.CREATE_FIXED_NON_FIXABLE_STYLE, style.getName());
return;
@ -570,7 +572,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
MessageManager.sendMessage(p, MessageType.CREATE_FIXED_DATA_ERROR, "note");
return;
}
noteColorData = new NoteColor(note);
}
} else {
@ -731,12 +733,45 @@ public class ParticleCommandExecutor implements CommandExecutor {
.replaceAll("\\{6\\}", fixedEffect.getParticleStyle().getName())
.replaceAll("\\{7\\}", fixedEffect.getParticleDataString()); // @formatter:on
MessageManager.sendCustomMessage(p, listMessage);
} else if (cmd.equalsIgnoreCase("clear")) {
if (!p.hasPermission("playerparticles.fixed.clear")) {
MessageManager.sendMessage(p, MessageType.CLEAR_FIXED_NO_PERMISSION);
return;
}
if (args.length < 1) {
MessageManager.sendMessage(p, MessageType.CLEAR_FIXED_NO_ARGS);
return;
}
int radius = -1;
try {
radius = Math.abs(Integer.parseInt(args[0]));
} catch (Exception e) {
MessageManager.sendMessage(p, MessageType.CLEAR_FIXED_INVALID_ARGS);
return;
}
ArrayList<FixedParticleEffect> fixedEffectsToRemove = new ArrayList<FixedParticleEffect>();
for (FixedParticleEffect fixedEffect : ParticleManager.fixedParticleEffects)
if (fixedEffect.getLocation().getWorld() == p.getLocation().getWorld() && fixedEffect.getLocation().distance(p.getLocation()) <= radius) fixedEffectsToRemove.add(fixedEffect);
for (FixedParticleEffect fixedEffect : fixedEffectsToRemove)
ConfigManager.getInstance().removeFixedEffect(fixedEffect.getOwnerUniqueId(), fixedEffect.getId());
String clearMessage = MessageType.CLEAR_FIXED_SUCCESS.getMessage() // @formatter:off
.replaceAll("\\{0\\}", fixedEffectsToRemove.size() + "")
.replaceAll("\\{1\\}", radius + ""); // @formatter:on
MessageManager.sendCustomMessage(p, clearMessage);
return;
} else {
MessageManager.sendMessage(p, MessageType.INVALID_FIXED_COMMAND);
MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_CREATE);
MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_REMOVE);
MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_LIST);
MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_INFO);
if (p.hasPermission("playerparticles.fixed.clear")) MessageManager.sendMessage(p, MessageType.FIXED_COMMAND_DESC_CLEAR);
}
}

View file

@ -7,24 +7,10 @@
*/
/*
v4.3 Changelog
* Fix effects and styles not defaulting to 'none' if the player no longer has permission
* Fix errors printing to console resulting from offline players trying to spawn particles
* Fix arrow style particles staying after an arrow is considered dead (in rare cases this occurred)
* Fix SQL queries getting logged to console when database-enable is set to true
* Fix tab completion, it stopped working at one point and I didn't notice until now
* Fix style 'arrows' not working with tipped/spectral arrows
* Added fixed particle effects, see how to use them on the main plugin page
* Requires permission playerparticles.fixed or playerparticles.*
* Infinite fixed effects with permission playerparticles.fixed.unlimited (playerparticles.* does not grant this permission)
* Added new style 'thick'
TODO:
+ Add player variable in commands
Requires permission playerparticles.altexecute
TODO: v4.4
+ Add new style 'tornado'
+ Add new style 'atom'
+ GUI for styles and effects
+ GUI for styles and effects - Requires no additional permissions
/pp gui - Shows GUI that tells you your current effect, style, and data and lets you choose new ones
/pp gui effect - Shows GUI that lets you select a new effect, also shows your current one
/pp gui style - Shows GUI that lets you select a new style, also shows your current one

View file

@ -1,17 +0,0 @@
/**
* Copyright Esophose 2017
* 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.gui;
public class GUIHandler {
public GUIHandler() {
// TODO Auto-generated constructor stub
}
}

View file

@ -89,7 +89,6 @@ public enum ParticleEffect {
SNOW_SHOVEL("snowshovel", 32, -1, ParticleProperty.DIRECTIONAL),
SLIME("slime", 33, -1),
HEART("heart", 34, -1),
// RAINBOW("rainbow", 30, -1),
BARRIER("barrier", 35, 8),
ITEM_CRACK("iconcrack", 36, -1, ParticleProperty.DIRECTIONAL, ParticleProperty.REQUIRES_DATA),
BLOCK_CRACK("blockcrack", 37, -1, ParticleProperty.REQUIRES_DATA),

View file

@ -55,6 +55,7 @@ public class MessageManager {
FIXED_COMMAND_DESC_REMOVE("message-fixed-command-desc-remove"),
FIXED_COMMAND_DESC_LIST("message-fixed-command-desc-list"),
FIXED_COMMAND_DESC_INFO("message-fixed-command-desc-info"),
FIXED_COMMAND_DESC_CLEAR("message-fixed-command-desc-clear"),
CREATE_FIXED_MISSING_ARGS("message-create-fixed-missing-args"),
CREATE_FIXED_INVALID_COORDS("message-create-fixed-invalid-coords"),
CREATE_FIXED_OUT_OF_RANGE("message-create-fixed-out-of-range"),
@ -75,6 +76,10 @@ public class MessageManager {
INFO_FIXED_NO_ARGS("message-info-fixed-no-args"),
INFO_FIXED_INVALID_ARGS("message-info-fixed-invalid-args"),
INFO_FIXED_INFO("message-info-fixed-info"),
CLEAR_FIXED_NO_PERMISSION("message-clear-no-permission"),
CLEAR_FIXED_NO_ARGS("message-clear-no-args"),
CLEAR_FIXED_INVALID_ARGS("message-clear-invalid-args"),
CLEAR_FIXED_SUCCESS("message-clear-success"),
NO_PERMISSION_FIXED("message-no-permission-fixed"),
MAX_FIXED_EFFECTS_REACHED("message-max-fixed-effects-reached"),
INVALID_FIXED_COMMAND("message-invalid-fixed-command"),

View file

@ -84,8 +84,8 @@ public class PermissionManager {
* @param player The player to check the permission for
* @return True if the player has permission
*/
public static boolean canExecuteForOthers(Player player) {
return player.hasPermission("playerparticles.*") || player.hasPermission("playerparticles.altexecute");
public static boolean canUseForceReset(Player player) {
return player.hasPermission("playerparticles.*") || player.hasPermission("playerparticles.forcereset");
}
/**

View file

@ -17,6 +17,7 @@ import com.esophose.playerparticles.styles.api.ParticleStyle;
public class ParticleStyleArrows implements ParticleStyle, Listener {
private String[] arrowEntityNames = new String[] { "ARROW", "SPECTRAL_ARROW", "TIPPED_ARROW" };
private List<Arrow> arrows = new ArrayList<Arrow>();
public PParticle[] getParticles(PPlayer pplayer, Location location) {
@ -57,8 +58,17 @@ public class ParticleStyleArrows implements ParticleStyle, Listener {
*/
@EventHandler
public void onArrowFired(EntityShootBowEvent e) {
if (e.getEntityType() == EntityType.PLAYER && (e.getProjectile().getType() == EntityType.ARROW) || e.getProjectile().getType() == EntityType.SPECTRAL_ARROW || e.getProjectile().getType() == EntityType.TIPPED_ARROW) {
arrows.add((Arrow) e.getProjectile());
if (e.getEntityType() == EntityType.PLAYER) {
String entityName = e.getProjectile().getType().toString();
boolean match = false;
for (String name : arrowEntityNames) {
if (entityName.equalsIgnoreCase(name)) {
match = true;
break;
}
}
if (match) arrows.add((Arrow) e.getProjectile());
}
}

View file

@ -309,6 +309,27 @@ message-info-fixed-invalid-args: '&cUnable to get info, the id specified must be
# Default: '&eID: &b{0} &eWorld: &b{1} &eX: &b{2} &eY: &b{3} &eZ: &b{4} &eEffect: &b{5} &eStyle: &b{6} &eData: &b{7}'
message-info-fixed-info: '&eID: &b{0} &eWorld: &b{1} &eX: &b{2} &eY: &b{3} &eZ: &b{4} &eEffect: &b{5} &eStyle: &b{6} &eData: &b{7}'
# -- Clear -- #
# No Permission Clear
# Default: '&cYou do not have permission to clear fixed effects of other players!'
message-clear-no-permission: '&cYou do not have permission to clear fixed effects of other players!'
# No Arguments Clear
# Default: '&cYou did not provide a radius to clear fixed effects for!'
message-clear-no-args: '&cYou did not provide a radius to clear fixed effects for!'
# Invalid Arguments Clear
# Default: '&cThe radius you provided is invalid. Make sure it is a positive whole number!'
message-clear-invalid-args: '&cThe radius you provided is invalid. Make sure it is a positive whole number!'
# Successfully Cleared
# Key:
# {0} = Number of effects cleared
# {1} = The provided radius
# Default: '&aCleared &b{0} &afixed effects within &b{1} &ablocks of your location!'
message-clear-success: '&aCleared &b{0} &afixed effects within &b{1} &ablocks of your location!'
# -- Other -- #
# No Permission Fixed
@ -341,6 +362,10 @@ message-fixed-command-desc-list: '&e/pp fixed list - Lists all ids of your fixed
# Default: '&e/pp fixed info <id> - Gets info on one of your fixed effects'
message-fixed-command-desc-info: '&e/pp fixed info <id> - Gets info on one of your fixed effects'
# Fixed Command Description For Clear
# Default: '&e/pp fixed clear <radius> - Clears all fixed effects of all players within the given radius'
message-fixed-command-desc-clear: '&e/pp fixed clear <radius> - Clears all fixed effects of all players within the given radius'
# ------------- #
# Other #
# ------------- #