diff --git a/CHANGELOG.md b/CHANGELOG.md index f10f4cf..78c75c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 0.2 - Added fluid pipes (raoulvdberge) +- Improved tooltips (raoulvdberge) ## 0.1.4 - Added hitboxes for the attachments on pipes (raoulvdberge) diff --git a/src/main/java/com/raoulvdberge/refinedpipes/item/FluidPipeBlockItem.java b/src/main/java/com/raoulvdberge/refinedpipes/item/FluidPipeBlockItem.java index 6af763e..7277e53 100644 --- a/src/main/java/com/raoulvdberge/refinedpipes/item/FluidPipeBlockItem.java +++ b/src/main/java/com/raoulvdberge/refinedpipes/item/FluidPipeBlockItem.java @@ -4,10 +4,7 @@ import com.raoulvdberge.refinedpipes.network.pipe.fluid.FluidPipeType; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.Style; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.util.text.*; import net.minecraft.world.World; import javax.annotation.Nullable; @@ -26,6 +23,13 @@ public FluidPipeBlockItem(FluidPipeBlock block) { public void addInformation(ItemStack stack, @Nullable World world, List tooltip, ITooltipFlag flag) { super.addInformation(stack, world, tooltip, flag); - tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.GRAY))); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.YELLOW))); + + tooltip.add(new TranslationTextComponent( + "tooltip.refinedpipes.fluid_pipe.capacity", + new StringTextComponent("" + type.getCapacity()).setStyle(new Style().setColor(TextFormatting.WHITE)) + ).setStyle(new Style().setColor(TextFormatting.GRAY))); + + tooltip.add(new TranslationTextComponent("tooltip.refinedpipes.fluid_pipe.speed").setStyle(new Style().setColor(TextFormatting.GRAY))); } } diff --git a/src/main/java/com/raoulvdberge/refinedpipes/item/ItemPipeBlockItem.java b/src/main/java/com/raoulvdberge/refinedpipes/item/ItemPipeBlockItem.java index 8391345..d2c2af7 100644 --- a/src/main/java/com/raoulvdberge/refinedpipes/item/ItemPipeBlockItem.java +++ b/src/main/java/com/raoulvdberge/refinedpipes/item/ItemPipeBlockItem.java @@ -4,10 +4,7 @@ import com.raoulvdberge.refinedpipes.network.pipe.item.ItemPipeType; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.Style; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.util.text.*; import net.minecraft.world.World; import javax.annotation.Nullable; @@ -26,6 +23,11 @@ public ItemPipeBlockItem(ItemPipeBlock block) { public void addInformation(ItemStack stack, @Nullable World world, List tooltip, ITooltipFlag flag) { super.addInformation(stack, world, tooltip, flag); - tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.GRAY))); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.getTier())).setStyle(new Style().setColor(TextFormatting.YELLOW))); + + tooltip.add(new TranslationTextComponent( + "tooltip.refinedpipes.item_pipe.speed", + new StringTextComponent("" + type.getSpeedComparedToBasicTier()).setStyle(new Style().setColor(TextFormatting.WHITE)) + ).setStyle(new Style().setColor(TextFormatting.GRAY))); } } diff --git a/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentType.java b/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentType.java index 4c208d6..e6e5d90 100644 --- a/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentType.java +++ b/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachmentType.java @@ -22,10 +22,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.Style; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.util.text.*; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; @@ -83,7 +80,19 @@ public void update(World world, Network network, Pipe pipe, Attachment attachmen @Override public void addInformation(List tooltip) { - tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.tier)).setStyle(new Style().setColor(TextFormatting.GRAY))); + tooltip.add(new TranslationTextComponent("misc.refinedpipes.tier", new TranslationTextComponent("enchantment.level." + type.tier)).setStyle(new Style().setColor(TextFormatting.YELLOW))); + + tooltip.add(new TranslationTextComponent( + "tooltip.refinedpipes.extractor_attachment.item_extraction_rate", + new StringTextComponent("" + type.getItemsToExtract()).setStyle(new Style().setColor(TextFormatting.WHITE)), + new StringTextComponent("" + (float) type.getItemTickInterval() / 20F).setStyle(new Style().setColor(TextFormatting.WHITE)) + ).setStyle(new Style().setColor(TextFormatting.GRAY))); + + tooltip.add(new TranslationTextComponent( + "tooltip.refinedpipes.extractor_attachment.fluid_extraction_rate", + new StringTextComponent("" + type.getFluidsToExtract()).setStyle(new Style().setColor(TextFormatting.WHITE)), + new StringTextComponent("" + (float) type.getFluidTickInterval() / 20F).setStyle(new Style().setColor(TextFormatting.WHITE)) + ).setStyle(new Style().setColor(TextFormatting.GRAY))); } private void update(Network network, Pipe pipe, Attachment attachment, BlockPos sourcePos, IItemHandler source) { diff --git a/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/item/ItemPipeType.java b/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/item/ItemPipeType.java index ba744ba..d585ea0 100644 --- a/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/item/ItemPipeType.java +++ b/src/main/java/com/raoulvdberge/refinedpipes/network/pipe/item/ItemPipeType.java @@ -34,6 +34,17 @@ public int getMaxTicksInPipe() { } } + public int getSpeedComparedToBasicTier() { + int mySpeed = this == BASIC ? getMaxTicksInPipe() : + (this == IMPROVED ? BASIC.getMaxTicksInPipe() + getMaxTicksInPipe() : + (this == ADVANCED ? BASIC.getMaxTicksInPipe() + IMPROVED.getMaxTicksInPipe() + getMaxTicksInPipe() : + 0)); + + int speedOfBasicTier = BASIC.getMaxTicksInPipe(); + + return (int) ((float) mySpeed / (float) speedOfBasicTier * 100F); + } + public TileEntityType getTileType() { switch (this) { case BASIC: diff --git a/src/main/resources/assets/refinedpipes/lang/en_us.json b/src/main/resources/assets/refinedpipes/lang/en_us.json index 3d53d72..62d7cac 100644 --- a/src/main/resources/assets/refinedpipes/lang/en_us.json +++ b/src/main/resources/assets/refinedpipes/lang/en_us.json @@ -11,5 +11,10 @@ "item.refinedpipes.advanced_extractor_attachment": "Advanced Extractor Attachment", "item.refinedpipes.elite_extractor_attachment": "Elite Extractor Attachment", "item.refinedpipes.ultimate_extractor_attachment": "Ultimate Extractor Attachment", - "misc.refinedpipes.tier": "Tier %s" + "misc.refinedpipes.tier": "Tier %s", + "tooltip.refinedpipes.fluid_pipe.capacity": "Capacity: %d mB", + "tooltip.refinedpipes.item_pipe.speed": "Speed: %d%%", + "tooltip.refinedpipes.fluid_pipe.speed": "Speed varies by fluid.", + "tooltip.refinedpipes.extractor_attachment.item_extraction_rate": "Extracts %d item(s) every %d second(s).", + "tooltip.refinedpipes.extractor_attachment.fluid_extraction_rate": "Extracts %d mB every %d second(s)." } \ No newline at end of file