当前位置: 首页>>代码示例>>Java>>正文


Java StructureComponent.getBoundingBox方法代码示例

本文整理汇总了Java中net.minecraft.world.gen.structure.StructureComponent.getBoundingBox方法的典型用法代码示例。如果您正苦于以下问题:Java StructureComponent.getBoundingBox方法的具体用法?Java StructureComponent.getBoundingBox怎么用?Java StructureComponent.getBoundingBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.gen.structure.StructureComponent的用法示例。


在下文中一共展示了StructureComponent.getBoundingBox方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_74992_a

import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
public static StructureBoundingBox func_74992_a(List<StructureComponent> par1List, Random par1Random, int par2, int par3, int par4, EnumFacing par6)
{
	StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 4, par6);
	StructureComponent structurecomponent = StructureComponent.findIntersecting(par1List, structureboundingbox);

	if (structurecomponent == null)
		return null;
	else
	{
		if (structurecomponent.getBoundingBox().minY == structureboundingbox.minY)
			for (int i1 = 3; i1 >= 1; --i1)
			{
				structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, i1 - 1, par6);

				if (!structurecomponent.getBoundingBox().intersectsWith(structureboundingbox))
					return StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, i1, par6);
			}

		return null;
	}
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:22,代码来源:StructureAbyStrongholdPieces.java

示例2: func_176066_d

import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
private static StructureComponent func_176066_d(StructureOmotholPieces.Start start, List<StructureComponent> p_176066_1_, Random rand, int p_176066_3_, int p_176066_4_, int p_176066_5_, EnumFacing facing, int p_176066_7_)
{
	if (p_176066_7_ > 250)
		return null;
	else if (Math.abs(p_176066_3_ - start.getBoundingBox().minX) <= 4000 && Math.abs(p_176066_5_ - start.getBoundingBox().minZ) <= 4000)
	{
		StructureComponent structurecomponent = func_176067_c(start, p_176066_1_, rand, p_176066_3_, p_176066_4_, p_176066_5_, facing, p_176066_7_ + 1);

		if (structurecomponent != null)
		{
			int i = (structurecomponent.getBoundingBox().minX + structurecomponent.getBoundingBox().maxX) / 2;
			int j = (structurecomponent.getBoundingBox().minZ + structurecomponent.getBoundingBox().maxZ) / 2;
			int k = structurecomponent.getBoundingBox().maxX - structurecomponent.getBoundingBox().minX;
			int l = structurecomponent.getBoundingBox().maxZ - structurecomponent.getBoundingBox().minZ;
			int i1 = k > l ? k : l;

			if (start.getWorldChunkManager().areBiomesViable(i, j, i1 / 2 + 4, MapGenOmothol.villageSpawnBiomes))
			{
				p_176066_1_.add(structurecomponent);
				start.field_74932_i.add(structurecomponent);
				return structurecomponent;
			}
		}

		return null;
	} else
		return null;
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:29,代码来源:StructureOmotholPieces.java

示例3: func_176069_e

import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
private static StructureComponent func_176069_e(StructureOmotholPieces.Start start, List<StructureComponent> p_176069_1_, Random rand, int p_176069_3_, int p_176069_4_, int p_176069_5_, EnumFacing facing, int p_176069_7_)
{
	if (p_176069_7_ > 3 + start.terrainType)
		return null;
	else if (Math.abs(p_176069_3_ - start.getBoundingBox().minX) <= 4000 && Math.abs(p_176069_5_ - start.getBoundingBox().minZ) <= 4000)
	{
		StructureBoundingBox structureboundingbox = StructureOmotholPieces.Path.func_175848_a(start, p_176069_1_, rand, p_176069_3_, p_176069_4_, p_176069_5_, facing);

		if (structureboundingbox != null && structureboundingbox.minY > 10)
		{
			StructureComponent structurecomponent = new StructureOmotholPieces.Path(start, p_176069_7_, rand, structureboundingbox, facing);
			int i = (structurecomponent.getBoundingBox().minX + structurecomponent.getBoundingBox().maxX) / 2;
			int j = (structurecomponent.getBoundingBox().minZ + structurecomponent.getBoundingBox().maxZ) / 2;
			int k = structurecomponent.getBoundingBox().maxX - structurecomponent.getBoundingBox().minX;
			int l = structurecomponent.getBoundingBox().maxZ - structurecomponent.getBoundingBox().minZ;
			int i1 = k > l ? k : l;

			if (start.getWorldChunkManager().areBiomesViable(i, j, i1 / 2 + 4, MapGenOmothol.villageSpawnBiomes))
			{
				p_176069_1_.add(structurecomponent);
				start.field_74930_j.add(structurecomponent);
				return structurecomponent;
			}
		}

		return null;
	} else
		return null;
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:30,代码来源:StructureOmotholPieces.java

示例4: buildComponent

import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
/**
 * Initiates construction of the Structure Component picked, at the current Location of StructGen
 */
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random)
{
	int i = getComponentType();
	int k = boundingBox.getYSize() - 3 - 1;

	if (k <= 0)
		k = 1;

	int j;
	StructureComponent structurecomponent1;
	StructureBoundingBox structureboundingbox;

	for (j = 0; j < boundingBox.getXSize(); j += 4)
	{
		j += par3Random.nextInt(boundingBox.getXSize());

		if (j + 3 > boundingBox.getXSize())
			break;

		structurecomponent1 = StructureDreadlandsMinePieces.getNextMineShaftComponent(par1StructureComponent, par2List, par3Random, boundingBox.minX + j, boundingBox.minY + par3Random.nextInt(k) + 1, boundingBox.minZ - 1, EnumFacing.NORTH, i);

		if (structurecomponent1 != null)
		{
			structureboundingbox = structurecomponent1.getBoundingBox();
			roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox.minX, structureboundingbox.minY, boundingBox.minZ, structureboundingbox.maxX, structureboundingbox.maxY, boundingBox.minZ + 1));
		}
	}

	for (j = 0; j < boundingBox.getXSize(); j += 4)
	{
		j += par3Random.nextInt(boundingBox.getXSize());

		if (j + 3 > boundingBox.getXSize())
			break;

		structurecomponent1 = StructureDreadlandsMinePieces.getNextMineShaftComponent(par1StructureComponent, par2List, par3Random, boundingBox.minX + j, boundingBox.minY + par3Random.nextInt(k) + 1, boundingBox.maxZ + 1, EnumFacing.SOUTH, i);

		if (structurecomponent1 != null)
		{
			structureboundingbox = structurecomponent1.getBoundingBox();
			roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox.minX, structureboundingbox.minY, boundingBox.maxZ - 1, structureboundingbox.maxX, structureboundingbox.maxY, boundingBox.maxZ));
		}
	}

	for (j = 0; j < boundingBox.getZSize(); j += 4)
	{
		j += par3Random.nextInt(boundingBox.getZSize());

		if (j + 3 > boundingBox.getZSize())
			break;

		structurecomponent1 = StructureDreadlandsMinePieces.getNextMineShaftComponent(par1StructureComponent, par2List, par3Random, boundingBox.minX - 1, boundingBox.minY + par3Random.nextInt(k) + 1, boundingBox.minZ + j, EnumFacing.WEST, i);

		if (structurecomponent1 != null)
		{
			structureboundingbox = structurecomponent1.getBoundingBox();
			roomsLinkedToTheRoom.add(new StructureBoundingBox(boundingBox.minX, structureboundingbox.minY, structureboundingbox.minZ, boundingBox.minX + 1, structureboundingbox.maxY, structureboundingbox.maxZ));
		}
	}

	for (j = 0; j < boundingBox.getZSize(); j += 4)
	{
		j += par3Random.nextInt(boundingBox.getZSize());

		if (j + 3 > boundingBox.getZSize())
			break;

		structurecomponent1 = StructureDreadlandsMinePieces.getNextMineShaftComponent(par1StructureComponent, par2List, par3Random, boundingBox.maxX + 1, boundingBox.minY + par3Random.nextInt(k) + 1, boundingBox.minZ + j, EnumFacing.EAST, i);

		if (structurecomponent1 != null)
		{
			structureboundingbox = structurecomponent1.getBoundingBox();
			roomsLinkedToTheRoom.add(new StructureBoundingBox(boundingBox.maxX - 1, structureboundingbox.minY, structureboundingbox.minZ, boundingBox.maxX, structureboundingbox.maxY, structureboundingbox.maxZ));
		}
	}
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:82,代码来源:StructureDreadlandsMinePieces.java


注:本文中的net.minecraft.world.gen.structure.StructureComponent.getBoundingBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。