mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 04:05:50 -07:00
Implemented addRecipe method in CraftServer and associated recipe classes.
This commit is contained in:
committed by
EvilSeph
parent
017b15c3a6
commit
5a5ce79035
@@ -152,7 +152,8 @@ public class TileEntityFurnace extends TileEntity implements IInventory {
|
||||
} else {
|
||||
ItemStack itemstack = FurnaceRecipes.a().a(this.items[0].getItem().id);
|
||||
|
||||
return itemstack == null ? false : (this.items[2] == null ? true : (!this.items[2].a(itemstack) ? false : (this.items[2].count < this.getMaxStackSize() && this.items[2].count < this.items[2].b() ? true : this.items[2].count < itemstack.b())));
|
||||
// CraftBukkit - consider resultant count instead of current count
|
||||
return itemstack == null ? false : (this.items[2] == null ? true : (!this.items[2].a(itemstack) ? false : (this.items[2].count+itemstack.count <= this.getMaxStackSize() && this.items[2].count < this.items[2].b() ? true : this.items[2].count+itemstack.count <= itemstack.b())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,8 +163,8 @@ public class TileEntityFurnace extends TileEntity implements IInventory {
|
||||
|
||||
if (this.items[2] == null) {
|
||||
this.items[2] = itemstack.j();
|
||||
} else if (this.items[2].id == itemstack.id) {
|
||||
++this.items[2].count;
|
||||
} else if (this.items[2].id == itemstack.id && this.items[2].damage == itemstack.damage) { // CraftBukkit - compare damage too
|
||||
this.items[2].count += itemstack.count; // CraftBukkit - increment by count instead of 1
|
||||
}
|
||||
|
||||
--this.items[0].count;
|
||||
|
Reference in New Issue
Block a user