Team Color #164
@ -20,9 +20,10 @@
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.bungeecore.BungeeCore;
|
||||
import de.steamwar.bungeecore.comms.packets.CloseInventoryPacket;
|
||||
import de.steamwar.bungeecore.inventory.SWInventory;
|
||||
import de.steamwar.bungeecore.inventory.SWItem;
|
||||
import de.steamwar.bungeecore.inventory.SWListInv;
|
||||
import de.steamwar.bungeecore.schematic.SchemGUI;
|
||||
import de.steamwar.bungeecore.sql.Event;
|
||||
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||
import de.steamwar.bungeecore.sql.Team;
|
||||
@ -529,7 +530,7 @@ public class TeamCommand extends BasicCommand {
|
||||
COLOR_CODES.forEach(stringSWListEntry -> colors.add(new SWListInv.SWListEntry<>(stringSWListEntry.getItem().setName(stringSWListEntry.getItem().getTitle() + Team.get(user.getTeam()).getTeamKuerzel()), stringSWListEntry.getObject())));
|
||||
|
||||
SWListInv<String> inv = new SWListInv<>(player, "§6Farbe wählen", colors, (click, element) -> {
|
||||
SchemGUI.closeInventory(player);
|
||||
SWListInv.closeInventory(player);
|
||||
team.setTeamColor(element);
|
||||
});
|
||||
|
||||
inv.open();
|
||||
|
@ -19,8 +19,10 @@
|
||||
|
||||
package de.steamwar.bungeecore.inventory;
|
||||
|
||||
import de.steamwar.bungeecore.comms.packets.CloseInventoryPacket;
|
||||
Lixfel
hat
Unused imports. Unused imports.
Chaoscaot
hat
Done Done
|
||||
import de.steamwar.bungeecore.sql.Schematic;
|
||||
import de.steamwar.bungeecore.sql.SchematicType;
|
||||
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
@ -142,4 +144,8 @@ public class SWListInv<T> extends SWInventory {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeInventory(ProxiedPlayer player) {
|
||||
Lixfel
hat
Bitte nicht. Bitte nicht.
|
||||
new CloseInventoryPacket(SteamwarUser.get(player).getId()).send(player);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Nutze Inventory.close() (also inv.close());
Variable 'inv' might not have been initialized.
Dann musst du den Callback evtl. nach der Initialisierung setzen.