effect cleanup

This commit is contained in:
Sen 2025-07-09 19:41:37 +02:00
parent 319e27870f
commit 936154e5ce
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
35 changed files with 1182 additions and 1741 deletions

View file

@ -27,7 +27,7 @@ public class CommandEffect extends Command {
public void exec(CommandEnvironment env, Executor exec, List<Player> players, ParticleType type, Vec3 pos, Vec3 offset, double speed, int count) {
offset = offset == null ? new Vec3(0.0, 0.0, 0.0) : offset;
for(Player player : players) {
player.sendPacket(new SPacketParticles(type, true, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, (float)offset.xCoord, (float)offset.yCoord, (float)offset.zCoord, (float)speed, count, 0));
player.sendPacket(new SPacketParticles(type, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, (float)offset.xCoord, (float)offset.yCoord, (float)offset.zCoord, (float)speed, count, 0));
}
}
}

View file

@ -1287,15 +1287,9 @@ public final class WorldServer extends AWorldServer {
// this.resetWeather = false;
}
public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset,
double yOffset, double zOffset, double particleSpeed, int data) {
this.spawnParticle(particleType, false, xCoord, yCoord, zCoord, numberOfParticles, xOffset, yOffset, zOffset, particleSpeed,
data);
}
public void spawnParticle(ParticleType particleType, boolean longDistance, double xCoord, double yCoord, double zCoord,
public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord,
int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int data) {
Packet packet = new SPacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset,
Packet packet = new SPacketParticles(particleType, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset,
(float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, data);
for(int i = 0; i < this.players.size(); ++i) {
@ -1303,7 +1297,7 @@ public final class WorldServer extends AWorldServer {
BlockPos blockpos = entityplayermp.getPosition();
double d0 = blockpos.distanceSq(xCoord, yCoord, zCoord);
if(d0 <= 256.0D || longDistance && d0 <= 65536.0D) {
if(d0 <= 256.0D || particleType.isUnlimited() && d0 <= 65536.0D) {
entityplayermp.connection.sendPacket(packet);
}
}
@ -1695,11 +1689,11 @@ public final class WorldServer extends AWorldServer {
}
for(EntityNPC player : this.players) {
player.attackEntityFrom(DamageSource.causeExterminatusDamage(null), 5000);
Packet packet = new SPacketParticles(ParticleType.EXPLOSION_HUGE, true,
Packet packet = new SPacketParticles(ParticleType.EXPLOSION_HUGE,
(float)player.posX, (float)this.getSeaLevel() + 4.0f, (float)player.posZ, (float)128.0,
(float)2.0, (float)128.0, (float)0.15, 1000, 0);
player.connection.sendPacket(packet);
packet = new SPacketParticles(ParticleType.EXPLOSION_NORMAL, true,
packet = new SPacketParticles(ParticleType.EXPLOSION_NORMAL,
(float)player.posX, (float)this.getSeaLevel() + 4.0f, (float)player.posZ, (float)128.0,
(float)2.0, (float)128.0, (float)0.15, 1000, 0);
player.connection.sendPacket(packet);