mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-02 22:38:06 +01:00
Fixing GUI icons for new ItemStack deserializator
This commit is contained in:
parent
70303080b6
commit
16a59470fc
@ -1170,8 +1170,10 @@ public class ConfigManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
CMIItemStack item = CMIItemStack.deserialize(guiSection.getString("ItemStack"), ahead);
|
CMIItemStack item = CMIItemStack.deserialize(guiSection.getString("ItemStack"), ahead);
|
||||||
if (!ahead.isAsyncHead() && item != null && item.getCMIType().isNone())
|
|
||||||
|
if (!ahead.isAsyncHead() && item != null && !item.getCMIType().isNone()) {
|
||||||
gItem.setGuiItem(item.getItemStack());
|
gItem.setGuiItem(item.getItemStack());
|
||||||
|
}
|
||||||
|
|
||||||
} else if (guiSection.isString("Item")) {
|
} else if (guiSection.isString("Item")) {
|
||||||
String item = guiSection.getString("Item");
|
String item = guiSection.getString("Item");
|
||||||
@ -1212,12 +1214,16 @@ public class ConfigManager {
|
|||||||
CMIMessages.consoleMessage("&5Update " + jobConfigName + " jobs gui item section to use `ItemStack` instead of `Item` sections format. More information inside _EXAMPLE job file");
|
CMIMessages.consoleMessage("&5Update " + jobConfigName + " jobs gui item section to use `ItemStack` instead of `Item` sections format. More information inside _EXAMPLE job file");
|
||||||
informedGUI = true;
|
informedGUI = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gItem.setGuiItem(guiItem);
|
||||||
} else if (guiSection.isInt("Id") && guiSection.isInt("Data")) {
|
} else if (guiSection.isInt("Id") && guiSection.isInt("Data")) {
|
||||||
guiItem = CMIMaterial.get(guiSection.getInt("Id"), guiSection.getInt("Data")).newItemStack();
|
guiItem = CMIMaterial.get(guiSection.getInt("Id"), guiSection.getInt("Data")).newItemStack();
|
||||||
|
gItem.setGuiItem(guiItem);
|
||||||
CMIMessages.consoleMessage("Update " + jobConfigName + " jobs gui item section to use `Item` instead of `Id` and `Data` sections");
|
CMIMessages.consoleMessage("Update " + jobConfigName + " jobs gui item section to use `Item` instead of `Id` and `Data` sections");
|
||||||
} else
|
} else
|
||||||
log.warning("Job " + jobConfigName + " has an invalid (" + guiSection.getString("Item") + ") Gui property. Please fix this if you want to use it!");
|
log.warning("Job " + jobConfigName + " has an invalid (" + guiSection.getString("Item") + ") Gui property. Please fix this if you want to use it!");
|
||||||
|
|
||||||
|
if (guiSection.isList("Enchantments")) {
|
||||||
for (String str4 : guiSection.getStringList("Enchantments")) {
|
for (String str4 : guiSection.getStringList("Enchantments")) {
|
||||||
String[] id = str4.split(":", 2);
|
String[] id = str4.split(":", 2);
|
||||||
|
|
||||||
@ -1241,16 +1247,16 @@ public class ConfigManager {
|
|||||||
} else
|
} else
|
||||||
guiItem.addUnsafeEnchantment(enchant, level);
|
guiItem.addUnsafeEnchantment(enchant, level);
|
||||||
}
|
}
|
||||||
|
gItem.setGuiItem(guiItem);
|
||||||
|
}
|
||||||
|
|
||||||
String customSkull = guiSection.getString("CustomSkull", "");
|
String customSkull = guiSection.getString("CustomSkull", "");
|
||||||
if (!customSkull.isEmpty()) {
|
if (!customSkull.isEmpty()) {
|
||||||
guiItem = Util.getSkull(customSkull);
|
gItem.setGuiItem(Util.getSkull(customSkull));
|
||||||
}
|
}
|
||||||
gItem.setGuiSlot(guiSection.getInt("slot", -1));
|
gItem.setGuiSlot(guiSection.getInt("slot", -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
gItem.setGuiItem(guiItem);
|
|
||||||
|
|
||||||
job.setGuiItem(gItem);
|
job.setGuiItem(gItem);
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
|
@ -45,6 +45,7 @@ public class DatabaseSaveThread extends Thread {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if (running)
|
||||||
Jobs.getPlayerManager().saveAll();
|
Jobs.getPlayerManager().saveAll();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user