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