mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 01:25:03 +01:00
[Bleeding] Fix some return types that could lead to ArrayStoreException
By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
parent
1a5043d05d
commit
b350a11bc0
2 changed files with 5 additions and 5 deletions
|
@ -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++ ) {
|
||||||
|
|
|
@ -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]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue