All smithing inventories are now the new smithing inventory
This commit is contained in:
parent
9a919a1438
commit
31fe848d6e
@ -51,7 +51,7 @@
|
||||
+ return bukkitEntity;
|
||||
+ }
|
||||
+
|
||||
+ org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventorySmithingNew(
|
||||
+ org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventorySmithing(
|
||||
+ access.getLocation(), this.inputSlots, this.resultSlots);
|
||||
+ bukkitEntity = new CraftInventoryView(this.player.getBukkitEntity(), inventory, this);
|
||||
+ return bukkitEntity;
|
||||
|
@ -198,7 +198,6 @@ public class CraftContainer extends Container {
|
||||
delegate = new ContainerHopper(windowId, bottom, top);
|
||||
break;
|
||||
case ANVIL:
|
||||
case SMITHING:
|
||||
setupAnvil(top, bottom); // SPIGOT-6783 - manually set up slots so we can use the delegated inventory and not the automatically created one
|
||||
break;
|
||||
case BEACON:
|
||||
@ -231,6 +230,7 @@ public class CraftContainer extends Container {
|
||||
case MERCHANT:
|
||||
delegate = new ContainerMerchant(windowId, bottom);
|
||||
break;
|
||||
case SMITHING:
|
||||
case SMITHING_NEW:
|
||||
setupSmithing(top, bottom); // SPIGOT-6783 - manually set up slots so we can use the delegated inventory and not the automatically created one
|
||||
break;
|
||||
|
@ -505,8 +505,6 @@ public class CraftInventory implements Inventory {
|
||||
return InventoryType.COMPOSTER;
|
||||
} else if (inventory instanceof TileEntityJukeBox) {
|
||||
return InventoryType.JUKEBOX;
|
||||
} else if (this instanceof CraftInventorySmithingNew) {
|
||||
return InventoryType.SMITHING_NEW;
|
||||
} else {
|
||||
return InventoryType.CHEST;
|
||||
}
|
||||
|
@ -29,12 +29,12 @@ public class CraftInventorySmithing extends CraftResultInventory implements Smit
|
||||
|
||||
@Override
|
||||
public ItemStack getResult() {
|
||||
return getItem(2);
|
||||
return getItem(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setResult(ItemStack item) {
|
||||
setItem(2, item);
|
||||
setItem(3, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,45 +0,0 @@
|
||||
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;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.inventory.SmithingInventory;
|
||||
|
||||
public class CraftInventorySmithingNew extends CraftResultInventory implements SmithingInventory {
|
||||
|
||||
private final Location location;
|
||||
|
||||
public CraftInventorySmithingNew(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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult() {
|
||||
return getItem(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setResult(ItemStack item) {
|
||||
setItem(3, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Recipe getRecipe() {
|
||||
IRecipe recipe = getResultInventory().getRecipeUsed();
|
||||
return (recipe == null) ? null : recipe.toBukkitRecipe();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user