本文整理汇总了Java中net.minecraft.world.gen.structure.StructureComponent.buildComponent方法的典型用法代码示例。如果您正苦于以下问题:Java StructureComponent.buildComponent方法的具体用法?Java StructureComponent.buildComponent怎么用?Java StructureComponent.buildComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.gen.structure.StructureComponent
的用法示例。
在下文中一共展示了StructureComponent.buildComponent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StructureTestStart
import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
public StructureTestStart(World world, Random random, int par3, int par4){
super(par3,par4);
// 構造物の構成パーツを決定する
// 基点はComponentSampleDungeon1
ComponentTest1 componentTest1 = new ComponentTest1(0, random, (par3 << 4)+2, (par4 << 4)+2);
this.components.add(componentTest1);
//次のパーツ
componentTest1.buildComponent(componentTest1,this.components,random);
List<StructureComponent> list = componentTest1.structureComponents;
while (!list.isEmpty()){
int k = random.nextInt(list.size());
StructureComponent structureComponent = list.remove(k);
structureComponent.buildComponent(componentTest1,this.components,random);
}
this.updateBoundingBox();
}
示例2: StructureTiamatStart
import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
StructureTiamatStart(World world, Random random, int chunkX, int chunkZ){
this.centerChunkX = chunkX;
this.centerChunkZ = chunkZ;
ComponentTiamatCenter componentCenter = new ComponentTiamatCenter(random,chunkX,chunkZ);
this.components.add(componentCenter);
componentCenter.buildComponent(componentCenter,this.components,random);
List<StructureComponent> list = componentCenter.structureComponents;
while (!list.isEmpty()){
int k = random.nextInt(list.size());
StructureComponent structureComponent = list.remove(k);
structureComponent.buildComponent(componentCenter,this.components,random);
}
this.updateBoundingBox();
}
示例3: Start
import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public Start(World par1World, Random par2Random, int par3, int par4)
{
super(par3, par4);
StructureAbyStrongholdPieces.prepareStructurePieces();
StructureAbyStrongholdPieces.Stairs2 stairs2 = new StructureAbyStrongholdPieces.Stairs2(0, par2Random, (par3 << 4) + 2, (par4 << 4) + 2);
components.add(stairs2);
stairs2.buildComponent(stairs2, components, par2Random);
List list = stairs2.field_75026_c;
while (!list.isEmpty())
{
int k = par2Random.nextInt(list.size());
StructureComponent structurecomponent = (StructureComponent)list.remove(k);
structurecomponent.buildComponent(stairs2, components, par2Random);
}
updateBoundingBox();
markAvailableHeight(par1World, par2Random, 10);
}
示例4: getNextMineShaftComponent
import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
private static StructureComponent getNextMineShaftComponent(StructureComponent par0StructureComponent, List<StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, EnumFacing par6, int par7)
{
if (par7 > 8)
return null;
else if (Math.abs(par3 - par0StructureComponent.getBoundingBox().minX) <= 80 && Math.abs(par5 - par0StructureComponent.getBoundingBox().minZ) <= 80)
{
StructureComponent structurecomponent1 = getRandomComponent(par1List, par2Random, par3, par4, par5, par6, par7 + 1);
if (structurecomponent1 != null)
{
par1List.add(structurecomponent1);
structurecomponent1.buildComponent(par0StructureComponent, par1List, par2Random);
}
return structurecomponent1;
} else
return null;
}
示例5: Start
import net.minecraft.world.gen.structure.StructureComponent; //导入方法依赖的package包/类
public Start(World worldIn, Random rand, int x, int z, int p_i2092_5_)
{
super(x, z);
List<StructureOmotholPieces.PieceWeight> list = StructureOmotholPieces.getStructureVillageWeightedPieceList(rand, 100);
StructureOmotholPieces.Start StructureOmotholPieces$start = new StructureOmotholPieces.Start(worldIn.getBiomeProvider(), 0, rand, (x << 4) + 2, (z << 4) + 2, list, p_i2092_5_);
components.add(StructureOmotholPieces$start);
StructureOmotholPieces$start.buildComponent(StructureOmotholPieces$start, components, rand);
List<StructureComponent> list1 = StructureOmotholPieces$start.field_74930_j;
List<StructureComponent> list2 = StructureOmotholPieces$start.field_74932_i;
while (!list1.isEmpty() || !list2.isEmpty())
if (list1.isEmpty())
{
int i = rand.nextInt(list2.size());
StructureComponent structurecomponent = list2.remove(i);
structurecomponent.buildComponent(StructureOmotholPieces$start, components, rand);
}
else
{
int j = rand.nextInt(list1.size());
StructureComponent structurecomponent2 = list1.remove(j);
structurecomponent2.buildComponent(StructureOmotholPieces$start, components, rand);
}
updateBoundingBox();
int k = 0;
for (StructureComponent structurecomponent1 : components)
if (!(structurecomponent1 instanceof StructureOmotholPieces.Road))
++k;
hasMoreThanTwoComponents = k > 2;
}