Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization 250223 #3986

Merged
merged 6 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addCasingInfoMin("Hardened Clay block", 40, false)
.addOtherStructurePart("Dispenser", "Any Hardened Clay block")
.addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block")
.addStructureHint("Primitive Kinetic Shaftbox", 1)
.addStructureHint("tile.BWRotorBlock.0.name", 1)
.toolTipFinisher();
return tt;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,12 @@ public MultiblockTooltipBuilder addStructureHint(String info) {
* Use this method to add an entry to standard structural hint without creating a corresponding line in structure
* information
*
* @param name The name of block This should be an entry into minecraft's localization system.
* @param dots Possible locations of this block
* @param nameKey The name of block This should be an entry into minecraft's localization system.
* @param dots Possible locations of this block
* @return Instance this method was called on.
*/
public MultiblockTooltipBuilder addStructureHint(String name, int... dots) {
for (int dot : dots) hBlocks.put(dot, StatCollector.translateToLocal(name));
public MultiblockTooltipBuilder addStructureHint(String nameKey, int... dots) {
for (int dot : dots) hBlocks.put(dot, StatCollector.translateToLocal(nameKey));
return this;
}

Expand Down
20 changes: 11 additions & 9 deletions src/main/java/gregtech/common/items/ItemFluidDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -49,26 +50,27 @@ protected void addAdditionalToolTips(List<String> aList, ItemStack aStack, Entit
if (GTValues.D1 || Minecraft.getMinecraft().gameSettings.advancedItemTooltips) {
Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage());
if (tFluid != null) {
aList.add("Registry: " + tFluid.getName());
aList.add(StatCollector.translateToLocalFormatted("GT5U.tooltip.fluid.registry", tFluid.getName()));
}
}
if (aNBT != null) {
long tToolTipAmount = aNBT.getLong("mFluidDisplayAmount");
if (tToolTipAmount > 0L) {
aList.add(
EnumChatFormatting.BLUE + "Amount: "
+ GTUtility.formatNumbers(tToolTipAmount)
+ " L"
EnumChatFormatting.BLUE + StatCollector
.translateToLocalFormatted("GT5U.tooltip.fluid.amount", GTUtility.formatNumbers(tToolTipAmount))
+ EnumChatFormatting.GRAY);
}
aList.add(
EnumChatFormatting.RED + "Temperature: "
+ GTUtility.formatNumbers(aNBT.getLong("mFluidDisplayHeat"))
+ " K"
+ EnumChatFormatting.GRAY);
EnumChatFormatting.RED + StatCollector.translateToLocalFormatted(
"GT5U.tooltip.fluid.temperature",
GTUtility.formatNumbers(aNBT.getLong("mFluidDisplayHeat"))) + EnumChatFormatting.GRAY);
aList.add(
EnumChatFormatting.GREEN
+ String.format(transItem("018", "State: %s"), aNBT.getBoolean("mFluidState") ? "Gas" : "Liquid")
+ StatCollector.translateToLocalFormatted(
"GT5U.tooltip.fluid.stat",
aNBT.getBoolean("mFluidState") ? StatCollector.translateToLocal("GT5U.tooltip.fluid.stat.gas")
: StatCollector.translateToLocal("GT5U.tooltip.fluid.stat.liquid"))
+ EnumChatFormatting.GRAY);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;

import cpw.mods.fml.relauncher.Side;
Expand Down Expand Up @@ -37,10 +38,10 @@ public SpecialCasingItemBlock(Block par1) {
public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
int aMeta = aStack.getItemDamage();
if (aMeta < 4) {
aList.add("Provides quantum stability");
aList.add(StatCollector.translateToLocal("GTPP.tooltip.meta_special.quantum_stability"));
}
if (aMeta >= 4 && aMeta < 8) {
aList.add("Provides quantum modulation");
aList.add(StatCollector.translateToLocal("GTPP.tooltip.meta_special.quantum_modulation"));
}
super.addInformation(aStack, aPlayer, aList, aF3_H);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addController("Front Center")
.addCasingInfoMin(mCasingName, 64, false)
.addCasingInfoMin(mGearboxName, 8, false)
.addStructureHint("Air Intake Hatch", 1)
.addStructureHint("item.GTPP.air_intake_hatch.name", 1)
.addInputBus("Side center line", 1)
.addInputHatch("Side center line", 1)
.addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addInfo("Awakened Draconium coils combined with Tungstensteel pipe casing makes catalyst unbreakable")
.addController("Bottom Center")
.addOtherStructurePart("Catalyst Housing", "Bottom Casing")
.addStructureHint("Catalyst Housing", 1)
.addStructureHint("item.GTPP.catalyst_housing.name", 1)
.addInputBus("Bottom Casing", 1)
.addOutputBus("Bottom Casing", 1)
.addInputHatch("Bottom Casing", 1)
Expand Down
14 changes: 13 additions & 1 deletion src/main/resources/assets/gregtech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ item.gt.pollen.name=Pollen
item.gt.propolis.name=Propolis
tile.gt.dronerender.name=Drone Renderer

# GT++ items
item.GTPP.air_intake_hatch.name=Air Intake Hatch
item.GTPP.catalyst_housing.name=Catalyst Housing

# Air Filter
item.GTPP.air_filter.name=Air Filter
item.GTPP.air_filter.name.t1=Air Filter [Tier 1]
Expand Down Expand Up @@ -2025,7 +2029,8 @@ GTPP.tooltip.ore.found=Found:
GTPP.tooltip.ore.unknown=- Unknown
GTPP.tooltip.block.mining_level=Mining Level: %d
GTPP.tooltip.block.contains=Contains:

GTPP.tooltip.meta_special.quantum_stability=Provides quantum stability
GTPP.tooltip.meta_special.quantum_modulation=Provides quantum modulation

GT5U.tooltip.pollution.produces=Produces %d Pollution/Second
GT5U.tooltip.pollution.produces.multiblock=A complete Multiblock produces %d Pollution/Second
Expand All @@ -2034,6 +2039,13 @@ GT5U.tooltip.pollution.produces.rocket.ignited=Produces %d Pollution/Second when
GT5U.tooltip.pollution.produces.rocket.flying=Produces %d Pollution/Second when flying


GT5U.tooltip.fluid.registry=Registry: %s
GT5U.tooltip.fluid.amount=Amount: %s L
GT5U.tooltip.fluid.temperature=Temperature: %s K
GT5U.tooltip.fluid.stat=State: %s
GT5U.tooltip.fluid.stat.gas=Gas
GT5U.tooltip.fluid.stat.liquid=Liquid

# Achievements

# 4/2/19
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/gregtech/lang/zh_CN.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,11 @@ GTPP.MBTT.SteamOutputBus=输出总线(蒸汽)



GT5U.tooltip.fluid.amount=数量: %s L
GT5U.tooltip.fluid.temperature=温度: %s K
GT5U.tooltip.fluid.stat=状态: %s
GT5U.tooltip.fluid.stat.gas=气体
GT5U.tooltip.fluid.stat.liquid=液体


# Achievements
Expand Down