Skip to content

Commit 52eb2db

Browse files
authored
Fix the Fuelable TOP provider translation to run on the client (#1511)
1 parent becf11d commit 52eb2db

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/main/java/gregtech/api/capability/impl/FluidFuelInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public FluidFuelInfo(FluidStack fluidStack, int fuelRemaining, int fuelCapacity,
1515
}
1616

1717
public String getFuelName() {
18-
return fluidStack.getLocalizedName();
18+
return fluidStack.getUnlocalizedName();
1919
}
2020
}

src/main/java/gregtech/api/capability/impl/ItemFuelInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public ItemFuelInfo(ItemStack itemStack, int fuelRemaining, int fuelCapacity, in
1515
}
1616

1717
public String getFuelName() {
18-
return itemStack.getDisplayName();
18+
return itemStack.getUnlocalizedName();
1919
}
2020
}

src/main/java/gregtech/integration/theoneprobe/provider/FuelableInfoProvider.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import mcjty.theoneprobe.api.ElementAlignment;
99
import mcjty.theoneprobe.api.IProbeInfo;
1010
import mcjty.theoneprobe.api.TextStyleClass;
11-
import net.minecraft.client.resources.I18n;
1211
import net.minecraft.tileentity.TileEntity;
1312
import net.minecraft.util.EnumFacing;
1413
import net.minecraftforge.common.capabilities.Capability;
@@ -34,7 +33,7 @@ protected boolean allowDisplaying(IFuelable capability) {
3433
protected void addProbeInfo(IFuelable capability, IProbeInfo probeInfo, TileEntity tileEntity, EnumFacing sideHit) {
3534
Collection<IFuelInfo> fuels = capability.getFuels();
3635
if (fuels == null || fuels.isEmpty()) {
37-
probeInfo.text(TextStyleClass.WARNING + I18n.format("gregtech.top.fuel_none"));
36+
probeInfo.text(TextStyleClass.WARNING + "{*gregtech.top.fuel_none*}");
3837
return;
3938
}
4039
for (IFuelInfo fuelInfo : fuels) {
@@ -45,20 +44,19 @@ protected void addProbeInfo(IFuelable capability, IProbeInfo probeInfo, TileEnti
4544
final int burnTime = fuelInfo.getFuelBurnTime()/20;
4645

4746
IProbeInfo horizontalPane = probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER));
48-
horizontalPane.text(TextStyleClass.INFO + I18n.format("gregtech.top.fuel_name", fuelName));
47+
horizontalPane.text(TextStyleClass.INFO + "{*gregtech.top.fuel_name*} {*" + fuelName + "*}");
4948

5049
horizontalPane = probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER));
51-
String suffix;
52-
if (fuelRemaining < fuelMinConsumed)
53-
suffix = I18n.format("gregtech.top.fuel_min_consume", fuelCapacity, fuelMinConsumed);
54-
else
55-
suffix = I18n.format("gregtech.top.fuel_info", fuelCapacity, burnTime);
5650
horizontalPane.progress(fuelRemaining, fuelCapacity, probeInfo.defaultProgressStyle()
57-
.suffix(suffix)
51+
.suffix("/" + fuelCapacity + " ")
5852
.borderColor(0x00000000)
5953
.backgroundColor(0x00000000)
6054
.filledColor(0xFFFFE000)
6155
.alternateFilledColor(0xFFEED000));
56+
if (fuelRemaining < fuelMinConsumed)
57+
horizontalPane.text("{*gregtech.top.fuel_min_consume*} " + fuelMinConsumed);
58+
else
59+
horizontalPane.text("{*gregtech.top.fuel_burn*} " + burnTime + " {*gregtech.top.fuel_time*}");
6260
}
6361
}
6462

src/main/resources/assets/gregtech/lang/en_us.lang

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ enchantment.disjunction=Disjunction
1313
gregtech.top.energy_stored=Energy:
1414
gregtech.top.progress=Progress:
1515
gregtech.top.working_disabled=Working Disabled
16+
1617
gregtech.top.transform_up=§cStep Up§r %s (%,dA) -> %s (%,dA)
1718
gregtech.top.transform_down=§aStep Down§r %s (%,dA) -> %s (%,dA)
1819
gregtech.top.transform_input=§6Input:§r %s (%,dA)
1920
gregtech.top.transform_output=§9Output:§r %s (%,dA)
20-
gregtech.top.fuel_info=/%,d for %,d secs
21-
gregtech.top.fuel_min_consume=/%,d needs %,d
22-
gregtech.top.fuel_name=Fuel: %s
21+
22+
gregtech.top.fuel_burn=for
23+
gregtech.top.fuel_time=secs
24+
gregtech.top.fuel_min_consume=needs
25+
gregtech.top.fuel_name=Fuel:
2326
gregtech.top.fuel_none=No fuel
2427

2528
gregtech.multiblock.title=Multiblock Pattern

0 commit comments

Comments
 (0)