mirror of
https://github.com/filoghost/ChestCommands.git
synced 2025-02-16 11:31:23 +01:00
Check that the current open inventory is the correct one before closing it
This commit is contained in:
parent
b5c2453302
commit
36aecfb6a7
@ -9,6 +9,7 @@ import me.filoghost.chestcommands.api.Icon;
|
||||
import me.filoghost.chestcommands.api.MenuView;
|
||||
import me.filoghost.chestcommands.icon.RefreshableIcon;
|
||||
import me.filoghost.chestcommands.menu.BaseMenu;
|
||||
import me.filoghost.chestcommands.menu.MenuManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -45,7 +46,7 @@ public class DefaultMenuView implements MenuView {
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (viewer.isOnline()) {
|
||||
if (viewer.isOnline() && MenuManager.getOpenMenuView(viewer) == this) {
|
||||
viewer.closeInventory();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user