Set the item's quantity to 1 for every item with MetaData

This commit is contained in:
Acrobot 2013-10-01 19:12:40 +02:00
parent 6474558747
commit 066b735a4c
1 changed files with 4 additions and 1 deletions

View File

@ -64,7 +64,10 @@ public class ItemDatabase {
*/
public String getItemCode(ItemStack item) {
try {
String code = Base64.encodeObject(yaml.dump(item));
ItemStack clone = item.clone();
clone.setAmount(1);
String code = Base64.encodeObject(yaml.dump(clone));
table.insertRow("null, '" + code + '\'');
int id = Integer.parseInt(table.getRow("code='" + code + '\'').get("id"));