Search in sources :

Example 1 with VSChunkClaim

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);
}
Also used : Vector3dc(org.joml.Vector3dc) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) VSChunkClaim(org.valkyrienskies.mod.common.ships.chunk_claims.VSChunkClaim) ShipTransform(org.valkyrienskies.mod.common.ships.ship_transform.ShipTransform) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)1 Vector3dc (org.joml.Vector3dc)1 VSChunkClaim (org.valkyrienskies.mod.common.ships.chunk_claims.VSChunkClaim)1 ShipTransform (org.valkyrienskies.mod.common.ships.ship_transform.ShipTransform)1