本文整理汇总了Java中net.minecraft.world.gen.structure.StructureComponent类的典型用法代码示例。如果您正苦于以下问题:Java StructureComponent类的具体用法?Java StructureComponent怎么用?Java StructureComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StructureComponent类属于net.minecraft.world.gen.structure包,在下文中一共展示了StructureComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNextComponentNN
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
protected StructureComponent getNextComponentNN(StructureComponentVillageStartPiece par1ComponentVillageStartPiece, List par2List, Random par3Random, int par4, int par5)
{
switch (this.coordBaseMode)
{
case 0:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType());
case 1:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType());
case 2:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType());
case 3:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType());
default:
return null;
}
}
示例2: getNextComponentPP
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
protected StructureComponent getNextComponentPP(StructureComponentVillageStartPiece par1ComponentVillageStartPiece, List par2List, Random par3Random, int par4, int par5)
{
switch (this.coordBaseMode)
{
case 0:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType());
case 1:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType());
case 2:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType());
case 3:
return StructureVillagePiecesMoon.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType());
default:
return null;
}
}
示例3: func_75083_a
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
private static StructureComponentVillage func_75083_a(StructureComponentVillageStartPiece par0ComponentVillageStartPiece, StructureVillagePieceWeightMoon par1StructureVillagePieceWeight, List<StructureComponent> par2List, Random par3Random, int par4, int par5, int par6, int par7, int par8)
{
final Class<?> var9 = par1StructureVillagePieceWeight.villagePieceClass;
Object var10 = null;
if (var9 == StructureComponentVillageWoodHut.class)
{
var10 = StructureComponentVillageWoodHut.func_74908_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
}
else if (var9 == StructureComponentVillageField.class)
{
var10 = StructureComponentVillageField.func_74900_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
}
else if (var9 == StructureComponentVillageField2.class)
{
var10 = StructureComponentVillageField2.func_74900_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
}
else if (var9 == StructureComponentVillageHouse.class)
{
var10 = StructureComponentVillageHouse.func_74921_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
}
return (StructureComponentVillage) var10;
}
示例4: getNextVillageStructureComponent
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
/**
* attempts to find a next Structure Component to be spawned, private
* Village function
*/
private static StructureComponent getNextVillageStructureComponent(StructureComponentVillageStartPiece par0ComponentVillageStartPiece, List<StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7)
{
if (par7 > 50)
{
return null;
}
else if (Math.abs(par3 - par0ComponentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentVillageStartPiece.getBoundingBox().minZ) <= 112)
{
final StructureComponentVillage var8 = StructureVillagePiecesMoon.getNextVillageComponent(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6, par7 + 1);
if (var8 != null)
{
par1List.add(var8);
par0ComponentVillageStartPiece.field_74932_i.add(var8);
return var8;
}
return null;
}
else
{
return null;
}
}
示例5: getNextComponentVillagePath
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
private static StructureComponent getNextComponentVillagePath(StructureComponentVillageStartPiece par0ComponentVillageStartPiece, List<StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7)
{
if (par7 > 3 + par0ComponentVillageStartPiece.terrainType)
{
return null;
}
else if (Math.abs(par3 - par0ComponentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentVillageStartPiece.getBoundingBox().minZ) <= 112)
{
final StructureBoundingBox var8 = StructureComponentVillagePathGen.func_74933_a(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6);
if (var8 != null && var8.minY > 10)
{
final StructureComponentVillagePathGen var9 = new StructureComponentVillagePathGen(par0ComponentVillageStartPiece, par7, par2Random, var8, par6);
par1List.add(var9);
par0ComponentVillageStartPiece.field_74930_j.add(var9);
return var9;
}
return null;
}
else
{
return null;
}
}
示例6: func_75083_a
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
private static VillageStructureComponent func_75083_a(VillageStructureComponentStartPiece par0ComponentVillageStartPiece, VillageStructurePieceWeight par1StructureVillagePieceWeight, List<StructureComponent> par2List, Random par3Random, int par4, int par5, int par6, int par7, int par8) {
final Class<?> var9 = par1StructureVillagePieceWeight.villagePieceClass;
Object var10 = null;
if (var9 == VillageStructureComponentWoodHut.class) {
var10 = VillageStructureComponentWoodHut.func_74908_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
} else if (var9 == VillageStructureComponentField.class) {
var10 = VillageStructureComponentField.func_74900_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
} else if (var9 == VillageStructureComponentField2.class) {
var10 = VillageStructureComponentField2.func_74900_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
} else if (var9 == VillageStructureComponentHouse.class) {
var10 = VillageStructureComponentHouse.func_74921_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8);
}
return (VillageStructureComponent) var10;
}
示例7: getNextVillageStructureComponent
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
/**
* attempts to find a next Structure Component to be spawned, private Village function
*/
private static StructureComponent getNextVillageStructureComponent(VillageStructureComponentStartPiece par0ComponentVillageStartPiece, List<StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) {
if (par7 > 50) {
return null;
} else if (Math.abs(par3 - par0ComponentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentVillageStartPiece.getBoundingBox().minZ) <= 112) {
final VillageStructureComponent var8 = VillageStructurePieces.getNextVillageComponent(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6, par7 + 1);
if (var8 != null) {
par1List.add(var8);
par0ComponentVillageStartPiece.field_74932_i.add(var8);
return var8;
}
return null;
} else {
return null;
}
}
示例8: getNextComponentVillagePath
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
private static StructureComponent getNextComponentVillagePath(VillageStructureComponentStartPiece par0ComponentVillageStartPiece, List<StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) {
if (par7 > 3 + par0ComponentVillageStartPiece.terrainType) {
return null;
} else if (Math.abs(par3 - par0ComponentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentVillageStartPiece.getBoundingBox().minZ) <= 112) {
final StructureBoundingBox var8 = VillageStructureComponentPathGen.func_74933_a(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6);
if (var8 != null && var8.minY > 10) {
final VillageStructureComponentPathGen var9 = new VillageStructureComponentPathGen(par0ComponentVillageStartPiece, par7, par2Random, var8, par6);
par1List.add(var9);
par0ComponentVillageStartPiece.field_74930_j.add(var9);
return var9;
}
return null;
} else {
return null;
}
}
示例9: findPieceBox
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
public static StructureBoundingBox findPieceBox(StructureVillagePieces.Start start, List<StructureComponent> structureComponents, Random rand, int structureMinX, int structureMinY, int structureMinZ, EnumFacing facing) {
// for the Grove, find the largest unoccupied space in the village. we will later plant that with trees/saplings
StructureBoundingBox villagebb = new StructureBoundingBox(start.getBoundingBox());
MuonHeightMap found = MuonHooks.findTerrain(villagebb, villagebb);
MuonHeightMap original = null;
for (StructureComponent piece : structureComponents) {
villagebb.expandTo(piece.getBoundingBox());
}
if (found != null) {
original = MuonHeightMap.defaultHeights(found.world, found.mapbb);
}
// call recursive function to find best gap in bounding box
StructureBoundingBox position = null;
position = findPieceGap(villagebb, start, structureComponents, found, original);
if (position == null) {
// if we couldn't find a spot within the strict village boundary, look around the edges as well.
if (found != null) {
// use actual terraformed area.
position = findPieceGap(MuonUtils.chunksBoundingBox(found.mapbb), start, structureComponents, found, original);
} else {
position = findPieceGap(MuonUtils.chunksBoundingBox(villagebb), start, structureComponents, found, original);
}
}
return position;
}
示例10: getNextComponentNN
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
/**
* Gets the next village component, with the bounding box shifted -1 in the X and Z direction.
*/
protected StructureComponent getNextComponentNN(StructureVillagePieces.Start p_74891_1_, List p_74891_2_, Random p_74891_3_, int p_74891_4_, int p_74891_5_)
{
switch (this.coordBaseMode)
{
case 0:
return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, 1, this.getComponentType());
case 1:
return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, 2, this.getComponentType());
case 2:
return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, 1, this.getComponentType());
case 3:
return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, 2, this.getComponentType());
default:
return null;
}
}
示例11: getNextComponentPP
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
/**
* Gets the next village component, with the bounding box shifted +1 in the X and Z direction.
*/
protected StructureComponent getNextComponentPP(StructureVillagePieces.Start p_74894_1_, List p_74894_2_, Random p_74894_3_, int p_74894_4_, int p_74894_5_)
{
switch (this.coordBaseMode)
{
case 0:
return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, 3, this.getComponentType());
case 1:
return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType());
case 2:
return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, 3, this.getComponentType());
case 3:
return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType());
default:
return null;
}
}
示例12: 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();
}
示例13: buildComponent
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void buildComponent(StructureComponent component, List list, Random random) {
ComponentTiamatCenterLine componentE = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4) + 1, (this.boundingBox.minZ >> 4), ForgeDirection.EAST, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentE);
list.add(componentE);
ComponentTiamatCenterLine componentW = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4) - 1, (this.boundingBox.minZ >> 4), ForgeDirection.WEST, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentW);
list.add(componentW);
ComponentTiamatCenterLine componentS = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4), (this.boundingBox.minZ >> 4) + 1, ForgeDirection.SOUTH, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentS);
list.add(componentS);
ComponentTiamatCenterLine componentN = new ComponentTiamatCenterLine(random, (this.boundingBox.minX >> 4), (this.boundingBox.minZ >> 4) - 1, ForgeDirection.NORTH, 1);
((ComponentTiamatCenter) component).structureComponents.add(componentN);
list.add(componentN);
}
示例14: 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();
}
示例15: buildComponent
import net.minecraft.world.gen.structure.StructureComponent; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Object buildComponent(PieceWeight villagePiece, Start startPiece, List pieces, Random random, int x, int y, int z, int coordBaseMode, int p5) {
IStructureTemplate template = null;
if(startPiece.inDesert && !desertTemplates.isEmpty()) {
template = WeightedTemplate.getTemplate(desertTemplates);
}
if(template == null) {
template = WeightedTemplate.getTemplate(templates);
}
if(template == null) {
return null;
}
VillageHouse comp = new VillageHouse(template,villagerSpawnLocation, villagerId, x, y, z, coordBaseMode);
VillageHouse res = canVillageGoDeeper(comp.getBoundingBox()) && StructureComponent.findIntersecting(pieces, comp.getBoundingBox()) == null
? comp : null;
return res;
}