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


Java Global类代码示例

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


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

示例1: generate

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
	chunkX *= 16;
	chunkZ *= 16;

	if (world.getBiomeGenForCoords(chunkX, chunkZ) instanceof TFCBiome) // Fixes ClassCastException
	{
		TFCBiome biome = (TFCBiome) world.getBiomeGenForCoords(chunkX, chunkZ);
		if (biome == TFCBiome.OCEAN || biome == TFCBiome.DEEP_OCEAN)
			return;

		tl0 = TFC_Climate.getTreeLayer(world, chunkX, Global.SEALEVEL, chunkZ, 0);
		tl1 = TFC_Climate.getTreeLayer(world, chunkX, Global.SEALEVEL, chunkZ, 1);
		tl2 = TFC_Climate.getTreeLayer(world, chunkX, Global.SEALEVEL, chunkZ, 2);
		// If at least one tree layer present, otherwise no Heveas
		if (tl0 == -1 && tl1 == -1 && tl2 == -1)
			return; 
		
		rainfall = TFC_Climate.getRainfall(world, chunkX, 0, chunkZ);
		evt = TFC_Climate.getCacheManager(world).getEVTLayerAt(chunkX + 8, chunkZ + 8).floatdata1;
		generateTree(random, chunkX, chunkZ, world);
	}
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:24,代码来源:WorldGenHevea.java

示例2: generateTree

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
private void generateTree(Random random, int chunkX, int chunkZ, World world) {
	WorldGenerator gen = new WorldGenHeveaTree();
	int xCoord = chunkX;
	int yCoord = Global.SEALEVEL + 1;
	int zCoord = chunkZ;

	int numTrees = 1;
	if (random.nextInt(20) == 0)
		numTrees += random.nextInt(3);

	for (int var2 = 0; var2 < numTrees; ++var2) {
		xCoord = chunkX + random.nextInt(16);
		zCoord = chunkZ + random.nextInt(16);
		yCoord = world.getHeightValue(xCoord, zCoord);

		temperature = TFC_Climate.getBioTemperatureHeight(world, xCoord, world.getHeightValue(xCoord, zCoord), zCoord);

		int spawnChance = this.treeSpawnChance();
		if (random.nextInt(100) < spawnChance) {
			gen.generate(world, random, xCoord, yCoord, zCoord);
		}
	}
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:24,代码来源:WorldGenHevea.java

示例3: updateCurrentAlloy

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
private void updateCurrentAlloy() {
	List<AlloyMetal> a = new ArrayList<AlloyMetal>();
	Iterator<MetalPair> iter = metals.values().iterator();
	float totalAmount = getTotalMetal();
	iter = metals.values().iterator();
	while (iter.hasNext()) {
		MetalPair m = iter.next();
		if (m != null)
			a.add(new AlloyMetal(m.type, (m.amount / totalAmount) * 100f));
	}
	
	Metal match = AlloyManager.INSTANCE.matchesAlloy(a, Alloy.EnumTier.TierV);
	if (match != null) {
		currentAlloy = new Alloy(match, totalAmount);
		currentAlloy.alloyIngred = a;
	} else {
		currentAlloy = new Alloy(Global.UNKNOWN, totalAmount);
		currentAlloy.alloyIngred = a;
	}
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:21,代码来源:TEInductionSmelter.java

示例4: getOreData

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
private static OreSpawnData getOreData(String category, String type, String size, String blockName, int meta, int rarity, String[] rocks, int min, int max, int v, int h)
{
	oresConfig = TFC_ConfigFiles.getOresConfig();
	String[] ALLOWED_TYPES = new String[] { "default", "veins" };
	String[] ALLOWED_SIZES = new String[] { "small", "medium", "large" };
	String[] ALLOWED_BASE_ROCKS = ObjectArrays.concat(Global.STONE_ALL, new String[] { "igneous intrusive", "igneous extrusive", "sedimentary", "metamorphic" }, String.class);
	
	return new OreSpawnData(
			oresConfig.get(category, "type", type).setValidValues(ALLOWED_TYPES).getString(),
			oresConfig.get(category, "size", size).setValidValues(ALLOWED_SIZES).getString(),
			oresConfig.get(category, "oreName", blockName).getString(),
			oresConfig.get(category, "oreMeta", meta).getInt(),
			oresConfig.get(category, "rarity", rarity).getInt(),
			oresConfig.get(category, "baseRocks", rocks).setValidValues(ALLOWED_BASE_ROCKS).getStringList(),
			oresConfig.get(category, "Minimum Height", min).getInt(),
			oresConfig.get(category, "Maximum Height", max).getInt(),
			oresConfig.get(category, "Vertical Density", v).getInt(),
			oresConfig.get(category, "Horizontal Density", h).getInt()
	);
}
 
开发者ID:StrayWolfe,项目名称:TerrafirmaPunk-Tweaks,代码行数:21,代码来源:CommonProxy.java

示例5: getMetalType

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
@Override
public Metal getMetalType(ItemStack is) {
    int meta = is.getItemDamage();
    switch (meta) {
        case 0:
            return Global.PIGIRON;
        case 1:
            return Global.STEEL;
        case 2:
            return Global.TIN;
        case 3:
            return Global.ZINC;

        default:
            return Global.UNKNOWN;
    }
}
 
开发者ID:Bunsan,项目名称:TerraFirmaStuff,代码行数:18,代码来源:ItemOilLampMod3.java

示例6: getMetalType

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
@Override
public Metal getMetalType(ItemStack is)
{
    int meta = is.getItemDamage();
    switch(meta)
    {
        case 0: return Global.BISMUTHBRONZE;
        case 1: return Global.BLACKBRONZE;
        case 2: return Global.BLACKSTEEL;
        case 3: return Global.BRASS;
        case 4: return Global.BRONZE;
        case 5: return Global.REDSTEEL;

        default : return Global.UNKNOWN;
    }
}
 
开发者ID:Bunsan,项目名称:TerraFirmaStuff,代码行数:17,代码来源:ItemOilLampMod.java

示例7: getMetalType

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
@Override
public Metal getMetalType(ItemStack is) {
    int meta = is.getItemDamage();
    switch (meta) {
        case 0:
            return Global.BISMUTH;
        case 1:
            return Global.COPPER;
        case 2:
            return Global.WROUGHTIRON;
        case 3:
            return Global.LEAD;
        case 4:
            return Global.NICKEL;
        case 5:
            return Global.UNKNOWN;

        default:
            return Global.UNKNOWN;
    }
}
 
开发者ID:Bunsan,项目名称:TerraFirmaStuff,代码行数:22,代码来源:ItemOilLampMod2.java

示例8: BlockMudBricks

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
public BlockMudBricks(int startIndex)
{
    super(Material.ground);
    
    this.setHardness(3f);
    this.setResistance(10.0f);
    this.setHarvestLevel("pickaxe", 0);
    this.setCreativeTab(TFCTabs.TFC_BUILDING);
    
    _startIndex = startIndex;
    
    int count = _startIndex == 0 ? 16: Global.STONE_ALL.length - _startIndex;
    
    this.names = new String[count];
    this.icons = new IIcon[count];
}
 
开发者ID:Aleksey-Terzi,项目名称:DecorationsTFC,代码行数:17,代码来源:BlockMudBricks.java

示例9: registerMudBrickRecipes

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
private static void registerMudBrickRecipes()
{
    for(int i = 0; i < 16; i++)
    {
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[i], 1, 0), new Object[] { new ItemStack(TFCBlocks.dirt, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[i], 1, 0), new Object[] { new ItemStack(TFCBlocks.sand, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
    }
        
    for(int i = 0; i < Global.STONE_ALL.length - 16; i++)
    {
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[16 + i], 1, 0), new Object[] { new ItemStack(TFCBlocks.dirt2, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
        GameRegistry.addShapelessRecipe(new ItemStack(BlockList.MudBrickRaws[16 + i], 1, 0), new Object[] { new ItemStack(TFCBlocks.sand2, 1, i), new ItemStack(TFCItems.clayBall, 1, 0), new ItemStack(TFCItems.straw) });
    }

    for(int i = 0; i < 16; i++)
        GameRegistry.addRecipe(new ItemStack(BlockList.MudBricks, 4, i), new Object[] { "mm", "mm", Character.valueOf('m'), new ItemStack(BlockList.MudBrickRaws[i], 1, 1) });
        
    for(int i = 0; i < Global.STONE_ALL.length - 16; i++)
        GameRegistry.addRecipe(new ItemStack(BlockList.MudBricks2, 4, i), new Object[] { "mm", "mm", Character.valueOf('m'), new ItemStack(BlockList.MudBrickRaws[16 + i], 1, 1) });
}
 
开发者ID:Aleksey-Terzi,项目名称:DecorationsTFC,代码行数:21,代码来源:Recipes.java

示例10: registerAnvilRecipes

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
public static void registerAnvilRecipes(World world)
{
    if(!DecorationsMod.isLanternsEnabled)
        return;
    
    AnvilManager manager = AnvilManager.getInstance();
    //We need to set the world ref so that all anvil recipes can generate correctly
    AnvilManager.world = world;
    
    manager.addPlan(_lanternCorePlan, new PlanRecipe(new RuleEnum[] { RuleEnum.HITLAST, RuleEnum.PUNCHNOTLAST, RuleEnum.HITNOTLAST }));
    
    for(int i = 0; i < Constants.Lanterns.length; i++)
    {
        LanternInfo info = Constants.Lanterns[i];
        Item sheetItem = GameRegistry.findItem("terrafirmacraft", info.SheetName);            
        ItemStack lanternCore = new ItemStack(ItemList.LanternCores[i], 1, 0);

        manager.addRecipe(new AnvilRecipe(new ItemStack(sheetItem), null, _lanternCorePlan, false, info.Anvil, lanternCore).addRecipeSkill(Global.SKILL_GENERAL_SMITHING));
    }
}
 
开发者ID:Aleksey-Terzi,项目名称:DecorationsTFC,代码行数:21,代码来源:Recipes.java

示例11: registerAnvilRecipes

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
public static void registerAnvilRecipes() {
	String iceSawPlan = "icesaw";
	
	Map map = AnvilManager.getInstance().getPlans();
	if(map.containsKey(iceSawPlan)) {
		return;
	}
	
	if(AnvilManager.world == null) {
		return;
	}
	
	AnvilManager manager = AnvilManager.getInstance();
	manager.addPlan(iceSawPlan, new PlanRecipe(new RuleEnum[]{RuleEnum.HITLAST, RuleEnum.UPSETSECONDFROMLAST, RuleEnum.DRAWNOTLAST}));
	
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.bismuthBronzeIngot2x), null, iceSawPlan, false, AnvilReq.BISMUTHBRONZE, new ItemStack(BismuthBronzeIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.blackBronzeIngot2x), null, iceSawPlan, false, AnvilReq.BLACKBRONZE, new ItemStack(BlackBronzeIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.blackSteelIngot2x), null, iceSawPlan, false, AnvilReq.BLACKSTEEL, new ItemStack(BlackSteelIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.blueSteelIngot2x), null, iceSawPlan, false, AnvilReq.BLUESTEEL, new ItemStack(BlueSteelIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.bronzeIngot2x), null, iceSawPlan, false, AnvilReq.BRONZE, new ItemStack(BronzeIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.copperIngot2x), null, iceSawPlan, false, AnvilReq.COPPER, new ItemStack(CopperIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.wroughtIronIngot2x), null, iceSawPlan, false, AnvilReq.WROUGHTIRON, new ItemStack(WroughtIronIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.redSteelIngot2x), null, iceSawPlan, false, AnvilReq.REDSTEEL, new ItemStack(RedSteelIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
	manager.addRecipe(new AnvilRecipe(new ItemStack(TFCItems.steelIngot2x), null, iceSawPlan, false, AnvilReq.STEEL, new ItemStack(SteelIceSawHead, 1)).addRecipeSkill(Global.SKILL_TOOLSMITH));
}
 
开发者ID:Sladki,项目名称:TFC-Cellars-Addon,代码行数:26,代码来源:ModManager.java

示例12: generateTrees

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
private void generateTrees(Random random, int chunkX, int chunkZ, World world)
{
	int xCoord = chunkX;
	int yCoord = Global.SEALEVEL + 1;
	int zCoord = chunkZ;

	WorldGenerator worldGen = new WorldGenShortTrees(false, 0);
	int numTrees = 1;
	
	if (random.nextInt(20) == 0)
		numTrees += random.nextInt(3);
	
	for (int var2 = 0; var2 < numTrees; ++var2) 
	{
		xCoord = chunkX + random.nextInt(16);
		zCoord = chunkZ + random.nextInt(16);
		yCoord = world.getTopSolidOrLiquidBlock(xCoord, zCoord);			
		temperature = TFC_Climate.getBioTemperatureHeight(world, xCoord, yCoord, zCoord);
		
		if (shouldtreeSpawn(random, 0.25f, 2, 250f, 1200f, 5, 25, 100))
			worldGen.generate(world, random, xCoord, yCoord, zCoord);
	}
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:24,代码来源:WorldGenTrees.java

示例13: registerCokeOven

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
private void registerCokeOven() {
	removeRecipe(EnumMachineAlpha.COKE_OVEN.getItem());
	
	GameRegistry.addRecipe(new ShapedOreRecipe(EnumMachineAlpha.COKE_OVEN
			.getItem(1), new Object[] { "sbs", "bsb", "sbs",
			Character.valueOf('s'), "blockSand", Character.valueOf('b'),
			new ItemStack(TFCItems.fireBrick, 1, 1) }));

	if (RailcraftToolItems.getCoalCoke() != null) {
		for (int i = 0; i < Global.WOOD_ALL.length; i++) {
			RailcraftCraftingManager.cokeOven.addRecipe(new ItemStack(
					TFCItems.logs, 1, i), true, false, new ItemStack(
					TFCItems.coal, 1, 1), Fluids.CREOSOTE
					.get(COKE_COOK_CREOSOTE), COKE_COOK_TIME);
		}
	}
}
 
开发者ID:vidaj,项目名称:TFCRailcraft,代码行数:18,代码来源:RecipeManager.java

示例14: registerMetals

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
private static void registerMetals() {
	
	// Aluminum
	Globals.ALUMINUM = new Metal("Aluminum", ModItems.aluminumUnshaped, ModItems.aluminumIngot);
	MetalRegistry.instance.addMetal(Globals.ALUMINUM, Alloy.EnumTier.TierI);
	
	// Electrum
	Globals.ELECTRUM = new Metal("Electrum", ModItems.electrumUnshaped, ModItems.electrumIngot);
	MetalRegistry.instance.addMetal(Globals.ELECTRUM, Alloy.EnumTier.TierI);
	
	// Constantan
	Globals.CONSTANTAN = new Metal("Constantan", ModItems.constantanUnshaped, ModItems.constantanIngot);
	MetalRegistry.instance.addMetal(Globals.CONSTANTAN, Alloy.EnumTier.TierI);
	
	// Invar
	Globals.INVAR = new Metal("Invar", ModItems.invarUnshaped, ModItems.invarIngot);
	MetalRegistry.instance.addMetal(Globals.INVAR, Alloy.EnumTier.TierIII);
	
	// Red Alloy
	Globals.REDALLOY = new Metal("Red Alloy", ModItems.redAlloyUnshaped, ModItems.redAlloyIngot);
	MetalRegistry.instance.addMetal(Globals.REDALLOY, Alloy.EnumTier.TierV);
	
	Alloy electrum = new Alloy(Globals.ELECTRUM, Alloy.EnumTier.TierI);
	electrum.addIngred(Global.GOLD, 37.00f, 63.00f);
	electrum.addIngred(Global.SILVER, 37.00f, 63.00f);
	AlloyManager.INSTANCE.addAlloy(electrum);
	
	Alloy constantan = new Alloy(Globals.CONSTANTAN, Alloy.EnumTier.TierI);
	constantan.addIngred(Global.COPPER, 55.00f, 65.00f);
	constantan.addIngred(Global.NICKEL, 35.00f, 45.00f);
	AlloyManager.INSTANCE.addAlloy(constantan);
	
	Alloy invar = new Alloy(Globals.INVAR, Alloy.EnumTier.TierIII);
	invar.addIngred(Global.WROUGHTIRON, 60.00f, 70.00f);
	invar.addIngred(Global.NICKEL, 30.00f, 40.00f);
	AlloyManager.INSTANCE.addAlloy(invar);
	
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:39,代码来源:ModItems.java

示例15: WireDrawBenchRecipe

import com.bioxx.tfc.api.Constant.Global; //导入依赖的package包/类
/**
 * @param inIS - Input ItemStack
 * @param outIS - Output ItemStack
 * @param req - Drawplate requirement
 * @param oil - Is oiling required
 */
public WireDrawBenchRecipe(ItemStack inIS, ItemStack outIS, DrawplateReq req, boolean oil) {
	this.inItemStack = inIS;
	this.outItemStack = outIS;
	this.drawplateReq = req.Tier;
	this.oilRequired = oil;
	skillsList.add(Global.SKILL_GENERAL_SMITHING);
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:14,代码来源:WireDrawBenchRecipe.java


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