From db2e3f6a0d201763bf3024c763bdd36bb1bdc99f Mon Sep 17 00:00:00 2001 From: Zereff06 Date: Thu, 28 Mar 2024 22:12:21 +0200 Subject: [PATCH 1/3] fix gui for apiary and greenhouse * do not display lines in gui where products are 0 * added colors and useful numbers: how many products are produced and how much is it in seconds * bs --- ...ileEntity_ExtremeIndustrialGreenhouse.java | 27 ++++++++++++------- ...T_MetaTileEntity_MegaIndustrialApiary.java | 27 ++++++++++++------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java index b94ceca8..909d2167 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java @@ -870,18 +870,25 @@ protected String generateCurrentRecipeInfoString() { .append("%)\n"); for (Map.Entry drop : GUIDropProgress.entrySet()) { - ret.append( - drop.getKey() - .getDisplayName()) - .append(": ") + int outputSize = Arrays.stream(mOutputItems) + .filter(s -> s.isItemEqual(drop.getKey())) + .mapToInt(i -> i.stackSize) + .sum(); + if (outputSize == 0) continue; + + ret.append(EnumChatFormatting.AQUA) + .append( + drop.getKey() + .getDisplayName()) + .append(EnumChatFormatting.WHITE) + .append(": "); + ret.append(EnumChatFormatting.GOLD) .append( String.format( - "%.2f (+%d)\n", - drop.getValue(), - Arrays.stream(mOutputItems) - .filter(s -> s.isItemEqual(drop.getKey())) - .mapToInt(i -> i.stackSize) - .sum())); + "x%d %s(+%.2f/sec)\n", + outputSize, + EnumChatFormatting.WHITE, + (double) outputSize / (mMaxProgresstime / 20))); } return ret.toString(); diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java index 0a0027e0..11e82b67 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java @@ -900,18 +900,25 @@ protected String generateCurrentRecipeInfoString() { .append("%)\n"); for (Map.Entry drop : GUIDropProgress.entrySet()) { - ret.append( - drop.getKey() - .getDisplayName()) - .append(": ") + int outputSize = Arrays.stream(mOutputItems) + .filter(s -> s.isItemEqual(drop.getKey())) + .mapToInt(i -> i.stackSize) + .sum(); + if (outputSize == 0) continue; + + ret.append(EnumChatFormatting.AQUA) + .append( + drop.getKey() + .getDisplayName()) + .append(EnumChatFormatting.WHITE) + .append(": "); + ret.append(EnumChatFormatting.GOLD) .append( String.format( - "%.2f (+%d)\n", - drop.getValue(), - Arrays.stream(mOutputItems) - .filter(s -> s.isItemEqual(drop.getKey())) - .mapToInt(i -> i.stackSize) - .sum())); + "x%d %s(+%.2f/sec)\n", + outputSize, + EnumChatFormatting.WHITE, + (double) outputSize / (mMaxProgresstime / 20))); } return ret.toString(); From 7f64115907207bb1770239efed1f443968024992 Mon Sep 17 00:00:00 2001 From: Zereff06 Date: Fri, 29 Mar 2024 22:04:30 +0200 Subject: [PATCH 2/3] add percentage display --- ...ileEntity_ExtremeIndustrialGreenhouse.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java index 909d2167..4548e1ad 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java @@ -874,21 +874,24 @@ protected String generateCurrentRecipeInfoString() { .filter(s -> s.isItemEqual(drop.getKey())) .mapToInt(i -> i.stackSize) .sum(); - if (outputSize == 0) continue; - ret.append(EnumChatFormatting.AQUA) .append( drop.getKey() .getDisplayName()) .append(EnumChatFormatting.WHITE) .append(": "); - ret.append(EnumChatFormatting.GOLD) - .append( - String.format( - "x%d %s(+%.2f/sec)\n", - outputSize, - EnumChatFormatting.WHITE, - (double) outputSize / (mMaxProgresstime / 20))); + if (outputSize == 0) { + ret.append(String.format("%.2f", drop.getValue() * 100)) + .append("%\n"); + } else { + ret.append(EnumChatFormatting.GOLD) + .append( + String.format( + "x%d %s(+%.2f/sec)\n", + outputSize, + EnumChatFormatting.WHITE, + (double) outputSize / (mMaxProgresstime / 20))); + } } return ret.toString(); From e0a4eb7ebf1688c46d8c5ec755110d6950c1cf5c Mon Sep 17 00:00:00 2001 From: Zereff06 Date: Fri, 29 Mar 2024 22:17:48 +0200 Subject: [PATCH 3/3] add percentage display for mega apiary --- ...T_MetaTileEntity_MegaIndustrialApiary.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java index 11e82b67..8a8dd6d4 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java @@ -904,21 +904,24 @@ protected String generateCurrentRecipeInfoString() { .filter(s -> s.isItemEqual(drop.getKey())) .mapToInt(i -> i.stackSize) .sum(); - if (outputSize == 0) continue; - ret.append(EnumChatFormatting.AQUA) .append( drop.getKey() .getDisplayName()) .append(EnumChatFormatting.WHITE) .append(": "); - ret.append(EnumChatFormatting.GOLD) - .append( - String.format( - "x%d %s(+%.2f/sec)\n", - outputSize, - EnumChatFormatting.WHITE, - (double) outputSize / (mMaxProgresstime / 20))); + if (outputSize == 0) { + ret.append(String.format("%.2f", drop.getValue() * 100)) + .append("%\n"); + } else { + ret.append(EnumChatFormatting.GOLD) + .append( + String.format( + "x%d %s(+%.2f/sec)\n", + outputSize, + EnumChatFormatting.WHITE, + (double) outputSize / (mMaxProgresstime / 20))); + } } return ret.toString();