當前位置: 首頁>>代碼示例>>Java>>正文


Java FlowerManager類代碼示例

本文整理匯總了Java中forestry.api.apiculture.FlowerManager的典型用法代碼示例。如果您正苦於以下問題:Java FlowerManager類的具體用法?Java FlowerManager怎麽用?Java FlowerManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FlowerManager類屬於forestry.api.apiculture包,在下文中一共展示了FlowerManager類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isAcceptedFlower

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
@Override
public boolean isAcceptedFlower(World world, IBeeGenome species, int x, int y, int z) {

	int blockid = world.getBlockId(x, y, z);
	int meta = world.getBlockMetadata(x, y, z);

	// Specific check for flower pots.
	if (blockid == Block.flowerPot.blockID)
		return checkFlowerPot(meta);

	ItemStack flower = new ItemStack(blockid, 1, meta);

	for (ItemStack stack : FlowerManager.plainFlowers)
		if (flower.isItemEqual(stack))
			return true;

	return false;
}
 
開發者ID:ForestryMC,項目名稱:ForestryLegacy,代碼行數:19,代碼來源:FlowerProviderVanilla.java

示例2: growFlower

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
@Override
public boolean growFlower(World world, IBeeGenome species, int x, int y, int z) {

	int blockid = world.getBlockId(x, y, z);

	if (blockid != 0) {
		if (blockid == Block.flowerPot.blockID)
			return growInPot(world, x, y, z);
		else
			return false;
	}

	// Check ground
	int groundid = world.getBlockId(x, y - 1, z);

	if (groundid != Block.dirt.blockID && groundid != Block.grass.blockID)
		return false;

	// Determine flower to plant
	Collections.shuffle(FlowerManager.plainFlowers);
	ItemStack flower = FlowerManager.plainFlowers.get(world.rand.nextInt(FlowerManager.plainFlowers.size() - 1));
	world.setBlockAndMetadataWithNotify(x, y, z, flower.itemID, flower.getItemDamage());
	return true;
}
 
開發者ID:ForestryMC,項目名稱:ForestryLegacy,代碼行數:25,代碼來源:FlowerProviderVanilla.java

示例3: plantFlowerGarden

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
protected void plantFlowerGarden(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {

		if (isDesertVillage()) {
			placeBlockAtCurrentPosition(world, Block.cactus.blockID, 0, 4, 1, 7, box);
			return;
		}

		for (int i = minY; i <= maxY; ++i) {
			for (int j = minX; j <= maxX; ++j) {
				for (int k = minZ; k <= maxZ; ++k) {
					if (world.rand.nextBoolean()) {
						int xCoord = this.getXWithOffset(j, k);
						int yCoord = this.getYWithOffset(i);
						int zCoord = this.getZWithOffset(j, k);

						if (!Block.plantRed.canBlockStay(world, xCoord, yCoord, zCoord)) {
							continue;
						}

						ItemStack flower = FlowerManager.plainFlowers.get(world.rand.nextInt(FlowerManager.plainFlowers.size()));
						this.placeBlockAtCurrentPosition(world, flower.itemID, flower.getItemDamage(), j, i, k, box);
					}
				}
			}
		}
	}
 
開發者ID:ForestryMC,項目名稱:ForestryLegacy,代碼行數:27,代碼來源:ComponentVillageBeeHouse.java

示例4: getFlowers

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
@Override
@Deprecated
public Set<IFlower> getFlowers() {
	return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType());
}
 
開發者ID:MagicBees,項目名稱:MagicBees,代碼行數:6,代碼來源:FlowerProvider.java

示例5: registerPlantableFlower

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
protected void registerPlantableFlower(Block block, int meta, int weight) {
	FlowerManager.flowerRegistry.registerPlantableFlower(block, meta, weight, getFlowerType());
}
 
開發者ID:MagicBees,項目名稱:MagicBees,代碼行數:4,代碼來源:FlowerProvider.java

示例6: registerAcceptableFlower

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
protected void registerAcceptableFlower(Block block, int meta) {
	FlowerManager.flowerRegistry.registerAcceptableFlower(block, meta, getFlowerType());
}
 
開發者ID:MagicBees,項目名稱:MagicBees,代碼行數:4,代碼來源:FlowerProvider.java

示例7: registerGrowthRule

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
protected void registerGrowthRule(IFlowerGrowthRule growthRule) {
	FlowerManager.flowerRegistry.registerGrowthRule(growthRule, getFlowerType());
}
 
開發者ID:MagicBees,項目名稱:MagicBees,代碼行數:4,代碼來源:FlowerProvider.java

示例8: getFlowers

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
@Override
public Set<IFlower> getFlowers() {
	return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType());
}
 
開發者ID:TeamMetallurgy,項目名稱:Metallurgy-Bees,代碼行數:5,代碼來源:FlowerProviderStone.java

示例9: getItemStacks

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
@Override
public ItemStack[] getItemStacks() {
	return FlowerManager.plainFlowers.toArray(new ItemStack[0]);
}
 
開發者ID:ForestryMC,項目名稱:ForestryLegacy,代碼行數:5,代碼來源:FlowerProviderVanilla.java

示例10: doInit

import forestry.api.apiculture.FlowerManager; //導入依賴的package包/類
@Override
public void doInit() {
	super.doInit();

	// Init breeding manager
	BeeManager.breedingManager = new BreedingManager();
	
	proxy.addLocalizations();
	
	apicultureConfig = new Configuration();

	Property apiarySideSense = apicultureConfig.get("apiary.sidesensitive", CONFIG_CATEGORY, false);
	apiarySideSense.Comment = "set to false if apiaries should output all items regardless of side a pipe is attached to";
	apiarySideSensitive = Boolean.parseBoolean(apiarySideSense.Value);

	Property breedingMode = apicultureConfig.get("beekeeping.mode", CONFIG_CATEGORY, "NORMAL");
	breedingMode.Comment = "change beekeeping modes here. possible values EASY, NORMAL, HARD, HARDCORE, INSANE. mods may add additional modes.";
	beekeepingMode = breedingMode.Value.trim();
	Proxies.log.finer("Beekeeping mode read from config: " + beekeepingMode);

	Property additionalFlowers = apicultureConfig.get("beekeeping.flowers.custom", CONFIG_CATEGORY, "");
	additionalFlowers.Comment = "add additional flower blocks for apiaries here in the format id:meta. separate blocks using ';'. will be treated like vanilla flowers. not recommended for flowers implemented as tile entities.";
	parseAdditionalFlowers(additionalFlowers.Value, FlowerManager.plainFlowers);

	Property beeBlacklist = apicultureConfig.get("species.blacklist", CONFIG_CATEGORY, "");
	beeBlacklist.Comment = "add species to blacklist identified by their uid and seperated with ';'.";
	parseBeeBlacklist(beeBlacklist.Value);

	apicultureConfig.save();

	createAlleles();
	createMutations();
	registerBeehiveDrops();

	BeeManager.breedingManager.registerBeekeepingMode(BeekeepingMode.easy);
	BeeManager.breedingManager.registerBeekeepingMode(BeekeepingMode.normal);
	BeeManager.breedingManager.registerBeekeepingMode(BeekeepingMode.hard);
	BeeManager.breedingManager.registerBeekeepingMode(BeekeepingMode.hardcore);
	BeeManager.breedingManager.registerBeekeepingMode(BeekeepingMode.insane);

	// Inducers for swarmer
	BeeManager.inducers.put(new ItemStack(ForestryItem.royalJelly), 10);

	registerTemplates();

	definitionApiary.register();
	definitionChest.register();
	GameRegistry.registerTileEntity(TileAlvearyPlain.class, "forestry.Alveary");
	GameRegistry.registerTileEntity(TileSwarm.class, "forestry.Swarm");
	GameRegistry.registerTileEntity(TileAlvearySwarmer.class, "forestry.AlvearySwarmer");
	GameRegistry.registerTileEntity(TileAlvearyHeater.class, "forestry.AlvearyHeater");
	GameRegistry.registerTileEntity(TileAlvearyFan.class, "forestry.AlvearyFan");
	GameRegistry.registerTileEntity(TileAlvearyHygroregulator.class, "forestry.AlvearyHygro");

	BeeManager.villageBees[0].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getForestTemplate()));
	BeeManager.villageBees[0].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getMeadowsTemplate()));
	BeeManager.villageBees[0].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getModestTemplate()));
	BeeManager.villageBees[0].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getMarshyTemplate()));
	BeeManager.villageBees[0].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getWintryTemplate()));
	BeeManager.villageBees[0].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getTropicalTemplate()));

	BeeManager.villageBees[1].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getForestRainResistTemplate()));
	BeeManager.villageBees[1].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getCommonTemplate()));
	BeeManager.villageBees[1].add(BeeManager.beeInterface.templateAsGenome(BeeTemplates.getValiantTemplate()));

	// Register villager stuff
	VillageHandlerApiculture villageHandler = new VillageHandlerApiculture();
	VillagerRegistry.instance().registerVillageCreationHandler(villageHandler);
	VillagerRegistry.instance().registerVillagerType(Defaults.ID_VILLAGER_BEEKEEPER, Defaults.TEXTURE_SKIN_BEEKPEEPER);
	VillagerRegistry.instance().registerVillageTradeHandler(Defaults.ID_VILLAGER_BEEKEEPER, villageHandler);
}
 
開發者ID:ForestryMC,項目名稱:ForestryLegacy,代碼行數:72,代碼來源:PluginForestryApiculture.java


注:本文中的forestry.api.apiculture.FlowerManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。