Search in sources :

Example 16 with Rotation

use of net.minecraft.world.level.block.Rotation in project SolarCraftRepository by FINDERFEED.

the class MagicianTowerStructure method generatePieces.

private static void generatePieces(StructurePiecesBuilder p_197089_, PieceGenerator.Context<NoneFeatureConfiguration> ctx) {
    int x = (ctx.chunkPos().x << 4) + 7;
    int z = (ctx.chunkPos().z << 4) + 7;
    int surfaceY = ctx.chunkGenerator().getBaseHeight(x, z, Heightmap.Types.WORLD_SURFACE_WG, ctx.heightAccessor());
    BlockPos blockpos = new BlockPos(x, surfaceY, z);
    Rotation rotation = Rotation.getRandom(ctx.random());
    MagicianTowerPieces.start(ctx.structureManager(), blockpos, rotation, p_197089_, ctx.random());
}
Also used : BlockPos(net.minecraft.core.BlockPos) Rotation(net.minecraft.world.level.block.Rotation)

Example 17 with Rotation

use of net.minecraft.world.level.block.Rotation in project SolarCraftRepository by FINDERFEED.

the class MazeStructure method generatePieces.

private static void generatePieces(StructurePiecesBuilder p_197089_, PieceGenerator.Context<NoneFeatureConfiguration> ctx) {
    int x = (ctx.chunkPos().x << 4) + 7;
    int z = (ctx.chunkPos().z << 4) + 7;
    int surfaceY = ctx.chunkGenerator().getBaseHeight(x, z, Heightmap.Types.WORLD_SURFACE_WG, ctx.heightAccessor());
    BlockPos blockpos = new BlockPos(x, surfaceY, z);
    Rotation rotation = Rotation.getRandom(ctx.random());
    MazeStructurePieces.start(ctx.structureManager(), blockpos, rotation, p_197089_, ctx.random());
}
Also used : BlockPos(net.minecraft.core.BlockPos) Rotation(net.minecraft.world.level.block.Rotation)

Example 18 with Rotation

use of net.minecraft.world.level.block.Rotation in project SolarCraftRepository by FINDERFEED.

the class RunicElementalArenaStructure method generatePieces.

private static void generatePieces(StructurePiecesBuilder p_197089_, PieceGenerator.Context<NoneFeatureConfiguration> ctx) {
    int x = (ctx.chunkPos().x << 4) + 7;
    int z = (ctx.chunkPos().z << 4) + 7;
    int surfaceY = ctx.chunkGenerator().getBaseHeight(x, z, Heightmap.Types.WORLD_SURFACE_WG, ctx.heightAccessor());
    BlockPos blockpos = new BlockPos(x - 9, surfaceY - 1, z - 9);
    Rotation rotation = Rotation.getRandom(ctx.random());
    RunicElementalArenaStructurePieces.start(ctx.structureManager(), blockpos, rotation, p_197089_, ctx.random());
}
Also used : BlockPos(net.minecraft.core.BlockPos) Rotation(net.minecraft.world.level.block.Rotation)

Example 19 with Rotation

use of net.minecraft.world.level.block.Rotation in project SolarCraftRepository by FINDERFEED.

the class DungeonOne method generatePieces.

private static void generatePieces(StructurePiecesBuilder p_197089_, PieceGenerator.Context<NoneFeatureConfiguration> ctx) {
    int x = (ctx.chunkPos().x << 4) + 7;
    int z = (ctx.chunkPos().z << 4) + 7;
    int surfaceY = ctx.chunkGenerator().getBaseHeight(x, z, Heightmap.Types.WORLD_SURFACE_WG, ctx.heightAccessor());
    BlockPos blockpos = new BlockPos(x, surfaceY, z);
    Rotation rotation = Rotation.getRandom(ctx.random());
    DungeonOnePieces.start(ctx.structureManager(), blockpos, rotation, p_197089_, ctx.random());
}
Also used : BlockPos(net.minecraft.core.BlockPos) Rotation(net.minecraft.world.level.block.Rotation)

Example 20 with Rotation

use of net.minecraft.world.level.block.Rotation in project BYG by AOCAWOL.

the class BYGAbstractTreeFeature method getTransformedPos.

public static BlockPos getTransformedPos(BYGTreeConfig config, BlockPos startPos, BlockPos pos) {
    Rotation rotation = config.getRotation();
    Mirror mirror = config.getMirror();
    BlockPos blockPos = FeatureGenUtil.extractOffset(startPos, pos);
    if (blockPos instanceof MutableBlockPos) {
        FeatureGenUtil.transformMutable((MutableBlockPos) blockPos, mirror, rotation);
        ((MutableBlockPos) blockPos).move(startPos.getX(), 0, startPos.getZ());
        return blockPos;
    }
    return FeatureGenUtil.transform(blockPos, mirror, rotation).offset(startPos.getX(), 0, startPos.getZ());
}
Also used : MutableBlockPos(net.minecraft.core.BlockPos.MutableBlockPos) BlockPos(net.minecraft.core.BlockPos) Rotation(net.minecraft.world.level.block.Rotation) Mirror(net.minecraft.world.level.block.Mirror) MutableBlockPos(net.minecraft.core.BlockPos.MutableBlockPos)

Aggregations

Rotation (net.minecraft.world.level.block.Rotation)22 BlockPos (net.minecraft.core.BlockPos)19 StructurePlaceSettings (net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings)11 StructureManager (net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager)10 StructureTemplate (net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate)10 WorldGenLevel (net.minecraft.world.level.WorldGenLevel)9 Random (java.util.Random)8 BlockState (net.minecraft.world.level.block.state.BlockState)4 BoundingBox (net.minecraft.world.level.levelgen.structure.BoundingBox)4 ResourceLocation (net.minecraft.resources.ResourceLocation)3 Mirror (net.minecraft.world.level.block.Mirror)3 MutableBlockPos (net.minecraft.core.BlockPos.MutableBlockPos)2 Vec3i (net.minecraft.core.Vec3i)2 ChunkPos (net.minecraft.world.level.ChunkPos)2 Biome (net.minecraft.world.level.biome.Biome)2 BlockRotProcessor (net.minecraft.world.level.levelgen.structure.templatesystem.BlockRotProcessor)2 TemplateAccessor (com.telepathicgrunt.repurposedstructures.mixin.structures.TemplateAccessor)1 Calendar (java.util.Calendar)1 Level (net.minecraft.world.level.Level)1 LevelHeightAccessor (net.minecraft.world.level.LevelHeightAccessor)1