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.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
import de.steamwar.core.Core;
|
||||||
import de.steamwar.inventory.SWInventory;
|
import de.steamwar.inventory.SWInventory;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
@ -54,8 +55,10 @@ public class InventoryHandler implements BungeeHandler {
|
|||||||
|
|
||||||
SWInventory inventory = new SWInventory(Bukkit.getPlayer(player), size, title, items);
|
SWInventory inventory = new SWInventory(Bukkit.getPlayer(player), size, title, items);
|
||||||
inventory.addCloseCallback(click -> {
|
inventory.addCloseCallback(click -> {
|
||||||
if(Bukkit.getPlayer(player).getOpenInventory().getType() == InventoryType.CRAFTING)
|
Bukkit.getScheduler().runTaskLaterAsynchronously(Core.getInstance(), () -> {
|
||||||
new InventoryCallbackPacket(player).send(Bukkit.getPlayer(player));
|
if(Bukkit.getPlayer(player).getOpenInventory().getType() != InventoryType.CHEST)
|
||||||
|
new InventoryCallbackPacket(player).send(Bukkit.getPlayer(player));
|
||||||
|
}, 1);
|
||||||
});
|
});
|
||||||
inventory.open();
|
inventory.open();
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren