mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-03 06:40:19 +08:00
SPIGOT-3923: Defer PlayerInventory ItemStack change to 1.13
This commit is contained in:
parent
ca057a3457
commit
61ca7d92c1
@ -46,10 +46,7 @@ public class CraftInventory implements Inventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getItem(int index) {
|
public ItemStack getItem(int index) {
|
||||||
return asCraftMirror(getInventory().getItem(index));
|
net.minecraft.server.ItemStack item = getInventory().getItem(index);
|
||||||
}
|
|
||||||
|
|
||||||
protected static ItemStack asCraftMirror(net.minecraft.server.ItemStack item) {
|
|
||||||
return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item);
|
return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +56,7 @@ public class CraftInventory implements Inventory {
|
|||||||
|
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
net.minecraft.server.ItemStack mcItem = mcItems.get(i);
|
net.minecraft.server.ItemStack mcItem = mcItems.get(i);
|
||||||
items[i] = asCraftMirror(mcItem);
|
items[i] = (mcItem.isEmpty()) ? null : CraftItemStack.asCraftMirror(mcItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
@ -29,7 +29,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItemInMainHand() {
|
public ItemStack getItemInMainHand() {
|
||||||
return asCraftMirror(getInventory().getItemInHand());
|
return CraftItemStack.asCraftMirror(getInventory().getItemInHand());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -39,7 +39,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItemInOffHand() {
|
public ItemStack getItemInOffHand() {
|
||||||
return asCraftMirror(getInventory().extraSlots.get(0));
|
return CraftItemStack.asCraftMirror(getInventory().extraSlots.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user