mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-16 04:11:39 +01:00
chore: point position/offset particle packet construtors
This commit is contained in:
parent
b71edf2706
commit
63f02929ed
@ -1,5 +1,6 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.coordinate.Point;
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
@ -28,6 +29,14 @@ public record ParticlePacket(int particleId, boolean longDistance, double x, dou
|
||||
this(particle.id(), false, x, y, z, offsetX, offsetY, offsetZ, maxSpeed, particleCount, particle.data());
|
||||
}
|
||||
|
||||
public ParticlePacket(@NotNull Particle particle, boolean longDistance, @NotNull Point position, @NotNull Point offset, float maxSpeed, int particleCount) {
|
||||
this(particle, longDistance, position.x(), position.y(), position.z(), (float)offset.x(), (float)offset.y(), (float)offset.z(), maxSpeed, particleCount);
|
||||
}
|
||||
|
||||
public ParticlePacket(@NotNull Particle particle, @NotNull Point position, @NotNull Point offset, float maxSpeed, int particleCount) {
|
||||
this(particle, false, position, offset, maxSpeed, particleCount);
|
||||
}
|
||||
|
||||
private static ParticlePacket readPacket(NetworkBuffer reader) {
|
||||
int particleId = reader.read(VAR_INT);
|
||||
Boolean longDistance = reader.read(BOOLEAN);
|
||||
|
Loading…
Reference in New Issue
Block a user