cn.nukkit.entity.data.Vector3fEntityData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.entity.data;
import cn.nukkit.entity.Entity;
import cn.nukkit.math.Vector3f;
/**
* @author MagicDroidX (Nukkit Project)
*/
public class Vector3fEntityData extends EntityData {
public float x;
public float y;
public float z;
public Vector3fEntityData(int id, float x, float y, float z) {
super(id);
this.x = x;
this.y = y;
this.z = z;
}
public Vector3fEntityData(int id, Vector3f pos) {
this(id, pos.x, pos.y, pos.z);
}
@Override
public Vector3f getData() {
return new Vector3f(x, y, z);
}
@Override
public void setData(Vector3f data) {
if (data != null) {
this.x = data.x;
this.y = data.y;
this.z = data.z;
}
}
@Override
public int getType() {
return Entity.DATA_TYPE_VECTOR3F;
}
}