mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 17:05:09 +01:00
misc: new, more compressed icon
The fabric midnightlib jar size is now below 60 KB again!
This commit is contained in:
@@ -7,7 +7,7 @@ org.gradle.parallel=false
|
||||
#org.gradle.configureondemand=true
|
||||
|
||||
# Mod properties
|
||||
mod.version=1.9.0-alpha.1
|
||||
mod.version=1.9.0-beta.1
|
||||
mod.group=eu.midnightdust
|
||||
mod.id=midnightlib
|
||||
mod.name=MidnightLib
|
||||
|
||||
@@ -29,11 +29,8 @@ import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** MidnightConfig by Martin "Motschen" Prokoph
|
||||
* Minimalist config library - feel free to copy!
|
||||
* Originally based on <a href="https://github.com/Minenash/TinyConfig">...</a>
|
||||
* Credits to Minenash */
|
||||
|
||||
/** MidnightConfig is an incredibly lightweight, but still fully-featured config library for Minecraft mods.<br>
|
||||
* Originally based on <a href="https://github.com/Minenash/TinyConfig">TinyConfig</a> by Minenash.*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public abstract class MidnightConfig {
|
||||
private static final Pattern INTEGER_ONLY = Pattern.compile("(-?[0-9]*)");
|
||||
@@ -88,7 +85,6 @@ public abstract class MidnightConfig {
|
||||
MidnightConfig instance = createInstance(modid, config);
|
||||
|
||||
for (Field field : config.getFields()) {
|
||||
//noinspection ConstantValue
|
||||
if ((field.isAnnotationPresent(Entry.class) || field.isAnnotationPresent(Comment.class))
|
||||
&& !field.isAnnotationPresent(Server.class)
|
||||
&& !field.isAnnotationPresent(Hidden.class)
|
||||
@@ -194,6 +190,7 @@ public abstract class MidnightConfig {
|
||||
protected Component getEnumTranslatableText(Object value, EntryInfo info) {
|
||||
if (value instanceof OptionEnum translatableOption) return translatableOption.getCaption();
|
||||
|
||||
assert info.dataType != null;
|
||||
String translationKey = "%s.midnightconfig.enum.%s.%s".formatted(modid, info.dataType.getSimpleName(), info.toTemporaryValue());
|
||||
return I18n.exists(translationKey) ? Component.translatable(translationKey) : Component.literal(info.toTemporaryValue());
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 734 B |
Reference in New Issue
Block a user