Add Multi Personal Kits #228
@ -162,6 +162,18 @@ public class Kit {
|
|||||||
public void preview(Player player){
|
public void preview(Player player){
|
||||||
SWInventory inv = new SWInventory(player, 54, name);
|
SWInventory inv = new SWInventory(player, 54, name);
|
||||||
|
|
||||||
|
preview(inv, inventory, armor, effects);
|
||||||
|
|
||||||
|
inv.setCallback(-999, (click) -> player.closeInventory());
|
||||||
|
inv.setItem(45, SWItem.getDye(10), (byte)10, "§aKit wählen", (click) -> {
|
||||||
|
Commands.kit(player, name);
|
||||||
|
player.closeInventory();
|
||||||
|
});
|
||||||
|
inv.setItem(53, SWItem.getDye(1), (byte)1, "§cZurück", (click) -> GUI.kitSelection(player));
|
||||||
|
inv.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void preview(SWInventory inv, ItemStack[] inventory, ItemStack[] armor, Collection<PotionEffect> effects) {
|
||||||
//36 = Inventargröße
|
//36 = Inventargröße
|
||||||
for(int i = 0; i < 36; i++){
|
for(int i = 0; i < 36; i++){
|
||||||
if(inventory[i] == null)
|
if(inventory[i] == null)
|
||||||
@ -191,13 +203,5 @@ public class Kit {
|
|||||||
pos--;
|
pos--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inv.setCallback(-999, (click) -> player.closeInventory());
|
|
||||||
inv.setItem(45, SWItem.getDye(10), (byte)10, "§aKit wählen", (click) -> {
|
|
||||||
Commands.kit(player, name);
|
|
||||||
player.closeInventory();
|
|
||||||
});
|
|
||||||
inv.setItem(53, SWItem.getDye(1), (byte)1, "§cZurück", (click) -> GUI.kitSelection(player));
|
|
||||||
inv.open();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,24 +99,7 @@ public class PersonalKitCreator extends BasicListener {
|
|||||||
public static void preview(Player player, PersonalKit kit){
|
public static void preview(Player player, PersonalKit kit){
|
||||||
SWInventory inv = new SWInventory(player, 54, kit.getName());
|
SWInventory inv = new SWInventory(player, 54, kit.getName());
|
||||||
|
|||||||
|
|
||||||
//36 = Inventargröße
|
Kit.preview(inv, kit.getInventory(), kit.getArmor(), null);
|
||||||
Lixfel
hat
b kein Teil der Farbpalette (7??) b kein Teil der Farbpalette (7??)
|
|||||||
for(int i = 0; i < 36; i++){
|
|
||||||
if(kit.getInventory()[i] == null)
|
|
||||||
continue;
|
|
||||||
SWItem item = new SWItem();
|
|
||||||
item.setItemStack(kit.getInventory()[i]);
|
|
||||||
inv.setItem(i, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(kit.getArmor() != null){
|
|
||||||
for(int i = 0; i < 4; i++){
|
|
||||||
if(kit.getArmor()[i] == null)
|
|
||||||
continue;
|
|
||||||
SWItem item = new SWItem();
|
|
||||||
item.setItemStack(kit.getArmor()[i]);
|
|
||||||
inv.setItem(36 + i, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Lixfel
hat
6 ist kein Teil der SW-Farbpalette, wir haben ja Stil und kein Weihnachtsbaumsyndrom wie nahezu alle anderen MC-Server): 78e (7 schätzungsweise die "korrekte" Farbe) 6 ist kein Teil der SW-Farbpalette, wir haben ja Stil und kein Weihnachtsbaumsyndrom wie nahezu alle anderen MC-Server): 78e (7 schätzungsweise die "korrekte" Farbe)
|
|||||||
inv.setItem(45, Material.LEATHER_CHESTPLATE, "§aKit benutzen", clickType -> useKit(player, kit));
|
inv.setItem(45, Material.LEATHER_CHESTPLATE, "§aKit benutzen", clickType -> useKit(player, kit));
|
||||||
Lixfel
hat
löschen klein löschen klein
|
|||||||
inv.setItem(49, SWItem.getMaterial("WOOD_AXE"), "§7Kit bearbeiten", clickType -> openKitCreator(player, kit));
|
inv.setItem(49, SWItem.getMaterial("WOOD_AXE"), "§7Kit bearbeiten", clickType -> openKitCreator(player, kit));
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Lass den Fenster-Titel am besten ungefärbt.