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