mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-22 18:55:17 +01:00
Minor changes around Optional.
This commit is contained in:
parent
131a8affca
commit
bfcbd44478
@ -38,16 +38,14 @@ public class Panel {
|
||||
}
|
||||
this.listener = listener;
|
||||
// If the listener is defined, then run setup
|
||||
listener.ifPresent(l -> l.setup());
|
||||
/*
|
||||
if (listener.isPresent()) {
|
||||
listener.get().setup();
|
||||
}
|
||||
}*/
|
||||
// If the user is defined, then open panel immediately
|
||||
this.user = user;
|
||||
if (user.isPresent()) {
|
||||
// Register panel.
|
||||
PanelListenerManager.openPanels.put(user.get().getUniqueId(), this);
|
||||
user.get().getPlayer().openInventory(inventory);
|
||||
}
|
||||
user.ifPresent(this::open);
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
|
Loading…
Reference in New Issue
Block a user