All smithing inventories are now the new smithing inventory
This commit is contained in:
parent
9a919a1438
commit
31fe848d6e
@ -51,7 +51,7 @@
|
|||||||
+ return bukkitEntity;
|
+ 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);
|
+ access.getLocation(), this.inputSlots, this.resultSlots);
|
||||||
+ bukkitEntity = new CraftInventoryView(this.player.getBukkitEntity(), inventory, this);
|
+ bukkitEntity = new CraftInventoryView(this.player.getBukkitEntity(), inventory, this);
|
||||||
+ return bukkitEntity;
|
+ return bukkitEntity;
|
||||||
|
@ -198,7 +198,6 @@ public class CraftContainer extends Container {
|
|||||||
delegate = new ContainerHopper(windowId, bottom, top);
|
delegate = new ContainerHopper(windowId, bottom, top);
|
||||||
break;
|
break;
|
||||||
case ANVIL:
|
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
|
setupAnvil(top, bottom); // SPIGOT-6783 - manually set up slots so we can use the delegated inventory and not the automatically created one
|
||||||
break;
|
break;
|
||||||
case BEACON:
|
case BEACON:
|
||||||
@ -231,6 +230,7 @@ public class CraftContainer extends Container {
|
|||||||
case MERCHANT:
|
case MERCHANT:
|
||||||
delegate = new ContainerMerchant(windowId, bottom);
|
delegate = new ContainerMerchant(windowId, bottom);
|
||||||
break;
|
break;
|
||||||
|
case SMITHING:
|
||||||
case SMITHING_NEW:
|
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
|
setupSmithing(top, bottom); // SPIGOT-6783 - manually set up slots so we can use the delegated inventory and not the automatically created one
|
||||||
break;
|
break;
|
||||||
|
@ -505,8 +505,6 @@ public class CraftInventory implements Inventory {
|
|||||||
return InventoryType.COMPOSTER;
|
return InventoryType.COMPOSTER;
|
||||||
} else if (inventory instanceof TileEntityJukeBox) {
|
} else if (inventory instanceof TileEntityJukeBox) {
|
||||||
return InventoryType.JUKEBOX;
|
return InventoryType.JUKEBOX;
|
||||||
} else if (this instanceof CraftInventorySmithingNew) {
|
|
||||||
return InventoryType.SMITHING_NEW;
|
|
||||||
} else {
|
} else {
|
||||||
return InventoryType.CHEST;
|
return InventoryType.CHEST;
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,12 @@ public class CraftInventorySmithing extends CraftResultInventory implements Smit
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getResult() {
|
public ItemStack getResult() {
|
||||||
return getItem(2);
|
return getItem(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setResult(ItemStack item) {
|
public void setResult(ItemStack item) {
|
||||||
setItem(2, item);
|
setItem(3, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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