diff --git a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/VaultItemsHandler.java b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/VaultItemsHandler.java index 0bec0ce7..ff63c87b 100644 --- a/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/VaultItemsHandler.java +++ b/src/main/java/de/erdbeerbaerlp/dcintegration/forge/util/VaultItemsHandler.java @@ -364,7 +364,7 @@ public static void handleInscriptionTooltip(EmbedBuilder builder, ItemStack item appendDescription(Math.round(compoundTag.getFloat("completion") * 100.0F) + "%"). appendDescription("\n"); builder.appendDescription("**Time:** "). - appendDescription(UIHelper.formatTimeString(compoundTag.getInt("time"))). + appendDescription(formatTimeString(compoundTag.getInt("time"))). appendDescription("\n"); builder.appendDescription("**Instability:** "). appendDescription(Math.round(compoundTag.getInt("instability") * 100.0F) + "%"). @@ -955,6 +955,21 @@ private static void parseModifiers(EmbedBuilder builder, CrystalModifiers modifi } + /** + * Time parser + * @param remainingTicks how many ticks remaining + * @return remaining ticks parsed as string. + */ + private static String formatTimeString(int remainingTicks) + { + long seconds = remainingTicks / 20 % 60; + long minutes = remainingTicks / 20 / 60 % 60; + long hours = remainingTicks / 20 / 60 / 60; + return hours > 0L ? String.format("%02d:%02d:%02d", hours, minutes, seconds) : + String.format("%02d:%02d", minutes, seconds); + } + + // --------------------------------------------------------------------- // Section: Variables // ---------------------------------------------------------------------