Configure Numbers

Additional info about Gucci's unique number configurations

Nerd Talk...

As part of our commitment to allowing its customers to create the most unique experience possible with our plugins, we needed to create a custom solution to a common issue we had with configuring numbers while trying to create clean & maintainable code. For those who aren't Java developers, here's a quick rundown... Numbers in Java come in a range of flavors. The most common being Integer which covers any positive, or negative number between 0 & (4 bytes of memory). Integers also only cover whole numbers. This leads to the second most common, Double which can store any positive or negative, decimal or whole number between 0 & 1.79^308

The issue with this is that when you serialize (save) a number of a specific type to a standard format like a config file, it can lose its precision and also can cause a headache for the customer as you have no idea the bounds of the value you are editing. Gucci solves this by saving all number config values in a format that includes a short suffix identifying the runtime type & allows users to know the bounds of the value they are editing.

Basically, different number types use different amounts of memory. We try to save the most memory possible and use the correct data types for the task at hand. This creates weird number limitations when configuring, so we added suffixes & config validation to limit these numbers.

Actual Reason For This Page...

Configs serialize (save to file) in a format that translates any number into an easy-to-define format.

Config Version
Mapped Type
Min-Max Values

example: "0.01"

Double (no suffix)

example: "0.01F"

Float (F suffix)

example: "1"

Integer (no suffix, no .)

example: "1L"

Long (L suffix)

example: "1S"

Short (S suffix)

example: "1B"

Byte (B suffix)

Last updated

Was this helpful?