Skip to content

Commit

Permalink
Actually fix selection particle outline, only display for self, respe…
Browse files Browse the repository at this point in the history
…ct selection mode
  • Loading branch information
T14D3 committed Jan 17, 2025
1 parent 24715be commit 91827e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,15 @@ private void onPlayerInteract(PlayerInteractEvent event) {

plugin.selection.put(playerUUID, Pair.of(min, max));
if (min != null && max != null) {
plugin.particles.put(playerUUID, BoundingBox.of(min.toBlockLocation(), max.toBlockLocation()));
Utils.Modes mode = Utils.Modes.getPlayerMode(player);
if (mode == Utils.Modes.CUBOID_3D) {
plugin.particles.put(playerUUID, BoundingBox.of(min.toBlockLocation(), max.toBlockLocation()));
} else {
min.setY(-63);
max.setY(319);
plugin.particles.put(playerUUID, BoundingBox.of(min.toBlockLocation(), max.toBlockLocation()));
}

}
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/de/t14d3/zones/utils/ParticleHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ static void spawnParticleOutline(Particle primary, Particle secondary, Player pl
List<Location> outlineLocations = new ArrayList<>();

// Add corners to the outline
outlineLocations.add(new Location(player.getWorld(), x1, y2, z1));
outlineLocations.add(new Location(player.getWorld(), x2, y2, z1));
outlineLocations.add(new Location(player.getWorld(), x1, y1, z1));
outlineLocations.add(new Location(player.getWorld(), x2, y1, z1));
outlineLocations.add(new Location(player.getWorld(), x2, y1, z2));
outlineLocations.add(new Location(player.getWorld(), x1, y1, z2));

Expand All @@ -88,6 +88,7 @@ static void spawnParticleOutline(Particle primary, Particle secondary, Player pl
particleLocation.setY(k);
if (particleLocation.distance(player.getLocation()) < range) {
particleBuilder.location(particleLocation);
particleBuilder.receivers(player);
particleBuilder.count(1);
particleBuilder.extra(0);
particleBuilder.force(true);
Expand All @@ -102,6 +103,7 @@ static void spawnParticleOutline(Particle primary, Particle secondary, Player pl
Location particleLocation = new Location(player.getWorld(), corner.getX(), y, corner.getZ());
if (particleLocation.distance(player.getLocation()) < range) {
particleBuilder2.location(particleLocation);
particleBuilder2.receivers(player);
particleBuilder2.count(1);
particleBuilder2.extra(0);
particleBuilder2.force(true);
Expand Down

0 comments on commit 91827e2

Please sign in to comment.