Java Code Examples for net.minecraft.world.gen.structure.StructureBoundingBox#getComponentToAddBoundingBox()

The following examples show how to use net.minecraft.world.gen.structure.StructureBoundingBox#getComponentToAddBoundingBox() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TofuVillagerHouse.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public static TofuVillagerHouse createPiece(StructureVillagePieces.Start start,
                                            List<StructureComponent> list, Random rand, int minX, int minY, int minZ, EnumFacing facing, int type) {
    StructureBoundingBox box = StructureBoundingBox
            .getComponentToAddBoundingBox(minX, minY, minZ, 0, 0, 0, 6, 10, 6, facing);
    return StructureComponent.findIntersecting(list, box) != null ? null : new TofuVillagerHouse(start,
            type, rand, box, facing);
}
 
Example 2
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public static StructureBoundingBox findPieceBox(Start start, List<StructureComponent> p_175848_1_, Random rand, int p_175848_3_, int p_175848_4_, int p_175848_5_, EnumFacing facing) {
    for (int i = 7 * MathHelper.getInt(rand, 3, 5); i >= 7; i -= 7) {
        StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175848_3_, p_175848_4_, p_175848_5_, 0, 0, 0, 3, 3, i, facing);

        if (StructureComponent.findIntersecting(p_175848_1_, structureboundingbox) == null) {
            return structureboundingbox;
        }
    }

    return null;
}
 
Example 3
Source File: WAVillagerHouse.java    From Sakura_mod with MIT License 5 votes vote down vote up
public static WAVillagerHouse createPiece(StructureVillagePieces.Start start,
		List<StructureComponent> list, Random rand, int minX, int minY, int minZ, EnumFacing facing, int type) {
	StructureBoundingBox box = StructureBoundingBox
			.getComponentToAddBoundingBox(minX, minY, minZ, 0, 0, 0, 9, 9, 6, facing);
	return StructureComponent.findIntersecting(list, box) != null ? null : new WAVillagerHouse(start,
			type, rand, box, facing);
}
 
Example 4
Source File: VillageHandlerGuardTower2.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
public static VillagePieceGuardTower2 createPiece(StructureVillagePieces.Start start, List<StructureComponent> structures, Random rand, int x,
		int y, int z, EnumFacing facing, int p_175850_7_) {
	BlockPos size = new BlockMapMeasurer(NAME).measure();
	StructureBoundingBox bounds = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, size.getX(), size.getY(), size.getZ(),
			facing);
	return canVillageGoDeeper(bounds) && StructureComponent.findIntersecting(structures, bounds) == null
			? new VillagePieceGuardTower2(start, p_175850_7_, rand, bounds, facing) : null;
}
 
Example 5
Source File: VillageHandlerKeep.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
public static VillagePieceKeep createPiece(StructureVillagePieces.Start start, List<StructureComponent> structures, Random rand, int x, int y,
		int z, EnumFacing facing, int p_175850_7_) {
	BlockPos size = new BlockMapMeasurer(NAME).measure();
	StructureBoundingBox bounds = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, size.getX(), size.getY(), size.getZ(),
			facing);
	return canVillageGoDeeper(bounds) && StructureComponent.findIntersecting(structures, bounds) == null
			? new VillagePieceKeep(start, p_175850_7_, rand, bounds, facing) : null;
}
 
Example 6
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static TallTofuHouse createPiece(Start start, List<StructureComponent> p_175850_1_, Random rand, int p_175850_3_, int p_175850_4_, int p_175850_5_, EnumFacing facing, int p_175850_7_) {
    StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175850_3_, p_175850_4_, p_175850_5_, 0, 0, 0, 6, 10, 6, facing);
    return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175850_1_, structureboundingbox) == null ? new TallTofuHouse(start, p_175850_7_, rand, structureboundingbox, facing) : null;
}
 
Example 7
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static StructureBoundingBox findPieceBox(Start start, List<StructureComponent> p_175856_1_, Random rand, int p_175856_3_, int p_175856_4_, int p_175856_5_, EnumFacing facing) {
    StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175856_3_, p_175856_4_, p_175856_5_, 0, 0, 0, 3, 4, 2, facing);
    return StructureComponent.findIntersecting(p_175856_1_, structureboundingbox) != null ? null : structureboundingbox;
}
 
Example 8
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static TorchNew createPiece(Start start, List<StructureComponent> p_175853_1_, Random rand, int p_175853_3_, int p_175853_4_, int p_175853_5_, EnumFacing facing, int p_175853_7_) {
    StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175853_3_, p_175853_4_, p_175853_5_, 0, 0, 0, 4, 6, 5, facing);
    return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175853_1_, structureboundingbox) == null ? new TorchNew(start, p_175853_7_, rand, structureboundingbox, facing) : null;
}
 
Example 9
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static FarmLand createPiece(Start start, List<StructureComponent> p_175853_1_, Random rand, int p_175853_3_, int p_175853_4_, int p_175853_5_, EnumFacing facing, int p_175853_7_) {
    StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175853_3_, p_175853_4_, p_175853_5_, 0, 0, 0, 6, 5, 6, facing);
    return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175853_1_, structureboundingbox) == null ? new FarmLand(start, p_175853_7_, rand, structureboundingbox, facing) : null;
}
 
Example 10
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static WoodHut createPiece(Start start, List<StructureComponent> p_175853_1_, Random rand, int p_175853_3_, int p_175853_4_, int p_175853_5_, EnumFacing facing, int p_175853_7_) {
    StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175853_3_, p_175853_4_, p_175853_5_, 0, 0, 0, 4, 6, 5, facing);
    return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175853_1_, structureboundingbox) == null ? new WoodHut(start, p_175853_7_, rand, structureboundingbox, facing) : null;
}
 
Example 11
Source File: StructureTofuVillagePieces.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static House createPiece(Start start, List<StructureComponent> p_175853_1_, Random rand, int p_175853_3_, int p_175853_4_, int p_175853_5_, EnumFacing facing, int p_175853_7_) {
    StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175853_3_, p_175853_4_, p_175853_5_, 0, 0, 0, 5, 6, 5, facing);
    return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175853_1_, structureboundingbox) == null ? new House(start, p_175853_7_, rand, structureboundingbox, facing) : null;
}
 
Example 12
Source File: VillageHandlerBarracks.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
public static VillagePieceBarracks createPiece(StructureVillagePieces.Start start, List<StructureComponent> structures, Random rand, int x, int y, int z, EnumFacing facing, int p_175850_7_) {
	BlockPos size = new BlockMapMeasurer(NAME).measure();
	StructureBoundingBox bounds = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, size.getX(), size.getY(), size.getZ(), facing);
	return canVillageGoDeeper(bounds) && StructureComponent.findIntersecting(structures, bounds) == null ? new VillagePieceBarracks(start, p_175850_7_, rand, bounds, facing) : null;
}
 
Example 13
Source File: VillageHandlerGuardTower.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
public static VillagePieceGuardTower createPiece(StructureVillagePieces.Start start, List<StructureComponent> structures, Random rand, int x, int y, int z, EnumFacing facing, int p_175850_7_) {
	BlockPos size = new BlockMapMeasurer(NAME).measure();
	StructureBoundingBox bounds = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, size.getX(), size.getY(), size.getZ(), facing);
	return canVillageGoDeeper(bounds) && StructureComponent.findIntersecting(structures, bounds) == null ? new VillagePieceGuardTower(start, p_175850_7_, rand, bounds, facing) : null;
}
 
Example 14
Source File: VillageHandlerShop.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
public static VillagePieceShop createPiece(StructureVillagePieces.Start start, List<StructureComponent> structures, Random rand, int x, int y, int z, EnumFacing facing, int p_175850_7_) {
	BlockPos size = new BlockMapMeasurer(NAME).measure();
	StructureBoundingBox bounds = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, size.getX(), size.getY(), size.getZ(), facing);
	return canVillageGoDeeper(bounds) && StructureComponent.findIntersecting(structures, bounds) == null ? new VillagePieceShop(start, p_175850_7_, rand, bounds, facing) : null;
}
 
Example 15
Source File: VillageHandlerTrophy.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
public static VillagePieceTrophy createPiece(StructureVillagePieces.Start start, List<StructureComponent> structures, Random rand, int x, int y, int z, EnumFacing facing, int p_175850_7_) {
	BlockPos size = new BlockMapMeasurer(NAME).measure();
	StructureBoundingBox bounds = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, size.getX(), size.getY(), size.getZ(), facing);
	return canVillageGoDeeper(bounds) && StructureComponent.findIntersecting(structures, bounds) == null ? new VillagePieceTrophy(start, p_175850_7_, rand, bounds, facing) : null;
}
 
Example 16
Source File: VillageHandlerCabin.java    From ToroQuest with GNU General Public License v3.0 3 votes vote down vote up
public static VillagePieceCabin createPiece(StructureVillagePieces.Start start, List<StructureComponent> structures, Random rand, int x, int y, int z, EnumFacing facing, int p_175850_7_) {

			BlockPos size = new BlockMapMeasurer(NAME).measure();

			StructureBoundingBox bounds = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, size.getX(), size.getY(), size.getZ(), facing);

			return canVillageGoDeeper(bounds) && StructureComponent.findIntersecting(structures, bounds) == null ? new VillagePieceCabin(start, p_175850_7_, rand, bounds, facing) : null;
		}