Skip to content

Commit

Permalink
Release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed Jul 11, 2023
1 parent ba0eb5d commit 42296f2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
23 changes: 12 additions & 11 deletions IMPLEMENT.MD
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ If `null` is passed the menu will not be displayed.
If you only need the tag tree view you can call the `NbtTreeRenderer#render` directly.

The following arguments are required:
| Argument | Type | Description |
| ------------------ | ------------------------- | ---------------------------------------------------------------------------------- |
| `drawer` | `ImNbtDrawer` | The drawer instance |
| `nameEditConsumer` | `Consumer<String>` | A handler for root tag name changes |
| `deleteListener` | `Runnable` | A handler for root tag deletion |
| `colorProvider` | `Function<String, Color>` | A supplier for the text color of a tag. Can return `null` to use the default color |
| `searchProvider` | `SearchProvider` | A provider for the search functionality |
| `openContextMenu` | `boolean` | If the context menu should be available |
| `path` | `String` | The current path (Should be empty for the root tag) |
| `name` | `String` | The name of the root tag |
| `tag` | `INbtTag` | The root tag |
| Argument | Type | Description |
| ------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------- |
| `drawer` | `ImNbtDrawer` | The drawer instance |
| `nameEditConsumer` | `Consumer<String>` | A handler for root tag name changes |
| `transformListener` | `BiConsumer<String, INbtTag>` | The listener for tag transformations. The first argument is the name, the second is the transformed tag |
| `deleteListener` | `Runnable` | A handler for root tag deletion |
| `colorProvider` | `Function<String, Color>` | A supplier for the text color of a tag. Can return `null` to use the default color |
| `searchProvider` | `SearchProvider` | A provider for the search functionality |
| `openContextMenu` | `boolean` | If the context menu should be available |
| `path` | `String` | The current path (Should be empty for the root tag) |
| `name` | `String` | The name of the root tag |
| `tag` | `INbtTag` | The root tag |
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ org.gradle.configureondemand=true
#Maven settings
maven_name=ImNbt
maven_group=net.lenni0451
maven_version=1.2.2-SNAPSHOT
maven_version=1.3.0
19 changes: 10 additions & 9 deletions src/main/java/net/lenni0451/imnbt/ui/NbtTreeRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ public static TagRenderer getTagRenderer(@Nonnull final NbtType type) {
/**
* Render the tag tree.
*
* @param drawer The drawer instance
* @param nameEditConsumer The listener for when the name of a tag is edited
* @param deleteListener The listener for when the tag is deleted
* @param colorProvider The provider for the color of the tag
* @param searchProvider The provider for the search
* @param openContextMenu Whether the context menu should be opened
* @param path The path of the tag
* @param name The name of the tag
* @param tag The tag to render
* @param drawer The drawer instance
* @param nameEditConsumer The listener for when the name of a tag is edited
* @param transformListener The listener for when the tag is transformed
* @param deleteListener The listener for when the tag is deleted
* @param colorProvider The provider for the color of the tag
* @param searchProvider The provider for the search
* @param openContextMenu Whether the context menu should be opened
* @param path The path of the tag
* @param name The name of the tag
* @param tag The tag to render
*/
public static void render(final ImNbtDrawer drawer, final Consumer<String> nameEditConsumer, final BiConsumer<String, INbtTag> transformListener, final Runnable deleteListener, final Function<String, Color> colorProvider, final SearchProvider searchProvider, final boolean openContextMenu, final String path, final String name, final INbtTag tag) {
TagRenderer renderer = TAG_RENDERER.get(tag.getNbtType());
Expand Down

0 comments on commit 42296f2

Please sign in to comment.