本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}