Fixing Inventory not Removing
Dieser Commit ist enthalten in:
Ursprung
5491be4430
Commit
9c0979bf58
@ -23,6 +23,7 @@ import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.inventory.SWInventory;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
@ -54,8 +55,10 @@ public class InventoryHandler implements BungeeHandler {
|
||||
|
||||
SWInventory inventory = new SWInventory(Bukkit.getPlayer(player), size, title, items);
|
||||
inventory.addCloseCallback(click -> {
|
||||
if(Bukkit.getPlayer(player).getOpenInventory().getType() == InventoryType.CRAFTING)
|
||||
new InventoryCallbackPacket(player).send(Bukkit.getPlayer(player));
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(Core.getInstance(), () -> {
|
||||
if(Bukkit.getPlayer(player).getOpenInventory().getType() != InventoryType.CHEST)
|
||||
new InventoryCallbackPacket(player).send(Bukkit.getPlayer(player));
|
||||
}, 1);
|
||||
});
|
||||
inventory.open();
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren