Fix possible errors with ItemStacks

This commit is contained in:
Acrobot 2013-10-27 16:50:04 +01:00
parent 2c94175a23
commit 207628ae62
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,7 @@ public class ItemDatabase {
*/
public String getItemCode(ItemStack item) {
try {
ItemStack clone = item.clone();
ItemStack clone = new ItemStack(item);
clone.setAmount(1);
String code = Base64.encodeObject(yaml.dump(clone));
@ -78,6 +78,8 @@ public class ItemDatabase {
} catch (SQLException e) {
e.printStackTrace();
return null;
} catch (IllegalArgumentException e) {
return null;
}
}