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


Java StructureVillagePieces.Start方法代码示例

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


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

示例1: findPieceBox

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的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;
}
 
开发者ID:MinimumContent,项目名称:muon,代码行数:26,代码来源:MuonVillageGrove.java

示例2: areaMetric

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
private static int areaMetric(StructureBoundingBox current, StructureVillagePieces.Start start) {
    // int area = (current.maxX-current.minX)*(current.maxZ-current.minZ);
    int xSize = current.maxX-current.minX;
    int zSize = current.maxZ-current.minZ;
    int shortSide = Math.min(xSize, zSize);
    int longSide = Math.max(xSize, zSize);
    int smallArea = (shortSide * shortSide);
    if (shortSide > 12) {
        smallArea = shortSide * (24-shortSide);
    }
    int dist = Math.abs(current.maxX - start.getBoundingBox().maxX) + Math.abs(current.maxZ - start.getBoundingBox().maxZ);
    int area = smallArea + longSide - dist;
    return area;
}
 
开发者ID:MinimumContent,项目名称:muon,代码行数:15,代码来源:MuonVillageGrove.java

示例3: createPiece

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
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;
}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:9,代码来源:VillageHandlerGuardTower2.java

示例4: createPiece

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
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;
}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:9,代码来源:VillageHandlerKeep.java

示例5: ComponentVillageUndertaker

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public ComponentVillageUndertaker(StructureVillagePieces.Start startPiece, int componentType, Random random, StructureBoundingBox structureBoundingBox, EnumFacing direction) {
    super(startPiece, componentType);
    this.setCoordBaseMode(direction);
    this.boundingBox = structureBoundingBox;

    if (ExtendedConfig.generateCemeteries) {
        isCemetery = random.nextBoolean();
    }
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:10,代码来源:ComponentVillageUndertaker.java

示例6: ComponentCornField

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public ComponentCornField(StructureVillagePieces.Start start, int type, Random rand, StructureBoundingBox box, EnumFacing facing)
{
	super(start, type);
	this.setCoordBaseMode(facing);
	this.boundingBox = box;
	this.crop = ObjectList.CORN;
}
 
开发者ID:cleverpanda,项目名称:SimpleCorn,代码行数:8,代码来源:ComponentCornField.java

示例7: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public static StructureVillagePieces.Village buildComponent(StructureVillagePieces.Start startPiece, 
		@SuppressWarnings("rawtypes") List pieces, Random random, int x, int y, int z, int direction, int type) {
       StructureBoundingBox _boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 7, 14, 6, direction);
       if (canVillageGoDeeper(_boundingBox)) { 
       	if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
       		return new VillageGuardTower(startPiece, type, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:VillageGuardTower.java

示例8: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public static StructureVillagePieces.Village buildComponent(StructureVillagePieces.Start startPiece, 
		@SuppressWarnings("rawtypes") List pieces, Random random, int x, int y, int z, int direction, int type) {
       StructureBoundingBox _boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 23, 12, 21, direction);
       if (canVillageGoDeeper(_boundingBox)) { 
       	if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
       		return new VillageKingCastle(startPiece, type, random, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:VillageKingCastle.java

示例9: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public static StructureVillagePieces.Village buildComponent(StructureVillagePieces.Start startPiece, 
		@SuppressWarnings("rawtypes") List pieces, Random random, int x, int y, int z, int direction, int type) {
       StructureBoundingBox _boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 5, 10, 5, direction);
       if (canVillageGoDeeper(_boundingBox)) { 
       	if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
       		return new TestBallistaTower(startPiece, type, random, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:TestBallistaTower.java

示例10: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public static StructureVillagePieces.Village buildComponent(StructureVillagePieces.Start startPiece, 
		@SuppressWarnings("rawtypes") List pieces, Random random, int x, int y, int z, int direction, int type) {
       StructureBoundingBox _boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 5, 10, 5, direction);
       if (canVillageGoDeeper(_boundingBox)) { 
       	if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
       		return new TestCatapultTower(startPiece, type, random, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:TestCatapultTower.java

示例11: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public static StructureVillagePieces.Village buildComponent(StructureVillagePieces.Start startPiece, @SuppressWarnings("rawtypes") List pieces, Random random, int x, int y, int z, int direction, int type) {
       StructureBoundingBox _boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 14, 10, 8, direction);
       if(canVillageGoDeeper(_boundingBox)){ 
       	if(StructureComponent.findIntersecting(pieces, _boundingBox) == null){
       		return new VillageWall(startPiece, type, random, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:10,代码来源:VillageWall.java

示例12: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public static StructureVillagePieces.Village buildComponent(StructureVillagePieces.Start startPiece, 
		@SuppressWarnings("rawtypes") List pieces, Random random, int x, int y, int z, int direction, int type) {
       StructureBoundingBox _boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 14, 14, 12, direction);
       if (canVillageGoDeeper(_boundingBox)) { 
       	if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
       		return new VillageBaronCastle(startPiece, type, random, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:VillageBaronCastle.java

示例13: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
@Override
public StructureVillagePieces.Village buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5)
{
	return Cave.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:6,代码来源:VillagerStructures.java

示例14: Cave

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public Cave(StructureVillagePieces.Start start, int type, Random rand, StructureBoundingBox box, EnumFacing facing)
{
	super(start, type);
	this.setCoordBaseMode(facing);
	this.boundingBox = box;
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:7,代码来源:VillagerStructures.java

示例15: createPiece

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入方法依赖的package包/类
public static Cave createPiece(StructureVillagePieces.Start start, List<StructureComponent> components, Random rand, int x, int y, int z, EnumFacing facing, int type)
{
	StructureBoundingBox box = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0, 9, 7, 10, facing);
	return canVillageGoDeeper(box) && StructureComponent.findIntersecting(components, box) == null ? new Cave(start, type, rand, box, facing) : null;
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:6,代码来源:VillagerStructures.java


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