Tries to get the value of a float setting by its key. @param key the key of the setting. @return the float value of the setting or 0.0f, if the value of the setting is not a float or the setting does not exist.
(String key)
| 624 | * @return the float value of the setting or {@code 0.0f}, if the value of the setting is not a float or the setting does not exist. |
| 625 | */ |
| 626 | public float getFloat(String key) { |
| 627 | ConfigItem item = items.get(key); |
| 628 | if (item == null) { |
| 629 | The5zigMod.logger.warn("Could not find " + key + " in config!"); |
| 630 | } |
| 631 | return item instanceof FloatItem ? ((FloatItem) item).get() : 0; |
| 632 | } |
| 633 | |
| 634 | /** |
| 635 | * Tries to get the value of a string setting by its key. |
no test coverage detected