use of org.spongepowered.api.util.Transform in project SpongeCommon by SpongePowered.
the class SpongeEntitySnapshotBuilder method from.
public SpongeEntitySnapshotBuilder from(final net.minecraft.world.entity.Entity minecraftEntity) {
this.entityType = ((Entity) minecraftEntity).type();
this.worldKey = ((Entity) minecraftEntity).serverLocation().worldKey();
this.uniqueId = minecraftEntity.getUUID();
final Transform transform = ((Entity) minecraftEntity).transform();
this.position = transform.position();
this.rotation = transform.rotation();
this.scale = transform.scale();
this.manipulator = DataManipulator.mutableOf((Entity) minecraftEntity);
this.compound = new CompoundTag();
minecraftEntity.saveWithoutId(this.compound);
return this;
}
Aggregations