Skip to content

Commit

Permalink
fix listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Bawnorton committed Oct 15, 2024
1 parent bdb3c23 commit 960ea9e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 2.0.3

- Fix listener method signatures no longer matching the javadoc

# 2.0.2

- Fix listener ap generation to use spec

# 2.0.1

- Fix default naming not applying correctly
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx4G
fabric_versions=1.20.1, 1.21.1
neoforge_versions=1.21.1

mod_version=2.0.1
mod_version=2.0.3
mod_group=com.bawnorton
mod_id=configurable
mod_name=Configurable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected void addNeededImports(Consumer<String> adder) {

@Override
protected String getSpec(int depth) {
return "%s::%s".formatted(
return "(option, value) -> %s.%s(value)".formatted(
owner.substring(owner.lastIndexOf(".") + 1),
methodName
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected String getSpec(int depth) {
spec.append("%1$s.flag(%2$s)\n".formatted("\t".repeat(depth), optionFlags));
}
if (!listeners.isEmpty()) {
spec.append("%1$s.listeners(%2$s)\n".formatted("\t".repeat(depth), listeners));
spec.append("%1$s.listeners(%2$s)\n".formatted("\t".repeat(depth), listeners.getSpec(depth + 1)));
}
spec.append("%1$s.build()".formatted("\t".repeat(depth)));
return spec.toString();
Expand Down

0 comments on commit 960ea9e

Please sign in to comment.