SPIGOT-6434: Smithing Table and Anvil inventories .getType() returns CRAFTING
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.craftbukkit.inventory;
|
||||
|
||||
import net.minecraft.world.IInventory;
|
||||
import net.minecraft.world.inventory.InventoryCraftResult;
|
||||
import net.minecraft.world.item.crafting.IRecipe;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -11,11 +12,16 @@ public class CraftInventorySmithing extends CraftResultInventory implements Smit
|
||||
|
||||
private final Location location;
|
||||
|
||||
public CraftInventorySmithing(Location location, IInventory inventory, IInventory resultInventory) {
|
||||
public CraftInventorySmithing(Location location, IInventory inventory, InventoryCraftResult resultInventory) {
|
||||
super(inventory, resultInventory);
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryCraftResult getResultInventory() {
|
||||
return (InventoryCraftResult) super.getResultInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
@@ -33,7 +39,7 @@ public class CraftInventorySmithing extends CraftResultInventory implements Smit
|
||||
|
||||
@Override
|
||||
public Recipe getRecipe() {
|
||||
IRecipe recipe = getInventory().getCurrentRecipe();
|
||||
IRecipe recipe = getResultInventory().ak_();
|
||||
return (recipe == null) ? null : recipe.toBukkitRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user