Extracting BungeeGUI Changes #73
@ -24,7 +24,7 @@ import com.google.common.io.ByteStreams;
|
||||
import de.steamwar.comms.handlers.BungeeHandler;
|
||||
import de.steamwar.comms.handlers.InventoryHandler;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
|
@ -23,13 +23,16 @@ import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import de.steamwar.comms.packets.InventoryCallbackPacket;
|
||||
import de.steamwar.inventory.SWInventory;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import de.steamwar.comms.packets.*;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class InventoryHandler implements BungeeHandler {
|
||||
|
||||
@ -50,7 +53,10 @@ public class InventoryHandler implements BungeeHandler {
|
||||
}
|
||||
|
||||
SWInventory inventory = new SWInventory(Bukkit.getPlayer(player), size, title, items);
|
||||
inventory.addCloseCallback(click -> new InventoryCallbackPacket(player).send(Bukkit.getPlayer(player)));
|
||||
inventory.addCloseCallback(click -> {
|
||||
if(Bukkit.getPlayer(player).getOpenInventory().getType() != InventoryType.CHEST)
|
||||
new InventoryCallbackPacket(player).send(Bukkit.getPlayer(player));
|
||||
});
|
||||
inventory.open();
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ public class SWItem {
|
||||
itemJson.has("color")?itemJson.get("color").getAsByte():0,
|
||||
itemJson.get("title").getAsString());
|
||||
}else {
|
||||
item = new SWItem(Material.valueOf(itemJson.get("material").getAsString()), itemJson.get("title").getAsString());
|
||||
item = new SWItem(SWItem.getMaterial(itemJson.get("material").getAsString()), itemJson.get("title").getAsString());
|
||||
}
|
||||
}catch (IllegalArgumentException e) {
|
||||
item = new SWItem(Material.STONE, itemJson.get("title").getAsString());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren