Add Custom Callbacks for SWListInv #218
@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class SWListInv<T> extends SWInventory {
|
||||
|
||||
@ -55,8 +56,10 @@ public class SWListInv<T> extends SWInventory {
|
||||
public void open(){
|
||||
opened = true;
|
||||
inventory.clear();
|
||||
callbacks.clear();
|
||||
setCallback(-999, (ClickType click) -> player.closeInventory());
|
||||
callbacks.keySet().stream().filter(i -> i >= 0).collect(Collectors.toList()).forEach(callbacks::remove);
|
||||
if(!callbacks.containsKey(-999)) {
|
||||
setCallback(-999, (ClickType click) -> player.closeInventory());
|
||||
}
|
||||
|
||||
if (sizeBiggerMax()) {
|
||||
if (page != 0) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren