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


Java Village类代码示例

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


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

示例1: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces,
		Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
	StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0,
			0, 0, 14, 16, 11, facing);
	return canVillageGoDeeper(structureboundingbox)
			&& StructureComponent.findIntersecting(pieces, structureboundingbox) == null
					? new MannCoBuilding(startPiece, p5, random, structureboundingbox, facing) : null;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:10,代码来源:MannCoBuilding.java

示例2: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(final PieceWeight villagePiece, final Start startPiece,
		final List<StructureComponent> pieces, final Random random, final int x, final int y, final int z,
		final EnumFacing facing, final int type) {

	// This shouldn't happen, but just in case...
	if (!(villagePiece instanceof SchematicPieceWeight))
		return null;

	// Get our next structure
	final SchematicPieceWeight pw = (SchematicPieceWeight) villagePiece;
	final SchematicProperties props = pw.getNextStructure();

	// If we don't get properties we may have exceeded
	// the spawn limit.
	if (props == null)
		return null;

	// Bound it out
	final Dimensions size = props.schematic.getDimensions();
	final StructureBoundingBox _boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(x, y, z, 0, 0, 0,
			size.width, size.height, size.length, facing);

	// Check to see if the region is OK, and if so return back
	// a SchematicStructure surrogate for the schematic.
	if (canVillageGoDeeper(_boundingBox)) {
		if (StructureComponent.findIntersecting(pieces, _boundingBox) == null) {
			ModLog.debug("Village structure [%s] @(%s); mode %d", props.name, _boundingBox, facing);
			final SchematicStructure struct = new SchematicStructure(startPiece, type, random, _boundingBox,
					facing);
			struct.setProperties(props);
			return struct;
		}
	}
	return null;
}
 
开发者ID:OreCruncher,项目名称:Restructured,代码行数:37,代码来源:SchematicStructureCreationHandler.java

示例3: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的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) {
  
  int totalWeight = getTotalWieght(pieceWeights);
  if(totalWeight <= 0) {
    return null;
  }

  for (int i = 0; i < 5; ++i) {

    int randomWeight = random.nextInt(totalWeight);
    Iterator<WeightedCreationHandler> iterator = pieceWeights.iterator();

    while (iterator.hasNext()) {
      WeightedCreationHandler el = iterator.next();
      PieceWeight pieceweight = el.weight;
      randomWeight -= pieceweight.villagePieceWeight;

      if(randomWeight < 0) {
        int notUsed = 0;
        if(!pieceweight.canSpawnMoreVillagePiecesOfType(notUsed)
            || pieceweight == startPiece.structVillagePieceWeight && pieceWeights.size() > 1) {
          break;
        }
        StructureVillagePieces.Village village = (Village) el.handler.buildComponent(pieceweight, startPiece, pieces, random, x, y, z, coordBaseMode, p5);

        if(village != null) {
          ++pieceweight.villagePiecesSpawned;
          startPiece.structVillagePieceWeight = pieceweight;
          if(!pieceweight.canSpawnMoreVillagePieces()) {
            pieceWeights.remove(el);
          }
          return village;
        }
      }
    }
  }
  return null;
}
 
开发者ID:SleepyTrousers,项目名称:Structures,代码行数:41,代码来源:CompositeCreationHandler.java

示例4: getVillageComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
public static Village getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List<StructureComponent> pieces, Random random,
                                          int p1, int p2, int p3, EnumFacing facing, int p5)
{
    return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, facing, p5);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:VillagerRegistry.java

示例5: buildComponent

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

示例6: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3,
		EnumFacing facing, int p5) {
	return VillagePieceGuardTower2.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:7,代码来源:VillageHandlerGuardTower2.java

示例7: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
	return VillagePieceBarracks.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:6,代码来源:VillageHandlerBarracks.java

示例8: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
	return VillagePieceCabin.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:6,代码来源:VillageHandlerCabin.java

示例9: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
	return VillagePieceGuardTower.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:6,代码来源:VillageHandlerGuardTower.java

示例10: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
	return VillagePieceShop.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:6,代码来源:VillageHandlerShop.java

示例11: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
	return VillagePieceTrophy.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:6,代码来源:VillageHandlerTrophy.java

示例12: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3,
		EnumFacing facing, int p5) {
	return VillagePieceKeep.createPiece(startPiece, pieces, random, p1, p2, p3, facing, p5);

}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:7,代码来源:VillageHandlerKeep.java

示例13: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
	StructureBoundingBox box = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, -32 + 9, 0, 13, 11, 13, facing);
	return !Config.genScientistHouse || !(box != null && box.minY > 16) || (StructureComponent.findIntersecting(pieces, box) != null) ? null : new VillageHouseScientist(startPiece, p5, random, box, facing);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:6,代码来源:VillageHouseScientist.java

示例14: buildComponent

import net.minecraft.world.gen.structure.StructureVillagePieces.Village; //导入依赖的package包/类
@Override
public Village buildComponent(PieceWeight villagePiece, Start startPiece,List pieces, Random random, int x, int y, int z,EnumFacing facing, int p5) {
	return ComponentCornField.createPiece(startPiece, pieces, random, x, y, z, facing, p5);
}
 
开发者ID:cleverpanda,项目名称:SimpleCorn,代码行数:5,代码来源:CornWorldGen.java

示例15: buildComponent

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


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