From 19fbcef99a3842505cdefd99bd7f39923e415ddd Mon Sep 17 00:00:00 2001 From: Librazy Date: Sun, 9 Dec 2018 04:27:49 +0800 Subject: [PATCH] [release] more options for PowerParticle, bugfix --- src/main/java/think/rpgitems/power/Utils.java | 2 ++ .../rpgitems/power/impl/PowerParticle.java | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/think/rpgitems/power/Utils.java b/src/main/java/think/rpgitems/power/Utils.java index 55dbe78a..08e99848 100644 --- a/src/main/java/think/rpgitems/power/Utils.java +++ b/src/main/java/think/rpgitems/power/Utils.java @@ -170,6 +170,8 @@ private static boolean checkAndSetCooldown(Power power, Player player, long cool if (showWarn) { if (showPower || !power.displayName().equals(power.getLocalizedName(RPGItems.plugin.cfg.language))) { player.sendMessage(I18n.format("message.cooldown.power", ((double) (cooldown - nowTick)) / 20d, power.displayName())); + } else { + player.sendMessage(I18n.format("message.cooldown.general", ((double) (cooldown - nowTick)) / 20d)); } } return false; diff --git a/src/main/java/think/rpgitems/power/impl/PowerParticle.java b/src/main/java/think/rpgitems/power/impl/PowerParticle.java index 5789c8a0..763742bd 100644 --- a/src/main/java/think/rpgitems/power/impl/PowerParticle.java +++ b/src/main/java/think/rpgitems/power/impl/PowerParticle.java @@ -54,6 +54,21 @@ public class PowerParticle extends BasePower implements PowerRightClick, PowerLe @Property public int particleCount = 1; + @Property + public double offsetX = 0; + + @Property + public double offsetY = 0; + + @Property + public double offsetZ = 0; + + @Property + public double extra = 1; + + @Property + public boolean force = false; + private Object data = null; @Override @@ -79,7 +94,7 @@ void spawnParticle(Player player) { player.getWorld().playEffect(player.getLocation(), effect, 0); } } else { - player.getWorld().spawnParticle(particle, player.getLocation(), particleCount, getData()); + player.getWorld().spawnParticle(particle, player.getLocation(), particleCount, offsetX, offsetY, offsetZ, extra, getData(), force); } }