SteamWar/SpigotCore
Archiviert
13
0

Add Fix Armor Null

Dieser Commit ist enthalten in:
Chaoscaot 2021-01-30 17:10:38 +01:00
Ursprung 5f3004c78d
Commit 614fab209f

Datei anzeigen

@ -71,6 +71,9 @@ public class PersonalKit {
} }
public static PersonalKit create(int userID, String gamemode, String name, ItemStack[] inventory, ItemStack[] armor){ public static PersonalKit create(int userID, String gamemode, String name, ItemStack[] inventory, ItemStack[] armor){
if(armor == null) {
armor = new ItemStack[]{null, null, null, null};
}
SQL.update("INSERT INTO PersonalKit (UserID, GameMode, Name, Inventory, Armor) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE Inventory = VALUES(Inventory), Armor = VALUES(Armor), Name = VALUES(name)", SQL.update("INSERT INTO PersonalKit (UserID, GameMode, Name, Inventory, Armor) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE Inventory = VALUES(Inventory), Armor = VALUES(Armor), Name = VALUES(name)",
userID, gamemode, name, saveInvConfig("Inventory", inventory), saveInvConfig("Armor", armor)); userID, gamemode, name, saveInvConfig("Inventory", inventory), saveInvConfig("Armor", armor));
return get(userID, gamemode, name); return get(userID, gamemode, name);