Skip to content

Commit

Permalink
feat: extra methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 4, 2025
1 parent 74d7768 commit de4ad5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.debug=false


# Version
mod_version=1.2.08
mod_version=1.2.09

# Mod
mod_id=zenith
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/net/zepalesque/zenith/api/packconfig/PackConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,26 @@ public <B, T extends ModConfigSpec.ConfigValue<B>> T register(T config, String p
return config;
}

public <B, T extends ModConfigSpec.ConfigValue<B>> T register(T config, String id, Predicate<B> predicate) {
return register(config, "", id, predicate);
}

public <T extends ModConfigSpec.ConfigValue<Boolean>> T register(T config, String path, String id, boolean predicate) {
return register(config, path, id, bool -> bool == predicate);
}

public <T extends ModConfigSpec.ConfigValue<Boolean>> T register(T config, String id, boolean predicate) {
return register(config, "", id, predicate);
}

public <T extends ModConfigSpec.ConfigValue<Boolean>> T register(T config, String path, String id) {
return register(config, path, id, true);
}

public <T extends ModConfigSpec.ConfigValue<Boolean>> T register(T config, String id) {
return register(config, "", id);
}


public void setup(AddPackFindersEvent event) {
if (event.getPackType() == this.type) {
Expand Down

0 comments on commit de4ad5d

Please sign in to comment.