本文整理汇总了Java中net.minecraft.util.StringUtils.ticksToElapsedTime方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.ticksToElapsedTime方法的具体用法?Java StringUtils.ticksToElapsedTime怎么用?Java StringUtils.ticksToElapsedTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.ticksToElapsedTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addBrewTooltip
import net.minecraft.util.StringUtils; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void addBrewTooltip(ItemStack stack, List<String> tooltip) {
List<BrewEffect> brewsFromStack = BrewUtils.getBrewsFromStack(stack);
for (BrewEffect effect : brewsFromStack) {
IBrew brew = effect.getBrew();
String name = " - " + I18n.format("brew." + brew.getName() + ".tooltip") + " ";
String amplifier = (effect.getAmplifier() <= 0) ? "" : (RomanNumber.getRoman(effect.getAmplifier())) + " ";
String duration = effect.isInstant() ? I18n.format("brew.instant") : StringUtils.ticksToElapsedTime(effect.getDuration());
tooltip.add(TextFormatting.DARK_AQUA + "" + TextFormatting.ITALIC + name + amplifier + "(" + duration + ")");
}
if (brewsFromStack.isEmpty()) {
tooltip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + "---");
}
}
示例2: getDurationString
import net.minecraft.util.StringUtils; //导入方法依赖的package包/类
public static String getDurationString(PotionEffect effect)
{
if (effect.getIsPotionDurationMax())
{
return "**:**";
}
else
{
int i = effect.getDuration();
return StringUtils.ticksToElapsedTime(i);
}
}
示例3: getPotionDurationString
import net.minecraft.util.StringUtils; //导入方法依赖的package包/类
public static String getPotionDurationString(PotionEffect p_188410_0_, float p_188410_1_)
{
if (p_188410_0_.getIsPotionDurationMax())
{
return "**:**";
}
else
{
int i = MathHelper.floor((float)p_188410_0_.getDuration() * p_188410_1_);
return StringUtils.ticksToElapsedTime(i);
}
}
示例4: getPotionDurationString
import net.minecraft.util.StringUtils; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static String getPotionDurationString(PotionEffect p_188410_0_, float p_188410_1_)
{
if (p_188410_0_.getIsPotionDurationMax())
{
return "**:**";
}
else
{
int i = MathHelper.floor_float((float)p_188410_0_.getDuration() * p_188410_1_);
return StringUtils.ticksToElapsedTime(i);
}
}