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


Java Helper类代码示例

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


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

示例1: addFoodInformation

import com.bioxx.tfc.api.Util.Helper; //导入依赖的package包/类
@Override
public void addFoodInformation(ItemStack is, EntityPlayer player, List<String> arraylist)
{
	float ounces = Helper.roundNumber(Food.getWeight(is), 100);
	if (ounces > 0 && ounces <= getMaxFoodWt())
		arraylist.add(TFC_Core.translate("gui.food.amount") + " " + ounces + " oz / " + getMaxFoodWt() + " oz");

	float decay = Food.getDecay(is);
	if (decay > 0)
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + " " + Helper.roundNumber(decay / ounces * 100, 10) + "%");
	if (TFCOptions.enableDebugMode)
	{
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + ": " + decay);
		arraylist.add(EnumChatFormatting.DARK_GRAY + "Decay Rate: " + Helper.roundNumber(getDecayRate(is), 100));
	}

	if (TFC_Core.showCtrlInformation())
		ItemFoodTFC.addTasteInformation(is, player, arraylist);
	else
		arraylist.add(TFC_Core.translate("gui.showtaste"));
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:22,代码来源:ItemTFCFoodTransform.java

示例2: dropFruit

import com.bioxx.tfc.api.Util.Helper; //导入依赖的package包/类
public boolean dropFruit(World world, int x, int y,int z)
{
	if (!world.isRemote)
	{
		int meta = world.getBlockMetadata(x, y, z);
		FloraManager manager = FloraManager.getInstance();
		FloraIndex fi = manager.findMatchingIndex(getTreeType(this, meta));
		
		if (fi != null && (fi.inHarvest(TFC_Time.getSeasonAdjustedMonth(z)) || fi.inHarvest((TFC_Time.getSeasonAdjustedMonth(z) + 11) % 12) && meta > 7))
		{
			TileFruitLeaves te = (TileFruitLeaves) world.getTileEntity(x, y, z);
			if (te != null && te.hasFruit)
			{
				te.hasFruit = false;
				te.dayHarvested = TFC_Time.getTotalDays();
				world.setBlockMetadataWithNotify(x, y, z, meta - 8, 3);
				dropBlockAsItem(world, x, y, z, ItemFoodTFC.createTag(fi.getOutput(), Helper.roundNumber(4 + (world.rand.nextFloat() * 12), 10)));
				return true;
			}
		}
	}
	
	return false;
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:25,代码来源:BlockNutLeaves.java

示例3: oilLampBody

import com.bioxx.tfc.api.Util.Helper; //导入依赖的package包/类
public List<String> oilLampBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
{
    NBTTagCompound tag = accessor.getNBTData();
    if (tag.hasKey("Fuel"))
    {
        FluidStack fuel = FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("Fuel"));
        int hours = fuel.amount * TFCOptions.oilLampFuelMult / 8;
        if (fuel.getFluid() == TFCFluids.OLIVEOIL)
            currenttip.add(hours + " " + TFC_Core.translate("gui.hoursRemaining") + " (" + Helper.roundNumber((hours / (250f * TFCOptions.oilLampFuelMult)) * 100f, 10) + "%)");
        else if (fuel.getFluid() == TFCFluids.LAVA)
            currenttip.add(TFC_Core.translate("gui.infinite") + " " + TFC_Core.translate("gui.hoursRemaining"));
    }
    return currenttip;
}
 
开发者ID:Bunsan,项目名称:TerraFirmaStuff,代码行数:15,代码来源:WAILADataMod.java

示例4: addFoodInformation

import com.bioxx.tfc.api.Util.Helper; //导入依赖的package包/类
public void addFoodInformation(ItemStack is, EntityPlayer player, List<String> arraylist)
{
	float ounces = Helper.roundNumber(Food.getWeight(is), 100);
	if (ounces > 0)
		arraylist.add(TFC_Core.translate("gui.food.amount") + " " + ounces + " oz / " + getFoodMaxWeight(is) + " oz");
	float decay = Food.getDecay(is);
	if (decay > 0)
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + " " + Helper.roundNumber(decay / ounces * 100, 10) + "%");
	if (TFCOptions.enableDebugMode)
	{
		arraylist.add(EnumChatFormatting.DARK_GRAY + TFC_Core.translate("gui.food.decay") + ": " + decay);
		arraylist.add(EnumChatFormatting.DARK_GRAY + "Decay Rate: " + this.getDecayRate(is));
	}

	if (TFC_Core.showCtrlInformation())
		ItemFoodTFC.addTasteInformation(is, player, arraylist);
	else
		arraylist.add(TFC_Core.translate("gui.showtaste"));
	
	if(TFC_Core.showShiftInformation() && Food.getFoodGroups(is).length > 0)
	{			
		int[] fg = Food.getFoodGroups(is);
		for (int i = 0; i < fg.length; i++)
		{
			if (fg[i] != -1)
				arraylist.add(localize(fg[i]));
		}
	}
	else
		arraylist.add(TFC_Core.translate("gui.showIngreds"));
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:32,代码来源:ItemTFCMealTransform.java


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