mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 14:59:21 +00:00
Fix event priorities in config, bump to 2.1.3
This commit is contained in:
@@ -126,12 +126,16 @@ public class Settings {
|
||||
}
|
||||
|
||||
@YamlKey("synchronization.event_priorities")
|
||||
public Map<String, EventPriority> synchronizationEventPriorities = EventType.getDefaults();
|
||||
public Map<String, String> synchronizationEventPriorities = EventType.getDefaults();
|
||||
|
||||
@NotNull
|
||||
public EventPriority getEventPriority(@NotNull Settings.EventType eventType) {
|
||||
return Optional.ofNullable(synchronizationEventPriorities.get(eventType.name().toLowerCase()))
|
||||
.orElse(EventPriority.NORMAL);
|
||||
try {
|
||||
return EventPriority.valueOf(synchronizationEventPriorities.get(eventType.name().toLowerCase()));
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
return EventPriority.NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -211,13 +215,13 @@ public class Settings {
|
||||
this.defaultPriority = defaultPriority;
|
||||
}
|
||||
|
||||
private Map.Entry<String, EventPriority> toEntry() {
|
||||
return Map.entry(name(), defaultPriority);
|
||||
private Map.Entry<String, String> toEntry() {
|
||||
return Map.entry(name().toLowerCase(), defaultPriority.name());
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static Map<String, EventPriority> getDefaults() {
|
||||
private static Map<String, String> getDefaults() {
|
||||
return Map.ofEntries(Arrays.stream(values())
|
||||
.map(EventType::toEntry)
|
||||
.toArray(Map.Entry[]::new));
|
||||
|
||||
@@ -3,7 +3,7 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8'
|
||||
org.gradle.daemon=true
|
||||
javaVersion=16
|
||||
|
||||
plugin_version=2.1.2
|
||||
plugin_version=2.1.3
|
||||
plugin_archive=husksync
|
||||
|
||||
jedis_version=4.2.3
|
||||
|
||||
Reference in New Issue
Block a user