@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/PlayerInventory.java
|
||||
+++ b/net/minecraft/server/PlayerInventory.java
|
||||
@@ -6,6 +6,15 @@
|
||||
@@ -5,6 +5,15 @@
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.ArrayList;
|
||||
@@ -13,10 +13,10 @@
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class PlayerInventory implements IInventory {
|
||||
public class PlayerInventory implements IInventory, INamableTileEntity {
|
||||
|
||||
public final NonNullList<ItemStack> items;
|
||||
@@ -17,6 +26,49 @@
|
||||
@@ -16,6 +25,54 @@
|
||||
private ItemStack carried;
|
||||
private int h;
|
||||
|
||||
@@ -53,6 +53,11 @@
|
||||
+ return this.player.getBukkitEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getMaxStackSize() {
|
||||
+ return maxStack;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size) {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
@@ -66,7 +71,7 @@
|
||||
public PlayerInventory(EntityHuman entityhuman) {
|
||||
this.items = NonNullList.a(36, ItemStack.a);
|
||||
this.armor = NonNullList.a(4, ItemStack.a);
|
||||
@@ -42,6 +94,22 @@
|
||||
@@ -41,6 +98,22 @@
|
||||
return itemstack.getItem() == itemstack1.getItem() && ItemStack.equals(itemstack, itemstack1);
|
||||
}
|
||||
|
||||
@@ -89,16 +94,18 @@
|
||||
public int getFirstEmptySlotIndex() {
|
||||
for (int i = 0; i < this.items.size(); ++i) {
|
||||
if (((ItemStack) this.items.get(i)).isEmpty()) {
|
||||
@@ -502,7 +570,7 @@
|
||||
}
|
||||
@@ -513,8 +586,9 @@
|
||||
ItemStack itemstack = (ItemStack) this.armor.get(i);
|
||||
|
||||
public int getMaxStackSize() {
|
||||
- return 64;
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean b(IBlockData iblockdata) {
|
||||
@@ -554,6 +622,11 @@
|
||||
if (itemstack.getItem() instanceof ItemArmor) {
|
||||
+ int finalI = i; // CraftBukkit - decompile error
|
||||
itemstack.damage((int) f, this.player, (entityhuman) -> {
|
||||
- entityhuman.c(EnumItemSlot.a(EnumItemSlot.Function.ARMOR, i));
|
||||
+ entityhuman.c(EnumItemSlot.a(EnumItemSlot.Function.ARMOR, finalI)); // CraftBukkit - decompile error
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -550,6 +624,11 @@
|
||||
}
|
||||
|
||||
public ItemStack getCarried() {
|
||||
|
||||
Reference in New Issue
Block a user