From c493011ad64bddf193a989850d80d05233601a23 Mon Sep 17 00:00:00 2001 From: Esophose Date: Sat, 1 Dec 2018 19:34:01 -0700 Subject: [PATCH] v6.0 Update Finished --- changelog.txt | 1 + pom.xml | 10 +- .../playerparticles/PlayerParticles.java | 8 +- .../command/FixedCommandModule.java | 3 + .../command/ParticleCommandHandler.java | 8 +- .../playerparticles/manager/DataManager.java | 4 +- .../playerparticles/manager/LangManager.java | 5 +- .../manager/ParticleManager.java | 2 +- .../playerparticles/styles/DefaultStyles.java | 3 - .../styles/ParticleStyleArrows.java | 4 + .../styles/ParticleStyleBatman.java | 4 + .../styles/ParticleStyleBeam.java | 4 + .../styles/ParticleStyleBlockBreak.java | 4 + .../styles/ParticleStyleBlockEdit.java | 67 ----------- .../styles/ParticleStyleBlockPlace.java | 4 + .../styles/ParticleStyleCelebration.java | 107 ++++++++++-------- .../styles/ParticleStyleChains.java | 4 + .../styles/ParticleStyleCompanion.java | 4 + .../styles/ParticleStyleCube.java | 4 + .../styles/ParticleStyleFeet.java | 4 + .../styles/ParticleStyleHalo.java | 4 + .../styles/ParticleStyleHurt.java | 4 + .../styles/ParticleStyleInvocation.java | 4 + .../styles/ParticleStyleMove.java | 4 + .../styles/ParticleStyleNormal.java | 4 + .../styles/ParticleStyleOrbit.java | 4 + .../styles/ParticleStyleOverhead.java | 4 + .../styles/ParticleStylePoint.java | 4 + .../styles/ParticleStyleQuadhelix.java | 4 + .../styles/ParticleStyleRings.java | 4 + .../styles/ParticleStyleSphere.java | 4 + .../styles/ParticleStyleSpin.java | 4 + .../styles/ParticleStyleSpiral.java | 4 + .../styles/ParticleStyleSwords.java | 4 + .../styles/ParticleStyleThick.java | 4 + .../styles/ParticleStyleVortex.java | 4 + .../styles/ParticleStyleWings.java | 4 + .../styles/api/ParticleStyle.java | 7 ++ src/config.yml | 2 - 39 files changed, 192 insertions(+), 139 deletions(-) delete mode 100644 src/com/esophose/playerparticles/styles/ParticleStyleBlockEdit.java diff --git a/changelog.txt b/changelog.txt index 0d15506..de0f706 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ === v6.0 === * Many other changes, the changelog will be updated once the plugin update is about to be released + Added setting in config.yml to control how fast the rainbow hue cycles +- Removed style 'blockedit', apply 'blockplace' and 'blockbreak' at the same time to recreate it === v5.2 === * Added native support for Minecraft 1.13.x * Still compatible with Minecraft 1.9 through Minecraft 1.12! diff --git a/pom.xml b/pom.xml index b76fed9..ec1fb01 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ - C:\Users\Esophose\Desktop\Spigot Dev Servers\1.13\plugins\update\PlayerParticles v6.0.jar + C:\Users\Esophose\Desktop\Spigot Dev Servers\1.13\plugins\update\PlayerParticles v${project.version}.jar @@ -81,7 +81,7 @@ - C:\Users\Esophose\Desktop\Spigot Dev Servers\1.12\plugins\update\PlayerParticles v6.0.jar + C:\Users\Esophose\Desktop\Spigot Dev Servers\1.12\plugins\update\PlayerParticles v${project.version}.jar @@ -108,7 +108,7 @@ - C:\Users\Esophose\Desktop\Spigot Dev Servers\1.11\plugins\update\PlayerParticles v6.0.jar + C:\Users\Esophose\Desktop\Spigot Dev Servers\1.11\plugins\update\PlayerParticles v${project.version}.jar @@ -135,7 +135,7 @@ - C:\Users\Esophose\Desktop\Spigot Dev Servers\1.10\plugins\update\PlayerParticles v6.0.jar + C:\Users\Esophose\Desktop\Spigot Dev Servers\1.10\plugins\update\PlayerParticles v${project.version}.jar @@ -162,7 +162,7 @@ - C:\Users\Esophose\Desktop\Spigot Dev Servers\1.9\plugins\update\PlayerParticles v6.0.jar + C:\Users\Esophose\Desktop\Spigot Dev Servers\1.9\plugins\update\PlayerParticles v${project.version}.jar diff --git a/src/com/esophose/playerparticles/PlayerParticles.java b/src/com/esophose/playerparticles/PlayerParticles.java index b43ad56..c6177a0 100644 --- a/src/com/esophose/playerparticles/PlayerParticles.java +++ b/src/com/esophose/playerparticles/PlayerParticles.java @@ -1,13 +1,9 @@ /* - * TODO: v6.0 + * TODO: v6.1 + * * Write a class called ConfigManager which manages updating the config.yml between versions so it doesn't have to be deleted every time * + Add new style 'tornado' * + Add new style 'doubleorbit' * + Add new style 'wings_', multiple new wing types: fairy, demon - * * Adjust style positioning around central point based on if they are being spawned for a player or fixed effect - * * Display a note in the GUI under event-based styles - * - * TODO: v6.1 - * * Write a class called ConfigManager which manages updating the config.yml between versions so it doesn't have to be deleted every time */ package com.esophose.playerparticles; diff --git a/src/com/esophose/playerparticles/command/FixedCommandModule.java b/src/com/esophose/playerparticles/command/FixedCommandModule.java index 09df1ad..043f0da 100644 --- a/src/com/esophose/playerparticles/command/FixedCommandModule.java +++ b/src/com/esophose/playerparticles/command/FixedCommandModule.java @@ -378,6 +378,9 @@ public class FixedCommandModule implements CommandModule { } else if (!PermissionManager.hasStylePermission(pplayer.getPlayer(), style)) { LangManager.sendMessage(pplayer, Lang.FIXED_EDIT_STYLE_NO_PERMISSION, style.getName()); return; + } else if (!style.canBeFixed()) { + LangManager.sendMessage(p, Lang.FIXED_EDIT_STYLE_NON_FIXABLE, style.getName()); + return; } fixedEffect.getParticlePair().setStyle(style); diff --git a/src/com/esophose/playerparticles/command/ParticleCommandHandler.java b/src/com/esophose/playerparticles/command/ParticleCommandHandler.java index 3776c1c..9e9fc9b 100644 --- a/src/com/esophose/playerparticles/command/ParticleCommandHandler.java +++ b/src/com/esophose/playerparticles/command/ParticleCommandHandler.java @@ -14,6 +14,7 @@ import com.esophose.playerparticles.manager.DataManager; import com.esophose.playerparticles.manager.LangManager; import com.esophose.playerparticles.manager.LangManager.Lang; import com.esophose.playerparticles.manager.PermissionManager; +import com.esophose.playerparticles.particles.PPlayer; public class ParticleCommandHandler implements CommandExecutor, TabCompleter { @@ -129,14 +130,17 @@ public class ParticleCommandHandler implements CommandExecutor, TabCompleter { if (!(sender instanceof Player)) return new ArrayList(); if (cmd.getName().equalsIgnoreCase("pp")) { + PPlayer pplayer = DataManager.getPPlayer(((Player) sender).getUniqueId()); + if (pplayer == null) return new ArrayList(); + if (args.length <= 1) { CommandModule commandModule = findMatchingCommand(""); // Get the default command module - return commandModule.onTabComplete(DataManager.getPPlayer(((Player) sender).getUniqueId()), args); + return commandModule.onTabComplete(pplayer, args); } else if (args.length >= 2) { CommandModule commandModule = findMatchingCommand(args[0]); String[] cmdArgs = Arrays.copyOfRange(args, 1, args.length); if (commandModule != null) { - return commandModule.onTabComplete(DataManager.getPPlayer(((Player) sender).getUniqueId()), cmdArgs); + return commandModule.onTabComplete(pplayer, cmdArgs); } } } diff --git a/src/com/esophose/playerparticles/manager/DataManager.java b/src/com/esophose/playerparticles/manager/DataManager.java index 79e0813..bff3eb7 100644 --- a/src/com/esophose/playerparticles/manager/DataManager.java +++ b/src/com/esophose/playerparticles/manager/DataManager.java @@ -209,8 +209,8 @@ public class DataManager { /** * Updates the particles_hidden setting in the database and for the PPlayer * - * @param playerUUID - * @param particlesHidden + * @param playerUUID The player to hide PlayerParticles from + * @param particlesHidden True if the particles should be hidden, otherwise False */ public static void updateSettingParticlesHidden(UUID playerUUID, boolean particlesHidden) { async(() -> { diff --git a/src/com/esophose/playerparticles/manager/LangManager.java b/src/com/esophose/playerparticles/manager/LangManager.java index 1d02cb1..a9ab026 100644 --- a/src/com/esophose/playerparticles/manager/LangManager.java +++ b/src/com/esophose/playerparticles/manager/LangManager.java @@ -437,7 +437,6 @@ public class LangManager { * * @param player The player to send the message to * @param message The message to send to the player - * @param includePrefix If the prefix should be included */ public static void sendCustomMessage(Player player, String message) { if (!PSetting.MESSAGES_ENABLED.getBoolean()) return; @@ -465,7 +464,7 @@ public class LangManager { /** * Sends a message to a Player without the prefix * - * @param player The plaeyr to send the message to + * @param player The player to send the message to * @param messageType The message type to send the player * @param replacements The replacements for the message */ @@ -484,7 +483,7 @@ public class LangManager { /** * Sends a message to a PPlayer without the prefix * - * @param player The plaeyr to send the message to + * @param pplayer The player to send the message to * @param messageType The message type to send the player * @param replacements The replacements for the message */ diff --git a/src/com/esophose/playerparticles/manager/ParticleManager.java b/src/com/esophose/playerparticles/manager/ParticleManager.java index db18fd4..1717c18 100644 --- a/src/com/esophose/playerparticles/manager/ParticleManager.java +++ b/src/com/esophose/playerparticles/manager/ParticleManager.java @@ -155,7 +155,7 @@ public class ParticleManager extends BukkitRunnable implements Listener { */ private void displayFixedParticleEffect(FixedParticleEffect fixedEffect) { ParticlePair particle = fixedEffect.getParticlePair(); - for (PParticle pparticle : particle.getStyle().getParticles(particle, fixedEffect.getLocation())) + for (PParticle pparticle : particle.getStyle().getParticles(particle, fixedEffect.getLocation().clone().add(0, particle.getStyle().getFixedEffectOffset(), 0))) ParticleEffect.display(particle, pparticle, true); } diff --git a/src/com/esophose/playerparticles/styles/DefaultStyles.java b/src/com/esophose/playerparticles/styles/DefaultStyles.java index 4e89002..9661361 100644 --- a/src/com/esophose/playerparticles/styles/DefaultStyles.java +++ b/src/com/esophose/playerparticles/styles/DefaultStyles.java @@ -18,7 +18,6 @@ public class DefaultStyles { public static final ParticleStyle BATMAN = new ParticleStyleBatman(); public static final ParticleStyle BEAM = new ParticleStyleBeam(); public static final ParticleStyle BLOCKBREAK = new ParticleStyleBlockBreak(); - public static final ParticleStyle BLOCKEDIT = new ParticleStyleBlockEdit(); public static final ParticleStyle BLOCKPLACE = new ParticleStyleBlockPlace(); public static final ParticleStyle CELEBRATION = new ParticleStyleCelebration(); public static final ParticleStyle CHAINS = new ParticleStyleChains(); @@ -52,7 +51,6 @@ public class DefaultStyles { ParticleStyleManager.registerStyle(BATMAN); ParticleStyleManager.registerStyle(BEAM); ParticleStyleManager.registerCustomHandledStyle(BLOCKBREAK); - ParticleStyleManager.registerCustomHandledStyle(BLOCKEDIT); ParticleStyleManager.registerCustomHandledStyle(BLOCKPLACE); ParticleStyleManager.registerStyle(CELEBRATION); ParticleStyleManager.registerStyle(CHAINS); @@ -83,7 +81,6 @@ public class DefaultStyles { manager.registerEvents((Listener) ARROWS, playerParticles); manager.registerEvents((Listener) BLOCKBREAK, playerParticles); manager.registerEvents((Listener) BLOCKPLACE, playerParticles); - manager.registerEvents((Listener) BLOCKEDIT, playerParticles); manager.registerEvents((Listener) HURT, playerParticles); manager.registerEvents((Listener) MOVE, playerParticles); manager.registerEvents((Listener) SWORDS, playerParticles); diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleArrows.java b/src/com/esophose/playerparticles/styles/ParticleStyleArrows.java index 509c13c..14cd488 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleArrows.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleArrows.java @@ -59,6 +59,10 @@ public class ParticleStyleArrows implements ParticleStyle, Listener { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0; + } /** * The event used to get all arrows fired by players diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleBatman.java b/src/com/esophose/playerparticles/styles/ParticleStyleBatman.java index e6c1e60..49f1a16 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleBatman.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleBatman.java @@ -124,5 +124,9 @@ public class ParticleStyleBatman implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return -1; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleBeam.java b/src/com/esophose/playerparticles/styles/ParticleStyleBeam.java index ea265cb..a104eb8 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleBeam.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleBeam.java @@ -62,5 +62,9 @@ public class ParticleStyleBeam implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleBlockBreak.java b/src/com/esophose/playerparticles/styles/ParticleStyleBlockBreak.java index 6ec917c..02bc320 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleBlockBreak.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleBlockBreak.java @@ -45,6 +45,10 @@ public class ParticleStyleBlockBreak implements ParticleStyle, Listener { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0; + } @EventHandler(priority = EventPriority.MONITOR) public void onBlockBreak(BlockBreakEvent event) { diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleBlockEdit.java b/src/com/esophose/playerparticles/styles/ParticleStyleBlockEdit.java deleted file mode 100644 index 6dee914..0000000 --- a/src/com/esophose/playerparticles/styles/ParticleStyleBlockEdit.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.esophose.playerparticles.styles; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockPlaceEvent; - -import com.esophose.playerparticles.manager.DataManager; -import com.esophose.playerparticles.manager.ParticleManager; -import com.esophose.playerparticles.particles.PPlayer; -import com.esophose.playerparticles.particles.ParticlePair; -import com.esophose.playerparticles.styles.api.PParticle; -import com.esophose.playerparticles.styles.api.ParticleStyle; - -public class ParticleStyleBlockEdit implements ParticleStyle, Listener { - - public List getParticles(ParticlePair particle, Location location) { - return new ArrayList(); // Particles are taken from DefaultStyles.BLOCKPLACE or DefaultStyles.BLOCKBREAK - } - - public void updateTimers() { - - } - - public String getName() { - return "blockedit"; - } - - public boolean canBeFixed() { - return false; - } - - public boolean canToggleWithMovement() { - return false; - } - - @EventHandler(priority = EventPriority.MONITOR) - public void onBlockBreak(BlockBreakEvent event) { - Player player = event.getPlayer(); - PPlayer pplayer = DataManager.getPPlayer(player.getUniqueId()); - if (pplayer != null) { - for (ParticlePair particle : pplayer.getActiveParticlesForStyle(DefaultStyles.BLOCKEDIT)) { - Location loc = event.getBlock().getLocation(); - ParticleManager.displayParticles(particle, DefaultStyles.BLOCKBREAK.getParticles(particle, loc)); - } - } - } - - @EventHandler(priority = EventPriority.MONITOR) - public void onBlockPlace(BlockPlaceEvent event) { - Player player = event.getPlayer(); - PPlayer pplayer = DataManager.getPPlayer(player.getUniqueId()); - if (pplayer != null) { - for (ParticlePair particle : pplayer.getActiveParticlesForStyle(DefaultStyles.BLOCKEDIT)) { - Location loc = event.getBlock().getLocation().clone(); - ParticleManager.displayParticles(particle, DefaultStyles.BLOCKPLACE.getParticles(particle, loc)); - } - } - } - -} diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleBlockPlace.java b/src/com/esophose/playerparticles/styles/ParticleStyleBlockPlace.java index 405dc3f..4f1e05d 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleBlockPlace.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleBlockPlace.java @@ -45,6 +45,10 @@ public class ParticleStyleBlockPlace implements ParticleStyle, Listener { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0; + } @EventHandler(priority = EventPriority.MONITOR) public void onBlockPlace(BlockPlaceEvent event) { diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleCelebration.java b/src/com/esophose/playerparticles/styles/ParticleStyleCelebration.java index f9d3920..7395c0a 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleCelebration.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleCelebration.java @@ -11,6 +11,7 @@ import org.bukkit.scheduler.BukkitRunnable; import com.esophose.playerparticles.PlayerParticles; import com.esophose.playerparticles.manager.ParticleManager; +import com.esophose.playerparticles.particles.FixedParticleEffect; import com.esophose.playerparticles.particles.PPlayer; import com.esophose.playerparticles.particles.ParticleEffect; import com.esophose.playerparticles.particles.ParticlePair; @@ -35,59 +36,65 @@ public class ParticleStyleCelebration implements ParticleStyle { if (step == spawnTime) { step = 0; - final Random random = new Random(); + Random random = new Random(); for (PPlayer pplayer : ParticleManager.getPPlayers()) { - final Player player = pplayer.getPlayer(); + Player player = pplayer.getPlayer(); - for (ParticlePair particle : pplayer.getActiveParticles()) { - if (particle.getStyle() != this) continue; - - double angle = random.nextDouble() * Math.PI * 2; - double distanceFrom = 1.25 + random.nextDouble() * 1.5; - double dx = Math.sin(angle) * distanceFrom; - double dz = Math.cos(angle) * distanceFrom; - final Location loc = player.getLocation().clone().add(dx, 1, dz); - final int fuse = 3 + random.nextInt(3); - - new BukkitRunnable() { - private Location location = loc; - private int fuseLength = fuse; - private int fuseTimer = 0; - - public void run() { - if (this.fuseTimer < this.fuseLength) { - ParticlePair trail = ParticlePair.getNextDefault(pplayer); - trail.setEffect(ParticleEffect.FIREWORK); - trail.setStyle(DefaultStyles.CELEBRATION); - - ParticleManager.displayParticles(trail, Collections.singletonList(new PParticle(this.location))); - - this.location.add(0, 0.25, 0); - } else { - List particles = new ArrayList(); - for (int i = 0; i < 40; i++) { - double radius = 0.6 + random.nextDouble() * 0.2; - double u = random.nextDouble(); - double v = random.nextDouble(); - double theta = 2 * Math.PI * u; - double phi = Math.acos(2 * v - 1); - double dx = radius * Math.sin(phi) * Math.cos(theta); - double dy = radius * Math.sin(phi) * Math.sin(theta); - double dz = radius * Math.cos(phi); - - particles.add(new PParticle(this.location.clone().add(dx, dy, dz))); - } - ParticleManager.displayParticles(particle, particles); - - this.cancel(); - } - this.fuseTimer++; - } - }.runTaskTimer(PlayerParticles.getPlugin(), 0, 1); - } + for (ParticlePair particle : pplayer.getActiveParticles()) + if (particle.getStyle() == this) + spawnFirework(player.getLocation(), pplayer, particle, random); + + for (FixedParticleEffect fixedEffect : pplayer.getFixedParticles()) + if (fixedEffect.getParticlePair().getStyle() == this) + spawnFirework(fixedEffect.getLocation(), pplayer, fixedEffect.getParticlePair(), random); } } } + + private void spawnFirework(final Location location, final PPlayer pplayer, final ParticlePair particle, final Random random) { + double angle = random.nextDouble() * Math.PI * 2; + double distanceFrom = 1.25 + random.nextDouble() * 1.5; + double dx = Math.sin(angle) * distanceFrom; + double dz = Math.cos(angle) * distanceFrom; + final Location loc = location.clone().add(dx, 1, dz); + final int fuse = 3 + random.nextInt(3); + + new BukkitRunnable() { + private Location location = loc; + private int fuseLength = fuse; + private int fuseTimer = 0; + + public void run() { + if (this.fuseTimer < this.fuseLength) { + ParticlePair trail = ParticlePair.getNextDefault(pplayer); + trail.setEffect(ParticleEffect.FIREWORK); + trail.setStyle(DefaultStyles.CELEBRATION); + + ParticleManager.displayParticles(trail, Collections.singletonList(new PParticle(this.location))); + + this.location.add(0, 0.25, 0); + } else { + List particles = new ArrayList(); + for (int i = 0; i < 40; i++) { + double radius = 0.6 + random.nextDouble() * 0.2; + double u = random.nextDouble(); + double v = random.nextDouble(); + double theta = 2 * Math.PI * u; + double phi = Math.acos(2 * v - 1); + double dx = radius * Math.sin(phi) * Math.cos(theta); + double dy = radius * Math.sin(phi) * Math.sin(theta); + double dz = radius * Math.cos(phi); + + particles.add(new PParticle(this.location.clone().add(dx, dy, dz))); + } + ParticleManager.displayParticles(particle, particles); + + this.cancel(); + } + this.fuseTimer++; + } + }.runTaskTimer(PlayerParticles.getPlugin(), 0, 1); + } public String getName() { return "celebration"; @@ -100,5 +107,9 @@ public class ParticleStyleCelebration implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleChains.java b/src/com/esophose/playerparticles/styles/ParticleStyleChains.java index f8994f7..6744a3f 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleChains.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleChains.java @@ -39,5 +39,9 @@ public class ParticleStyleChains implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleCompanion.java b/src/com/esophose/playerparticles/styles/ParticleStyleCompanion.java index c83abce..0a01604 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleCompanion.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleCompanion.java @@ -77,5 +77,9 @@ public class ParticleStyleCompanion implements ParticleStyle { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 1; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleCube.java b/src/com/esophose/playerparticles/styles/ParticleStyleCube.java index 68986f3..e0627b8 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleCube.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleCube.java @@ -102,5 +102,9 @@ public class ParticleStyleCube implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleFeet.java b/src/com/esophose/playerparticles/styles/ParticleStyleFeet.java index 00918af..bd36fd2 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleFeet.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleFeet.java @@ -32,5 +32,9 @@ public class ParticleStyleFeet implements ParticleStyle { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleHalo.java b/src/com/esophose/playerparticles/styles/ParticleStyleHalo.java index ae34449..4542437 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleHalo.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleHalo.java @@ -60,5 +60,9 @@ public class ParticleStyleHalo implements ParticleStyle { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return -0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleHurt.java b/src/com/esophose/playerparticles/styles/ParticleStyleHurt.java index 4c250f4..a86f526 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleHurt.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleHurt.java @@ -46,6 +46,10 @@ public class ParticleStyleHurt implements ParticleStyle, Listener { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0; + } @EventHandler(priority = EventPriority.MONITOR) public void onEntityDamage(EntityDamageEvent event) { diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleInvocation.java b/src/com/esophose/playerparticles/styles/ParticleStyleInvocation.java index d77025c..08992c7 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleInvocation.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleInvocation.java @@ -102,5 +102,9 @@ public class ParticleStyleInvocation implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleMove.java b/src/com/esophose/playerparticles/styles/ParticleStyleMove.java index aeb2125..2836a30 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleMove.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleMove.java @@ -36,6 +36,10 @@ public class ParticleStyleMove implements ParticleStyle, Listener { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0; + } @EventHandler(priority = EventPriority.MONITOR) public void onPlayerMove(PlayerMoveEvent e) { diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleNormal.java b/src/com/esophose/playerparticles/styles/ParticleStyleNormal.java index 24a840b..132d540 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleNormal.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleNormal.java @@ -142,5 +142,9 @@ public class ParticleStyleNormal implements ParticleStyle { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleOrbit.java b/src/com/esophose/playerparticles/styles/ParticleStyleOrbit.java index 75287a5..f45ba8f 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleOrbit.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleOrbit.java @@ -56,5 +56,9 @@ public class ParticleStyleOrbit implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleOverhead.java b/src/com/esophose/playerparticles/styles/ParticleStyleOverhead.java index ff42608..fd35d71 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleOverhead.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleOverhead.java @@ -33,5 +33,9 @@ public class ParticleStyleOverhead implements ParticleStyle { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return -0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStylePoint.java b/src/com/esophose/playerparticles/styles/ParticleStylePoint.java index 709c7a8..3eadabf 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStylePoint.java +++ b/src/com/esophose/playerparticles/styles/ParticleStylePoint.java @@ -30,5 +30,9 @@ public class ParticleStylePoint implements ParticleStyle { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return -0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleQuadhelix.java b/src/com/esophose/playerparticles/styles/ParticleStyleQuadhelix.java index 2769b05..f95b2bf 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleQuadhelix.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleQuadhelix.java @@ -68,5 +68,9 @@ public class ParticleStyleQuadhelix implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleRings.java b/src/com/esophose/playerparticles/styles/ParticleStyleRings.java index f3c8493..f68d08d 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleRings.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleRings.java @@ -62,5 +62,9 @@ public class ParticleStyleRings implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleSphere.java b/src/com/esophose/playerparticles/styles/ParticleStyleSphere.java index e275def..3d47ad5 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleSphere.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleSphere.java @@ -45,5 +45,9 @@ public class ParticleStyleSphere implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleSpin.java b/src/com/esophose/playerparticles/styles/ParticleStyleSpin.java index b6c8396..b9ff5f2 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleSpin.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleSpin.java @@ -50,5 +50,9 @@ public class ParticleStyleSpin implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return -0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleSpiral.java b/src/com/esophose/playerparticles/styles/ParticleStyleSpiral.java index eef8733..8299309 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleSpiral.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleSpiral.java @@ -39,5 +39,9 @@ public class ParticleStyleSpiral implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleSwords.java b/src/com/esophose/playerparticles/styles/ParticleStyleSwords.java index 53da8e0..c7da41e 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleSwords.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleSwords.java @@ -55,6 +55,10 @@ public class ParticleStyleSwords implements ParticleStyle, Listener { public boolean canToggleWithMovement() { return false; } + + public double getFixedEffectOffset() { + return 0; + } @EventHandler(priority = EventPriority.MONITOR) public void onEntityDamageEntity(EntityDamageByEntityEvent event) { diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleThick.java b/src/com/esophose/playerparticles/styles/ParticleStyleThick.java index 814c87f..2738488 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleThick.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleThick.java @@ -38,5 +38,9 @@ public class ParticleStyleThick implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleVortex.java b/src/com/esophose/playerparticles/styles/ParticleStyleVortex.java index ca83486..1d3eaaf 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleVortex.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleVortex.java @@ -70,5 +70,9 @@ public class ParticleStyleVortex implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0.5; + } } diff --git a/src/com/esophose/playerparticles/styles/ParticleStyleWings.java b/src/com/esophose/playerparticles/styles/ParticleStyleWings.java index 887a8f2..cacf741 100644 --- a/src/com/esophose/playerparticles/styles/ParticleStyleWings.java +++ b/src/com/esophose/playerparticles/styles/ParticleStyleWings.java @@ -44,5 +44,9 @@ public class ParticleStyleWings implements ParticleStyle { public boolean canToggleWithMovement() { return true; } + + public double getFixedEffectOffset() { + return 0; + } } diff --git a/src/com/esophose/playerparticles/styles/api/ParticleStyle.java b/src/com/esophose/playerparticles/styles/api/ParticleStyle.java index 8261aea..8bbbef2 100644 --- a/src/com/esophose/playerparticles/styles/api/ParticleStyle.java +++ b/src/com/esophose/playerparticles/styles/api/ParticleStyle.java @@ -43,6 +43,13 @@ public interface ParticleStyle { */ public boolean canToggleWithMovement(); + /** + * The Y-axis offset to be applied when using '/pp fixed create looking' + * + * @return How far to move the style up or down to get it centered on the block properly + */ + public double getFixedEffectOffset(); + /** * Gets the ParticleStyle with the name given, returns null if not found * diff --git a/src/config.yml b/src/config.yml index a9a4c09..2e32b79 100644 --- a/src/config.yml +++ b/src/config.yml @@ -300,8 +300,6 @@ gui-icon: - POWERED_RAIL blockbreak: - IRON_PICKAXE - blockedit: - - DISPENSER blockplace: - OAK_PLANKS - WOOD