本文整理匯總了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);
}
}