Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,15 @@ public WindowEventListener getWindowEvents() {
throw new IllegalStateException("Window is not set");
return (WindowEventListener) window;
}


/**
* Gets the container ID (window ID) for the window
* @return the container id, or -1 if the window isn't a container
*/
public int getContainerId() {
return containerId;
}

/**
* A proxy {@link AbstractContainerMenu} for intercepting carried item change and general bukkit interoperability.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,12 @@ public int getServerWindowState() {
public int getClientWindowState() {
return clientWindowState;
}


@Override
public int getContainerId() {
return menu.getContainerId();
}

@Override
public void handlePong(int id) {
clientWindowState = id;
Expand Down
10 changes: 9 additions & 1 deletion invui/src/main/java/xyz/xenondevs/invui/window/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,15 @@ default void incrementWindowState() {
* @param handler The window state change handler to remove
*/
void removeWindowStateChangeHandler(Consumer<? super Integer> handler);


/**
* Gets the container ID (window ID) for the window
* @return the container id, or -1 if the window isn't a container
*/
default int getContainerId() {
return -1;
}

/**
* A {@link Window} builder.
*
Expand Down