Skip to content

Commit

Permalink
Accept 1 and 0 as possible values
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Jun 28, 2024
1 parent 0ea74e4 commit 8f668cf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,9 @@ public ShaderProperties(String contents, ShaderPackOptions shaderPackOptions, It
}

private static void handleBooleanValue(String key, String value, BooleanConsumer handler) {
if ("true".equals(value)) {
if ("true".equals(value) || "1".equals(value)) {
handler.accept(true);
} else if ("false".equals(value)) {
} else if ("false".equals(value) || "0".equals(value)) {
handler.accept(false);
} else {
Iris.logger.warn("Unexpected value for boolean key " + key + " in shaders.properties: got " + value + ", but expected either true or false");
Expand All @@ -613,9 +613,9 @@ private static void handleBooleanDirective(String key, String value, String expe
return;
}

if ("true".equals(value)) {
if ("true".equals(value) || "1".equals(value)) {
handler.accept(OptionalBoolean.TRUE);
} else if ("false".equals(value)) {
} else if ("false".equals(value) || "0".equals(value)) {
handler.accept(OptionalBoolean.FALSE);
} else {
Iris.logger.warn("Unexpected value for boolean key " + key + " in shaders.properties: got " + value + ", but expected either true or false");
Expand Down

0 comments on commit 8f668cf

Please sign in to comment.