Dieser Commit ist enthalten in:
Ursprung
dfb7e63df9
Commit
67d094a2b1
@ -19,6 +19,7 @@
|
||||
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@ -41,16 +42,6 @@ public class DustSimpleParticle implements BaseParticle {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public DustSimpleParticle(ParticleItem particleItem, Particle particle, float vx, float vy, float vz, double time, int count) {
|
||||
this.particleItem = particleItem;
|
||||
this.particle = particle;
|
||||
this.vx = vx;
|
||||
this.vy = vy;
|
||||
this.vz = vz;
|
||||
this.time = time;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleItem getItem() {
|
||||
return particleItem;
|
||||
@ -59,6 +50,11 @@ public class DustSimpleParticle implements BaseParticle {
|
||||
@Override
|
||||
public void particle(ParticleData particleData) {
|
||||
Location location = particleData.getLocation().add(0.0, 0.2, 0.0);
|
||||
particleData.getWorld().spawnParticle(particle, location, count, vx, vy, vz, time, getParticleDust());
|
||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||
int viewDistance = player.getClientViewDistance() * 16;
|
||||
if (location.distanceSquared(player.getLocation()) <= viewDistance * viewDistance) {
|
||||
player.spawnParticle(particle, location, count, vx, vy, vz, time, getParticleDust());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package de.steamwar.lobby.particle;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
|
||||
@ -67,10 +68,15 @@ public class SimpleParticle implements BaseParticle {
|
||||
@Override
|
||||
public void particle(ParticleData particleData) {
|
||||
Location location = particleData.getLocation().add(0.0, 0.2, 0.0);
|
||||
if (customVelocity) {
|
||||
particleData.getWorld().spawnParticle(particle, location, count, vx, vy, vz, time);
|
||||
} else {
|
||||
particleData.getWorld().spawnParticle(particle, location, count);
|
||||
}
|
||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||
int viewDistance = player.getClientViewDistance() * 16;
|
||||
if (location.distanceSquared(player.getLocation()) <= viewDistance * viewDistance) {
|
||||
if (customVelocity) {
|
||||
player.spawnParticle(particle, location, count, vx, vy, vz, time);
|
||||
} else {
|
||||
player.spawnParticle(particle, location, count);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren