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