mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-08 11:41:28 +01:00
Catch kit conversion.
This commit is contained in:
parent
748538742c
commit
af788389cd
@ -38,17 +38,21 @@ public class Convert {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void convertKits(Hook hook) {
|
private static void convertKits(Hook hook) {
|
||||||
Set<String> kits = hook.getKits();
|
try {
|
||||||
for (String kit : kits) {
|
Set<String> kits = hook.getKits();
|
||||||
Kit kitObj = UltimateKits.getInstance().getKitManager().addKit(new Kit(kit));
|
for (String kit : kits) {
|
||||||
if (kitObj == null) continue;
|
Kit kitObj = UltimateKits.getInstance().getKitManager().addKit(new Kit(kit));
|
||||||
for (ItemStack item : hook.getItems(kit)) {
|
if (kitObj == null) continue;
|
||||||
if (item == null || item.getType() == Material.AIR) continue;
|
for (ItemStack item : hook.getItems(kit)) {
|
||||||
kitObj.getContents().add(new KitItem(item));
|
if (item == null || item.getType() == Material.AIR) continue;
|
||||||
|
kitObj.getContents().add(new KitItem(item));
|
||||||
|
}
|
||||||
|
kitObj.setDelay(hook.getDelay(kit));
|
||||||
}
|
}
|
||||||
kitObj.setDelay(hook.getDelay(kit));
|
UltimateKits.getInstance().saveKits(true);
|
||||||
|
} catch (NoSuchMethodError | NoClassDefFoundError e) {
|
||||||
|
System.out.println("UltimateKits conversion failed.");
|
||||||
}
|
}
|
||||||
UltimateKits.getInstance().saveKits(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isInJsonFormat() {
|
private static boolean isInJsonFormat() {
|
||||||
|
Loading…
Reference in New Issue
Block a user