SPIGOT-6434: Smithing Table and Anvil inventories .getType() returns CRAFTING

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-04-25 08:34:44 +10:00
parent 93ddc2d863
commit 4d865daa32
3 changed files with 11 additions and 37 deletions

View File

@@ -18,7 +18,7 @@
public ContainerSmithing(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
@@ -63,13 +68,16 @@
@@ -63,13 +68,15 @@
List<RecipeSmithing> list = this.g.getCraftingManager().b(Recipes.SMITHING, this.repairInventory, this.g);
if (list.isEmpty()) {
@@ -31,13 +31,12 @@
this.resultInventory.a((IRecipe) this.h);
- this.resultInventory.setItem(0, itemstack);
+ // CraftBukkit start
+ this.repairInventory.setCurrentRecipe(this.h);
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), itemstack);
+ // CraftBukkit end
}
}
@@ -85,4 +93,18 @@
@@ -85,4 +92,18 @@
public boolean a(ItemStack itemstack, Slot slot) {
return slot.inventory != this.resultInventory && super.a(itemstack, slot);
}