Search in sources :

Example 1 with Transform

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;
}
Also used : Entity(org.spongepowered.api.entity.Entity) Transform(org.spongepowered.api.util.Transform) CompoundTag(net.minecraft.nbt.CompoundTag)

Aggregations

CompoundTag (net.minecraft.nbt.CompoundTag)1 Entity (org.spongepowered.api.entity.Entity)1 Transform (org.spongepowered.api.util.Transform)1