use of org.valkyrienskies.mod.common.ships.chunk_claims.VSChunkClaim in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class ValkyrienUtils method createNewShip.
/**
* Creates a new ShipIndexedData based on the inputs provided by the physics infuser block.
*/
public ShipData createNewShip(World world, BlockPos physInfuserPos) {
String name = NounListNameGenerator.getInstance().generateName();
UUID shipID = UUID.randomUUID();
// Create ship chunk claims
VSChunkClaim chunkClaim = ValkyrienUtils.getShipChunkAllocator(world).allocateNextChunkClaim();
Vector3dc centerOfMassInitial = VSMath.toVector3d(chunkClaim.getRegionCenter());
Vector3dc shipPosInitial = VSMath.toVector3d(physInfuserPos);
ShipTransform initial = new ShipTransform(shipPosInitial, centerOfMassInitial);
AxisAlignedBB axisAlignedBB = new AxisAlignedBB(shipPosInitial.x(), shipPosInitial.y(), shipPosInitial.z(), shipPosInitial.x(), shipPosInitial.y(), shipPosInitial.z());
return ShipData.createData(QueryableShipData.get(world).getAllShips(), name, chunkClaim, shipID, initial, axisAlignedBB);
}
Aggregations