From 288662bfaefaa715cf34932b4ceb3ab4c8e5b310 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 17 Mar 2012 10:28:20 -0400 Subject: [PATCH] [Bleeding] Fix some return types that could lead to ArrayStoreException --- .../craftbukkit/inventory/CraftInventoryCrafting.java | 6 +++--- .../bukkit/craftbukkit/inventory/CraftInventoryPlayer.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java index 6e20363cc0..0a64d772c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java @@ -41,8 +41,8 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn } @Override - public CraftItemStack[] getContents() { - CraftItemStack[] items = new CraftItemStack[getSize()]; + public ItemStack[] getContents() { + ItemStack[] items = new ItemStack[getSize()]; net.minecraft.server.ItemStack[] mcResultItems = getResultInventory().getContents(); int i = 0; @@ -85,7 +85,7 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn } public ItemStack[] getMatrix() { - CraftItemStack[] items = new CraftItemStack[getSize()]; + ItemStack[] items = new ItemStack[getSize()]; net.minecraft.server.ItemStack[] matrix = getMatrixInventory().getContents(); for (int i = 0; i < matrix.length; i++ ) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java index 21867fcf72..8ff94dffec 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java @@ -64,9 +64,9 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i setItem(getSize() + 0, boots); } - public CraftItemStack[] getArmorContents() { + public ItemStack[] getArmorContents() { net.minecraft.server.ItemStack[] mcItems = getInventory().getArmorContents(); - CraftItemStack[] ret = new CraftItemStack[mcItems.length]; + ItemStack[] ret = new ItemStack[mcItems.length]; for (int i = 0; i < mcItems.length; i++) { ret[i] = new CraftItemStack(mcItems[i]);