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


Java StructureVillagePieces类代码示例

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


StructureVillagePieces类属于net.minecraft.world.gen.structure包,在下文中一共展示了StructureVillagePieces类的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: addExtraVillageComponents

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入依赖的package包/类
public static void addExtraVillageComponents(List<PieceWeight> list, Random random, int i)
{
    List<StructureVillagePieces.PieceWeight> parts = list;
    for (IVillageCreationHandler handler : instance().villageCreationHandlers.values())
    {
        parts.add(handler.getVillagePieceWeight(random, i));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:VillagerRegistry.java

示例3: MuonVillageGrove

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入依赖的package包/类
public MuonVillageGrove(StructureVillagePieces.Start start, int type, Random rand, StructureBoundingBox structurebb, EnumFacing facing)
{
    super(start, type);
    this.boundingBox = structurebb;
    this.setCoordBaseMode(facing);
    this.sapling = Blocks.SAPLING.getDefaultState();
}
 
开发者ID:MinimumContent,项目名称:muon,代码行数:8,代码来源:MuonVillageGrove.java

示例4: 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

示例5: addExtraVillageComponents

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入依赖的package包/类
public static void addExtraVillageComponents(@SuppressWarnings("rawtypes") ArrayList components, Random random, int i)
{
    @SuppressWarnings("unchecked")
    List<StructureVillagePieces.PieceWeight> parts = components;
    for (IVillageCreationHandler handler : instance().villageCreationHandlers.values())
    {
        parts.add(handler.getVillagePieceWeight(random, i));
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:10,代码来源:VillagerRegistry.java

示例6: 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

示例7: 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

示例8: 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

示例9: generate

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入依赖的package包/类
@Override
public boolean generate(World world, Random rand, int x, int z, EnumFacing facing, double chance, boolean isCommand) {
    if (isCommand) {
        StructureBoundingBox boundingBox = ComponentVillageUndertaker.getBoundingBox(facing, x, z);
        new ComponentVillageUndertaker(new StructureVillagePieces.Start(), 0, rand, boundingBox, facing)
                .generateComponent(world, rand, boundingBox, true);
        return true;
    }
    return false;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:11,代码来源:VillageCemeteryGenerator.java

示例10: generate

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入依赖的package包/类
@Override
public boolean generate(World world, Random rand, int x, int z, EnumFacing facing, double chance, boolean isCommand) {
    if (isCommand) {
        StructureBoundingBox boundingBox = ComponentVillageUndertaker.getBoundingBox(facing, x, z);
        new ComponentVillageUndertaker(new StructureVillagePieces.Start(), 0, rand, boundingBox, facing)
                .generateComponent(world, rand, boundingBox, false);
        return true;
    }
    return false;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:11,代码来源:VillageUndertakerGenerator.java

示例11: 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

示例12: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
	@Override
	public Object buildComponent(PieceWeight villagePiece, Start startPiece, List pieces, Random random, 
			int p1, int p2, int p3, int p4, int p5) {
//				BiomeGenBase biome = 
//						world.getBiomeGenForCoords(startPiece.getBoundingBox().minX, startPiece.getBoundingBox().minZ);
//		if (biome != ModBiomes.biomeCityPlains)
//			return null;
		return StructureVillagePieces.WoodHut.func_74908_a(startPiece, pieces, random, p1, p2, p3, p4, p5);
	}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:WoodHutCreationHandler.java

示例13: 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, 8, 5, direction);
       if (canVillageGoDeeper(_boundingBox)) { 
       	if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
       		return new CatapultTower(startPiece, type, random, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:CatapultTower.java

示例14: 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, 8, 5, direction);
       if (canVillageGoDeeper(_boundingBox)) { 
       	if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
       		return new BallistaTower(startPiece, type, random, _boundingBox, direction);
       	}
       }
	return null;
}
 
开发者ID:DracoAnimus,项目名称:Coding,代码行数:11,代码来源:BallistaTower.java

示例15: 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


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