Skip to content

Commit

Permalink
[fix] adjust formatting of Whole attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
bibi-reden committed Aug 12, 2024
1 parent 26f33b7 commit f91675b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loom_version=1.7-SNAPSHOT
minecraft_version=1.20.1
fabric_kotlin_version=1.11.0+kotlin.2.0.0
fabric_api_version=0.92.2+1.20.1
mod_version=2.0.0+1.20.1-beta.12
mod_version=2.0.0+1.20.1-beta.13
loader=fabric

# Mappings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.bibireden.data_attributes.api.attribute
import io.wispforest.endec.Endec

enum class AttributeFormat(val function: (min: Double, max: Double, value: Double) -> String) {
Percentage ({min, max, value -> "%.2f".format((value-min)/((max-min)/100))+"%" }),
Whole({_, _, value -> "$value"} );
Percentage ({min, max, value -> "%.2f".format((value - min) / ((max - min) / 100)) + "%" }),
Whole({_, _, value -> "%.2f".format(value) } );

companion object {
val ENDEC: Endec<AttributeFormat> = Endec.STRING.xmap(AttributeFormat::of) { it.name }
Expand Down

0 comments on commit f91675b

Please sign in to comment.