Fixed 1.0 fallback compatibility for Armory. whooops ;)

This commit is contained in:
Jascha Starke 2012-01-18 08:53:21 +01:00
parent 8dd09525c2
commit b7b247f92e

View file

@ -12,34 +12,34 @@ public class Armor implements Storeable {
@Override @Override
public void store(ConfigurationSection section) { public void store(ConfigurationSection section) {
if (inv.getHelmet() != null && inv.getHelmet().getTypeId() != 0) if (inv.getHelmet() != null && inv.getHelmet().getTypeId() != 0)
section.set("helmet", inv.getHelmet()); Items.sectionSetItem(section, "helmet", inv.getHelmet());
if (inv.getChestplate() != null && inv.getChestplate().getTypeId() != 0) if (inv.getChestplate() != null && inv.getChestplate().getTypeId() != 0)
section.set("chestplate", inv.getChestplate()); Items.sectionSetItem(section, "chestplate", inv.getChestplate());
if (inv.getLeggings() != null && inv.getLeggings().getTypeId() != 0) if (inv.getLeggings() != null && inv.getLeggings().getTypeId() != 0)
section.set("leggins", inv.getLeggings()); Items.sectionSetItem(section, "leggins", inv.getLeggings());
if (inv.getBoots() != null && inv.getBoots().getTypeId() != 0) if (inv.getBoots() != null && inv.getBoots().getTypeId() != 0)
section.set("boots", inv.getBoots()); Items.sectionSetItem(section, "boots", inv.getBoots());
} }
@Override @Override
public void restore(ConfigurationSection section) { public void restore(ConfigurationSection section) {
if (section.contains("helmet")) if (section.contains("helmet"))
inv.setHelmet(section.getItemStack("helmet")); inv.setHelmet(Items.sectionGetItem(section, "helmet"));
else else
inv.setHelmet(null); inv.setHelmet(null);
if (section.contains("chestplate")) if (section.contains("chestplate"))
inv.setChestplate(section.getItemStack("chestplate")); inv.setChestplate(Items.sectionGetItem(section, "chestplate"));
else else
inv.setChestplate(null); inv.setChestplate(null);
if (section.contains("leggins")) if (section.contains("leggins"))
inv.setLeggings(section.getItemStack("leggins")); inv.setLeggings(Items.sectionGetItem(section, "leggins"));
else else
inv.setLeggings(null); inv.setLeggings(null);
if (section.contains("boots")) if (section.contains("boots"))
inv.setBoots(section.getItemStack("boots")); inv.setBoots(Items.sectionGetItem(section, "boots"));
else else
inv.setBoots(null); inv.setBoots(null);
} }