[Bleeding] Fix some return types that could lead to ArrayStoreException

By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
CraftBukkit/Spigot 2012-03-17 10:28:20 -04:00
parent 1a5043d05d
commit b350a11bc0
2 changed files with 5 additions and 5 deletions

View file

@ -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++ ) {

View file

@ -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]);