diff --git a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java index aee650bf49..ce3f6b9b61 100644 --- a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java +++ b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/DoubleRule.java @@ -113,7 +113,12 @@ public boolean validate(String value) { try { final double d = Double.parseDouble(value); - return this.inBounds(d); + if (!this.inBounds(d)) { + return false; + } + + this.value = d; + return true; } catch (NumberFormatException ignored) { return false; } diff --git a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java index bf2fda2f73..6f7284de99 100644 --- a/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java +++ b/fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/rule/ValidateableRule.java @@ -23,9 +23,10 @@ public interface ValidateableRule { /** * Validates if a rule can accept the input. + * If valid, the input will be set as the rule's value. * * @param value the value to validate - * @return true if the value can be accepted. + * @return true if the value was accepted. */ boolean validate(String value); }