Skip to content

Commit

Permalink
fixed leaving a tool behind when there are no incompatible enchantments
Browse files Browse the repository at this point in the history
  • Loading branch information
vdvman1 committed Aug 23, 2013
1 parent 9b7e28b commit 486d1af
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions common/vdvman1/betterAnvil/inventory/ContainerRepairBA.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ public void updateRepairOutput() {
repairCost = combined._1();
repairAmount = combined._2();
EnchantmentHelper.setEnchantments(combined._3(), workStack);
this.resultInputStack = stack2.copy();
EnchantmentHelper.setEnchantments(combined._4(), this.resultInputStack);
this.resultInputStack.setItemDamage(this.resultInputStack.getMaxDamage() - combined._4().size());
if(this.resultInputStack.itemID == Item.enchantedBook.itemID && combined._4().isEmpty()) {
this.resultInputStack = new ItemStack(Item.book);
if(combined._4().size() != 0) {
this.resultInputStack = stack2.copy();
EnchantmentHelper.setEnchantments(combined._4(), this.resultInputStack);
this.resultInputStack.setItemDamage(this.resultInputStack.getMaxDamage() - combined._4().size());
if(this.resultInputStack.itemID == Item.enchantedBook.itemID && combined._4().isEmpty()) {
this.resultInputStack = new ItemStack(Item.book);
}
}
} else if(stack1.itemID == Item.book.itemID && stack2.itemID == Item.enchantedBook.itemID) {
//Copy an enchanted book
Expand Down

0 comments on commit 486d1af

Please sign in to comment.