Skip to content

Commit

Permalink
remove sessions and close all chest inventories that was open
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoSilvaF committed Jun 17, 2022
1 parent 3b4481e commit f7f69c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mychest/src/main/java/com/github/hugosilvaf2/mychest/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ private void disableMySQL() {
} catch (SQLException var2) {
var2.printStackTrace();
}

// remove sessions and close all chest inventories that was open
getSessionService().gSessions().forEach(c -> {
c.getViewers().forEach(d -> {
if(d != null) {
if(d.isOnline()) {
d.closeInventory();
}
getSessionService().removeSessionByID(c.getChest().getID());
}
});
});
}

public static FileConfiguration getDefaultConfig() {
Expand Down
Binary file modified mychest/target/classes/com/github/hugosilvaf2/mychest/Main.class
Binary file not shown.

0 comments on commit f7f69c9

Please sign in to comment.