use of net.aufdemrand.denizen.nms.util.jnbt.DoubleTag in project Denizen-For-Bukkit by DenizenScript.
the class ImprovedOfflinePlayer method setLocation.
public void setLocation(Location location) {
World w = location.getWorld();
UUID uuid = w.getUID();
List<DoubleTag> position = new ArrayList<DoubleTag>();
position.add(new DoubleTag(location.getX()));
position.add(new DoubleTag(location.getY()));
position.add(new DoubleTag(location.getZ()));
List<FloatTag> rotation = new ArrayList<FloatTag>();
rotation.add(new FloatTag(location.getYaw()));
rotation.add(new FloatTag(location.getPitch()));
this.compound = this.compound.createBuilder().putLong("WorldUUIDMost", uuid.getMostSignificantBits()).putLong("WorldUUIDLeast", uuid.getLeastSignificantBits()).putInt("Dimension", w.getEnvironment().ordinal()).put("Pos", new ListTag(DoubleTag.class, position)).put("Rotation", new ListTag(FloatTag.class, rotation)).build();
if (this.autosave) {
savePlayerData();
}
}
use of net.aufdemrand.denizen.nms.util.jnbt.DoubleTag in project Denizen-For-Bukkit by DenizenScript.
the class ImprovedOfflinePlayer method setVelocity.
public void setVelocity(Vector vector) {
List<DoubleTag> motion = new ArrayList<DoubleTag>();
motion.add(new DoubleTag(vector.getX()));
motion.add(new DoubleTag(vector.getY()));
motion.add(new DoubleTag(vector.getZ()));
this.compound = compound.createBuilder().put("Motion", new ListTag(DoubleTag.class, motion)).build();
if (this.autosave) {
savePlayerData();
}
}