Convert Materials in old Data Files when loading in 1.13

This commit is contained in:
Sn0wStorm 2018-10-30 15:37:24 +01:00
parent d29b8defd4
commit 72d13b30dd

View File

@ -483,7 +483,17 @@ public class P extends JavaPlugin {
ArrayList<ItemStack> ingredients = new ArrayList<>();
for (String mat : matSection.getKeys(false)) {
String[] matSplit = mat.split(",");
ItemStack item = new ItemStack(Material.getMaterial(matSplit[0]), matSection.getInt(mat));
Material m = Material.getMaterial(matSplit[0]);
if (m == null && use1_13) {
if (matSplit[0].equals("LONG_GRASS")) {
m = Material.GRASS;
} else {
m = Material.matchMaterial(matSplit[0], true);
}
debugLog("converting Data Material from " + matSplit[0] + " to " + m);
}
if (m == null) continue;
ItemStack item = new ItemStack(m, matSection.getInt(mat));
if (matSplit.length == 2) {
item.setDurability((short) P.p.parseInt(matSplit[1]));
}