SteamWar/SpigotCore
Archiviert
13
0

Add Custom Callbacks for SWListInv #218

Zusammengeführt
Lixfel hat 2 Commits von hotfix_custom_callbacks nach master 2022-10-29 12:21:42 +02:00 zusammengeführt

Datei anzeigen

@ -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) {