From 5d0cc61ef5bb04ba9c0b1498bcf1f22e35cbd3aa Mon Sep 17 00:00:00 2001 From: fayer3 Date: Thu, 13 Jun 2024 13:19:29 +0200 Subject: [PATCH] fix const float parsing --- .../irisshaders/iris/shaderpack/parsing/ParsedString.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/irisshaders/iris/shaderpack/parsing/ParsedString.java b/src/main/java/net/irisshaders/iris/shaderpack/parsing/ParsedString.java index dfad869035..7014d57de6 100644 --- a/src/main/java/net/irisshaders/iris/shaderpack/parsing/ParsedString.java +++ b/src/main/java/net/irisshaders/iris/shaderpack/parsing/ParsedString.java @@ -104,11 +104,18 @@ public String takeNumber() { if (!Character.isDigit(text.charAt(position)) && !Character.isDigit(text.charAt(position + 1))) { break; } + } else if (!Character.isDigit(text.charAt(position))) { + break; } position++; } + // take any f float suffixes, if we have a number + if (position > 0 && position + 1 < text.length() && (text.charAt(position) == 'f' || text.charAt(position) == 'F')) { + position++; + } + try { Float.parseFloat(text.substring(0, position)); } catch (Exception e) {