Skip to content

Commit

Permalink
fix creative adjuster screen not working in some locales
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Nov 18, 2024
1 parent 1f23740 commit 7cbd90e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;

import java.util.Locale;

import static me.desht.pneumaticcraft.common.util.PneumaticCraftUtils.xlate;

public abstract class AbstractCreativeAdjusterScreen<C extends AbstractPneumaticCraftMenu<T>,T extends AbstractPneumaticCraftBlockEntity> extends AbstractPneumaticCraftContainerScreen<C,T> {
Expand Down Expand Up @@ -108,7 +110,8 @@ private void setText(WidgetButtonExtended b, String unshifted, String shifted) {
}

protected String formatAdjustment(float adj) {
return String.format("%+.1f", adj);
// force a US locale here - "." decimal separator since we use Float.parseFloat server-side
return String.format(Locale.US, "%+.1f", adj);
}

private String makeTag(float f) {
Expand Down

0 comments on commit 7cbd90e

Please sign in to comment.