more particle improvements

This commit is contained in:
Sen 2025-07-10 18:24:08 +02:00
parent 28d6850668
commit d95a3f8b11
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
58 changed files with 266 additions and 444 deletions

View file

@ -18,16 +18,11 @@ public class CommandEffect extends Command {
this.addPlayerList("player", false, UserPolicy.NON_ADMINS_OR_SELF);
this.addEnum("particle", ParticleType.class, ParticleType.values());
this.addVector("position", true, false);
this.setParamsOptional();
this.addVector("offset", false, false);
this.addDouble("speed", 0.0f, 100.0f, 0.0f);
this.addInt("count", 0, 1000, 0);
}
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;
public void exec(CommandEnvironment env, Executor exec, List<Player> players, ParticleType type, Vec3 pos) {
for(Player player : players) {
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));
player.sendPacket(new SPacketParticles(type, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, 0));
}
}
}

View file

@ -1287,10 +1287,8 @@ 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) {
Packet packet = new SPacketParticles(particleType, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset,
(float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, data);
public void spawnParticles(ParticleType particleType, double xCoord, double yCoord, double zCoord, int data) {
Packet packet = new SPacketParticles(particleType, (float)xCoord, (float)yCoord, (float)zCoord, data);
for(int i = 0; i < this.players.size(); ++i) {
EntityNPC entityplayermp = this.players.get(i);
@ -1689,15 +1687,7 @@ public final class WorldServer extends AWorldServer {
}
for(EntityNPC player : this.players) {
player.attackEntityFrom(DamageSource.causeExterminatusDamage(null), 5000);
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,
(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 SPacketEffect(1025, new BlockPos(player.posX, (double)this.getSeaLevel() + 4.0, player.posZ), 0);
Packet packet = new SPacketEffect(1025, new BlockPos(player.posX, (double)this.getSeaLevel() + 4.0, player.posZ), 0);
player.connection.sendPacket(packet);
}
return true;