auracore/src/main/java/dev/tilera/auracore/network/NodeZapPacket.java
Timo Ley aca1f55d3e
All checks were successful
continuous-integration/drone/tag Build is passing
Initial release
2022-11-19 12:16:58 +01:00

40 lines
906 B
Java

package dev.tilera.auracore.network;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
public class NodeZapPacket implements IMessage {
public double x;
public double y;
public double z;
public int entityID;
public NodeZapPacket() {}
public NodeZapPacket(double x, double y, double z, Entity target) {
this.x = x;
this.y = y;
this.z = z;
this.entityID = target.getEntityId();
}
@Override
public void fromBytes(ByteBuf buf) {
this.x = buf.readDouble();
this.y = buf.readDouble();
this.z = buf.readDouble();
this.entityID = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeDouble(x);
buf.writeDouble(y);
buf.writeDouble(z);
buf.writeInt(entityID);
}
}