13
0
geforkt von Mirrors/Paper

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

Dieser Commit ist enthalten in:
Celtic Minstrel 2012-03-17 10:28:20 -04:00 committet von EvilSeph
Ursprung b9a71db046
Commit 288662bfae
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -41,8 +41,8 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn
} }
@Override @Override
public CraftItemStack[] getContents() { public ItemStack[] getContents() {
CraftItemStack[] items = new CraftItemStack[getSize()]; ItemStack[] items = new ItemStack[getSize()];
net.minecraft.server.ItemStack[] mcResultItems = getResultInventory().getContents(); net.minecraft.server.ItemStack[] mcResultItems = getResultInventory().getContents();
int i = 0; int i = 0;
@ -85,7 +85,7 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn
} }
public ItemStack[] getMatrix() { public ItemStack[] getMatrix() {
CraftItemStack[] items = new CraftItemStack[getSize()]; ItemStack[] items = new ItemStack[getSize()];
net.minecraft.server.ItemStack[] matrix = getMatrixInventory().getContents(); net.minecraft.server.ItemStack[] matrix = getMatrixInventory().getContents();
for (int i = 0; i < matrix.length; i++ ) { for (int i = 0; i < matrix.length; i++ ) {

Datei anzeigen

@ -64,9 +64,9 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
setItem(getSize() + 0, boots); setItem(getSize() + 0, boots);
} }
public CraftItemStack[] getArmorContents() { public ItemStack[] getArmorContents() {
net.minecraft.server.ItemStack[] mcItems = getInventory().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++) { for (int i = 0; i < mcItems.length; i++) {
ret[i] = new CraftItemStack(mcItems[i]); ret[i] = new CraftItemStack(mcItems[i]);