diff --git a/src/main/java/com/simibubi/create/ClientEvents.java b/src/main/java/com/simibubi/create/ClientEvents.java index 4ea8402b6..040ae527d 100644 --- a/src/main/java/com/simibubi/create/ClientEvents.java +++ b/src/main/java/com/simibubi/create/ClientEvents.java @@ -5,8 +5,8 @@ import java.util.List; import com.simibubi.create.foundation.block.IBlockWithScrollableValue; import com.simibubi.create.foundation.gui.ScreenOpener; +import com.simibubi.create.foundation.item.TooltipHelper; import com.simibubi.create.foundation.utility.AnimationTickHolder; -import com.simibubi.create.foundation.utility.TooltipHelper; import com.simibubi.create.modules.contraptions.KineticDebugger; import com.simibubi.create.modules.contraptions.base.IRotate; import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer; @@ -129,9 +129,11 @@ public class ClientEvents { return; if (TooltipHelper.hasTooltip(stack)) { + List itemTooltip = event.getToolTip(); List toolTip = new ArrayList<>(); + toolTip.add(itemTooltip.remove(0)); TooltipHelper.getTooltip(stack).addInformation(toolTip); - event.getToolTip().addAll(1, toolTip); + itemTooltip.addAll(0, toolTip); } } diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 337594506..ed7501d63 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -1,9 +1,9 @@ package com.simibubi.create; -import com.simibubi.create.foundation.world.OreGeneration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import com.simibubi.create.foundation.world.OreGeneration; import com.simibubi.create.modules.ModuleLoadedCondition; import com.simibubi.create.modules.contraptions.TorquePropagator; import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MovingConstructHandler; @@ -25,7 +25,6 @@ import net.minecraft.village.PointOfInterestType; import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.config.ModConfig; diff --git a/src/main/java/com/simibubi/create/foundation/utility/ItemDescription.java b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java similarity index 97% rename from src/main/java/com/simibubi/create/foundation/utility/ItemDescription.java rename to src/main/java/com/simibubi/create/foundation/item/ItemDescription.java index 5b86469d4..b2269db2d 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/ItemDescription.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java @@ -1,7 +1,7 @@ -package com.simibubi.create.foundation.utility; +package com.simibubi.create.foundation.item; import static com.simibubi.create.CreateConfig.parameters; -import static com.simibubi.create.foundation.utility.TooltipHelper.cutString; +import static com.simibubi.create.foundation.item.TooltipHelper.cutString; import static net.minecraft.util.text.TextFormatting.AQUA; import static net.minecraft.util.text.TextFormatting.BLUE; import static net.minecraft.util.text.TextFormatting.DARK_GRAY; @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.modules.contraptions.base.IRotate; import com.simibubi.create.modules.contraptions.base.IRotate.SpeedLevel; import com.simibubi.create.modules.contraptions.base.IRotate.StressImpact; @@ -68,7 +69,7 @@ public class ItemDescription { linesOnShift = new ArrayList<>(); linesOnCtrl = new ArrayList<>(); } - + public ItemDescription withSummary(String summary) { add(linesOnShift, cutString(summary, palette.color, palette.hColor)); add(linesOnShift, ""); diff --git a/src/main/java/com/simibubi/create/foundation/utility/ItemHelper.java b/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java similarity index 96% rename from src/main/java/com/simibubi/create/foundation/utility/ItemHelper.java rename to src/main/java/com/simibubi/create/foundation/item/ItemHelper.java index ae91f1ba7..93fb54d8f 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/ItemHelper.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemHelper.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.utility; +package com.simibubi.create.foundation.item; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/simibubi/create/foundation/utility/TooltipHelper.java b/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java similarity index 93% rename from src/main/java/com/simibubi/create/foundation/utility/TooltipHelper.java rename to src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java index 9232a4ee7..a2aa10a21 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/TooltipHelper.java +++ b/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.utility; +package com.simibubi.create.foundation.item; import static net.minecraft.util.text.TextFormatting.DARK_GRAY; @@ -8,7 +8,8 @@ import java.util.List; import java.util.Map; import com.mojang.bridge.game.Language; -import com.simibubi.create.foundation.utility.ItemDescription.Palette; +import com.simibubi.create.foundation.item.ItemDescription.Palette; +import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.modules.IModule; import com.simibubi.create.modules.contraptions.base.IRotate; @@ -110,6 +111,9 @@ public class TooltipHelper { private static ItemDescription buildToolTip(String translationKey, ItemStack stack) { IModule module = IModule.of(stack); + if (I18n.format(translationKey).equals("WIP")) + return new WipScription(module.getToolTipColor()); + ItemDescription tooltip = new ItemDescription(module.getToolTipColor()); String summaryKey = translationKey + ".summary"; @@ -147,7 +151,7 @@ public class TooltipHelper { } public static String getTooltipTranslationKey(ItemStack stack) { - return stack.getItem().getTranslationKey() + ".tooltip"; + return stack.getItem().getTranslationKey(stack) + ".tooltip"; } } diff --git a/src/main/java/com/simibubi/create/foundation/item/WipScription.java b/src/main/java/com/simibubi/create/foundation/item/WipScription.java new file mode 100644 index 000000000..224af7f48 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/item/WipScription.java @@ -0,0 +1,42 @@ +package com.simibubi.create.foundation.item; + +import java.util.List; +import java.util.Random; + +import com.simibubi.create.foundation.utility.Lang; + +import net.minecraft.client.resources.I18n; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TextFormatting; + +public class WipScription extends ItemDescription { + + public WipScription(Palette palette) { + super(palette); + add(getLines(), TextFormatting.RED + Lang.translate("tooltip.workInProgress")); + + int descriptions = 0; + while (I18n.hasKey("create.tooltip.randomWipDescription" + descriptions++)) + ; + + if (--descriptions > 0) { + int index = new Random().nextInt(descriptions); + String translate = Lang.translate("tooltip.randomWipDescription" + index); + add(getLines(), TooltipHelper.cutString(translate, TextFormatting.DARK_RED, TextFormatting.DARK_RED)); + } + } + + @Override + public List addInformation(List tooltip) { + tooltip.set(0, new StringTextComponent(decorateName(tooltip.get(0).getString()))); + tooltip.addAll(getLines()); + return tooltip; + } + + public static String decorateName(String name) { + return TextFormatting.GRAY + "" + TextFormatting.STRIKETHROUGH + name + TextFormatting.GOLD + " " + + Lang.translate("tooltip.wip"); + } + +} diff --git a/src/main/java/com/simibubi/create/modules/IModule.java b/src/main/java/com/simibubi/create/modules/IModule.java index 283f50fbf..f0ea64542 100644 --- a/src/main/java/com/simibubi/create/modules/IModule.java +++ b/src/main/java/com/simibubi/create/modules/IModule.java @@ -3,7 +3,7 @@ package com.simibubi.create.modules; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.CreateConfig; -import com.simibubi.create.foundation.utility.ItemDescription.Palette; +import com.simibubi.create.foundation.item.ItemDescription.Palette; import net.minecraft.block.Block; import net.minecraft.item.BlockItem; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java index b95e1ef3d..328887f35 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/base/KineticBlock.java @@ -1,6 +1,6 @@ package com.simibubi.create.modules.contraptions.base; -import com.simibubi.create.foundation.utility.ItemDescription.Palette; +import com.simibubi.create.foundation.item.ItemDescription.Palette; import com.simibubi.create.modules.contraptions.RotationPropagator; import net.minecraft.block.Block; diff --git a/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressBlock.java index c0ace0cc2..18a786762 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/receivers/MechanicalPressBlock.java @@ -8,7 +8,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.IRenderUtilityBlock; import com.simibubi.create.foundation.block.IWithTileEntity; import com.simibubi.create.foundation.block.SyncedTileEntity; -import com.simibubi.create.foundation.utility.ItemHelper; +import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock; import com.simibubi.create.modules.contraptions.relays.belt.AllBeltAttachments.BeltAttachmentState; import com.simibubi.create.modules.contraptions.relays.belt.AllBeltAttachments.IBeltAttachment; diff --git a/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunItem.java b/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunItem.java index 78469dcfa..66f113dec 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/placementHandgun/BuilderGunItem.java @@ -12,9 +12,9 @@ import com.simibubi.create.AllItems; import com.simibubi.create.AllPackets; import com.simibubi.create.Create; import com.simibubi.create.foundation.gui.ScreenOpener; +import com.simibubi.create.foundation.item.ItemDescription; +import com.simibubi.create.foundation.item.ItemDescription.Palette; import com.simibubi.create.foundation.utility.BlockHelper; -import com.simibubi.create.foundation.utility.ItemDescription; -import com.simibubi.create.foundation.utility.ItemDescription.Palette; import com.simibubi.create.foundation.utility.Lang; import net.minecraft.block.Block; diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java index 1cd86842b..9a43c328f 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/BlazingToolItem.java @@ -7,7 +7,7 @@ import java.util.Optional; import com.simibubi.create.foundation.item.AbstractToolItem; import com.simibubi.create.foundation.item.AllToolTypes; -import com.simibubi.create.foundation.utility.ItemHelper; +import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java b/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java index c35402825..ca8475e82 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java +++ b/src/main/java/com/simibubi/create/modules/logistics/InWorldProcessing.java @@ -7,7 +7,7 @@ import java.util.Optional; import com.simibubi.create.AllRecipes; import com.simibubi.create.CreateConfig; -import com.simibubi.create.foundation.utility.ItemHelper; +import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.modules.contraptions.base.ProcessingRecipe; import com.simibubi.create.modules.contraptions.receivers.SplashingRecipe; import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity; diff --git a/src/main/java/com/simibubi/create/modules/logistics/management/controller/LogisticalInventoryControllerTileEntity.java b/src/main/java/com/simibubi/create/modules/logistics/management/controller/LogisticalInventoryControllerTileEntity.java index 7ab1491b1..f4082a5e7 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/management/controller/LogisticalInventoryControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/logistics/management/controller/LogisticalInventoryControllerTileEntity.java @@ -13,10 +13,10 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.foundation.block.IWithContainer; +import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.type.CombinedCountedItemsList; import com.simibubi.create.foundation.type.CountedItemsList; import com.simibubi.create.foundation.type.CountedItemsList.ItemStackEntry; -import com.simibubi.create.foundation.utility.ItemHelper; import com.simibubi.create.modules.logistics.item.CardboardBoxItem; import com.simibubi.create.modules.logistics.management.LogisticalNetwork; import com.simibubi.create.modules.logistics.management.base.LogisticalCasingTileEntity; diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java index d0fb98c5d..8236b6f8f 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonScreen.java @@ -16,9 +16,9 @@ import com.simibubi.create.foundation.gui.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.widgets.IconButton; import com.simibubi.create.foundation.gui.widgets.Indicator; import com.simibubi.create.foundation.gui.widgets.Indicator.State; -import com.simibubi.create.foundation.utility.ItemDescription.Palette; +import com.simibubi.create.foundation.item.TooltipHelper; +import com.simibubi.create.foundation.item.ItemDescription.Palette; import com.simibubi.create.foundation.utility.Lang; -import com.simibubi.create.foundation.utility.TooltipHelper; import com.simibubi.create.modules.schematics.packet.ConfigureSchematicannonPacket; import com.simibubi.create.modules.schematics.packet.ConfigureSchematicannonPacket.Option; diff --git a/src/main/resources/assets/create/lang/en_us.json b/src/main/resources/assets/create/lang/en_us.json index 3289eca8d..a49e7b39e 100644 --- a/src/main/resources/assets/create/lang/en_us.json +++ b/src/main/resources/assets/create/lang/en_us.json @@ -401,6 +401,18 @@ "create.tooltip.capacityProvided.medium": "Medium", "create.tooltip.capacityProvided.high": "Large", + "create.tooltip.wip": "WIP", + "create.tooltip.workInProgress": "Work in progress!", + + "create.tooltip.randomWipDescription0": "Please keep this item away from children.", + "create.tooltip.randomWipDescription1": "A baby panda dies everytime you use this item.", + "create.tooltip.randomWipDescription2": "Use at your own risk.", + "create.tooltip.randomWipDescription3": "Nothing to see here, please disperse.", + "create.tooltip.randomWipDescription4": "This item will self-destruct in 10 seconds.", + "create.tooltip.randomWipDescription5": "Believe me, it's useless.", + "create.tooltip.randomWipDescription6": "By using this item, you hereby consent to our disclaimer and agree to its terms.", + "create.tooltip.randomWipDescription7": "This one maybe isn't for you.", + "create.tooltip.randomWipDescription8": "Use it and regret your decision immediately.", "create.mechanical_mixer.min_ingredients": "Min. Ingredients", @@ -669,6 +681,16 @@ "block.create.flexpeater.tooltip": "FLEX REPEATER", "block.create.flexpeater.tooltip.summary": "An advanced _Redstone_ _Repeater_ with a _configurable_ _Delay_ up to 30 Minutes.", + + "item.create.logistical_controller_calculation.tooltip": "WIP", + "item.create.logistical_controller_request.tooltip": "WIP", + "item.create.logistical_controller_storage.tooltip": "WIP", + "item.create.logistical_controller_supply.tooltip": "WIP", + "item.create.logistical_controller_transactions.tooltip": "WIP", + "block.create.logistical_index.tooltip": "WIP", + "block.create.package_funnel.tooltip": "WIP", + "block.create.logisticians_table.tooltip": "WIP", + "item.create.logistical_dial.tooltip": "WIP", "itemGroup.create": "Create" }