use of io.xol.chunkstories.api.entity.interfaces.EntityWithVelocity in project chunkstories-api by Hugobros3.
the class PacketVelocityDelta method process.
@Override
public void process(PacketSender sender, DataInputStream in, PacketReceptionContext processor) throws IOException, PacketProcessingException {
Vector3d delta = new Vector3d(in.readDouble(), in.readDouble(), in.readDouble());
EntityControllable entity = ((ClientPacketsProcessor) processor).getContext().getPlayer().getControlledEntity();
if (entity != null && entity instanceof EntityWithVelocity) {
System.out.println("Debug: received velocity delta " + delta);
((EntityWithVelocity) entity).getVelocityComponent().addVelocity(delta);
}
}
Aggregations