diff --git a/Plan/api/build.gradle b/Plan/api/build.gradle index cb3447436..5da13d102 100644 --- a/Plan/api/build.gradle +++ b/Plan/api/build.gradle @@ -4,7 +4,7 @@ dependencies { compileOnly "com.google.code.gson:gson:$gsonVersion" } -ext.apiVersion = '5.2-R0.7' +ext.apiVersion = '5.2-R0.8' publishing { repositories { diff --git a/Plan/api/src/main/java/com/djrapitops/plan/extension/builder/ValueBuilder.java b/Plan/api/src/main/java/com/djrapitops/plan/extension/builder/ValueBuilder.java index 1abf079a9..83ce9987b 100644 --- a/Plan/api/src/main/java/com/djrapitops/plan/extension/builder/ValueBuilder.java +++ b/Plan/api/src/main/java/com/djrapitops/plan/extension/builder/ValueBuilder.java @@ -170,6 +170,26 @@ public interface ValueBuilder { */ DataValue buildNumber(Long value); + /** + * Build a Number. + * + * @param value a non-floating point number. + * @return a data value to give to {@link ExtensionDataBuilder}. + */ + default DataValue buildNumber(Integer value) { + return buildNumber(value != null ? (long) value : null); + } + + /** + * Build a Number. + * + * @param value a non-floating point number. + * @return a data value to give to {@link ExtensionDataBuilder}. + */ + default DataValue buildNumber(Double value) { + return buildNumber(value != null ? (long) (double) value : null); + } + /** * Build a Floating point number. * @@ -212,14 +232,14 @@ public interface ValueBuilder { /** * Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}. - * + *

* {@link ValueBuilder#buildBooleanProvidingCondition(boolean, String)} */ DataValue buildBooleanProvidingCondition(Supplier value, String providedCondition); /** * Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}. - * + *

* {@link ValueBuilder#buildString(String)} */ DataValue buildString(Supplier value); @@ -233,28 +253,28 @@ public interface ValueBuilder { /** * Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}. - * + *

* {@link ValueBuilder#buildDouble(Double)} */ DataValue buildDouble(Supplier value); /** * Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}. - * + *

* {@link ValueBuilder#buildPercentage(Double)} */ DataValue buildPercentage(Supplier percentage); /** * Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}. - * + *

* {@link ValueBuilder#buildGroup(String[])} */ DataValue buildGroup(Supplier groups); /** * Lambda version for conditional return or throwing {@link com.djrapitops.plan.extension.NotReadyException}. - * + *

* {@link ValueBuilder#buildTable(Table, Color)} */ DataValue buildTable(Supplier
table, Color tableColor);