From 23388c231a2393c9129b7c3c426c8cfcb49e5e60 Mon Sep 17 00:00:00 2001 From: Tobias de Bruijn Date: Thu, 13 May 2021 17:47:32 +0200 Subject: [PATCH] Fixed #8. /torch aoe will spawn the particles at the y height of the torch, below and above (Compared to only above normally) when in the nether --- .../HighlightAreaOfEffectExecutor.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/nl/thedutchmc/harotorch/commands/torchSubCmds/HighlightAreaOfEffectExecutor.java b/src/main/java/nl/thedutchmc/harotorch/commands/torchSubCmds/HighlightAreaOfEffectExecutor.java index b5e7c16..ac2635c 100644 --- a/src/main/java/nl/thedutchmc/harotorch/commands/torchSubCmds/HighlightAreaOfEffectExecutor.java +++ b/src/main/java/nl/thedutchmc/harotorch/commands/torchSubCmds/HighlightAreaOfEffectExecutor.java @@ -7,6 +7,7 @@ import org.bukkit.Location; import org.bukkit.Particle; import org.bukkit.World; +import org.bukkit.World.Environment; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; @@ -43,7 +44,12 @@ public static boolean aoe(CommandSender sender, HaroTorch plugin) { final int x = (int) (cx + (radius * Math.cos(rad))); final int z = (int) (cz + (radius * Math.sin(rad))); - final int y = w.getHighestBlockAt(x, z).getY() + 1; + int y; + if(w.getEnvironment() == Environment.NETHER) { + y = l.getBlockY(); + } else { + y = w.getHighestBlockAt(x, z).getY() + 1; + } blocksOnTorchRadius.add(new Location(w, x, y, z)); } @@ -71,6 +77,12 @@ public void run() { for(int i = 0; i < HaroTorch.getConfigHandler().torchAoeParticleHeight; i++) { torchLoc.getWorld().spawnParticle(Particle.REDSTONE, l.getX() + 0.5D, l.getY() + 0.5D + i, l.getZ() + 0.5D, 5, 0D, 0D, 0D, 0.005, new Particle.DustOptions(torchParticle.getTorchParticleColor(), 1)); } + + if(torchLoc.getWorld().getEnvironment() == Environment.NETHER) { + for(int i = 1; i < HaroTorch.getConfigHandler().torchAoeParticleHeight -1; i++) { + torchLoc.getWorld().spawnParticle(Particle.REDSTONE, l.getX() + 0.5D, l.getY() + 0.5D - i, l.getZ() + 0.5D, 5, 0D, 0D, 0D, 0.005, new Particle.DustOptions(torchParticle.getTorchParticleColor(), 1)); + } + } } } }