mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
Inline EntityDataHelper::createBaseNBT()
this is only used for saving entity data now, and its presence here is allowing plugin devs to keep abusing it.
This commit is contained in:
@@ -69,25 +69,4 @@ final class EntityDataHelper{
|
||||
}
|
||||
return new Vector3($values[0]->getValue(), $values[1]->getValue(), $values[2]->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function which creates minimal NBT needed to spawn an entity.
|
||||
*/
|
||||
public static function createBaseNBT(Vector3 $pos, ?Vector3 $motion = null, float $yaw = 0.0, float $pitch = 0.0) : CompoundTag{
|
||||
return CompoundTag::create()
|
||||
->setTag("Pos", new ListTag([
|
||||
new DoubleTag($pos->x),
|
||||
new DoubleTag($pos->y),
|
||||
new DoubleTag($pos->z)
|
||||
]))
|
||||
->setTag("Motion", new ListTag([
|
||||
new DoubleTag($motion !== null ? $motion->x : 0.0),
|
||||
new DoubleTag($motion !== null ? $motion->y : 0.0),
|
||||
new DoubleTag($motion !== null ? $motion->z : 0.0)
|
||||
]))
|
||||
->setTag("Rotation", new ListTag([
|
||||
new FloatTag($yaw),
|
||||
new FloatTag($pitch)
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user