summaryrefslogtreecommitdiffstats
path: root/nms-patches/ContainerPlayer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/ContainerPlayer.patch')
-rw-r--r--nms-patches/ContainerPlayer.patch27
1 files changed, 18 insertions, 9 deletions
diff --git a/nms-patches/ContainerPlayer.patch b/nms-patches/ContainerPlayer.patch
index a79220cb..3e0d58dc 100644
--- a/nms-patches/ContainerPlayer.patch
+++ b/nms-patches/ContainerPlayer.patch
@@ -1,17 +1,17 @@
--- a/net/minecraft/server/ContainerPlayer.java
+++ b/net/minecraft/server/ContainerPlayer.java
-@@ -1,6 +1,10 @@
+@@ -1,5 +1,10 @@
package net.minecraft.server;
- import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
-
++
public class ContainerPlayer extends Container {
-@@ -9,10 +13,20 @@
+ private static final EnumItemSlot[] h = new EnumItemSlot[] { EnumItemSlot.HEAD, EnumItemSlot.CHEST, EnumItemSlot.LEGS, EnumItemSlot.FEET};
+@@ -7,10 +12,20 @@
public IInventory resultInventory = new InventoryCraftResult();
public boolean g;
private final EntityHuman owner;
@@ -32,7 +32,7 @@
this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 154, 28)));
int i;
-@@ -25,7 +39,7 @@
+@@ -23,7 +38,7 @@
}
for (i = 0; i < 4; ++i) {
@@ -41,9 +41,18 @@
this.a(new Slot(playerinventory, 36 + (3 - i), 8, 8 + i * 18) {
public int getMaxStackSize() {
-@@ -59,11 +73,22 @@
- return super.isAllowed(itemstack);
- }
+@@ -31,7 +46,7 @@
+ }
+
+ public boolean isAllowed(ItemStack itemstack) {
+- return enumitemslot == EntityInsentient.d(itemstack);
++ return enumitemslot1 == EntityInsentient.d(itemstack); // CraftBukkit - decompile error
+ }
+
+ public boolean isAllowed(EntityHuman entityhuman) {
+@@ -54,11 +69,22 @@
+
+ this.a(new Slot(playerinventory, 40, 77, 62) {
});
- this.a((IInventory) this.craftInventory);
+ // this.a((IInventory) this.craftInventory); // CraftBukkit - unneeded since it just sets result slot to empty
@@ -66,7 +75,7 @@
}
public void b(EntityHuman entityhuman) {
-@@ -150,4 +175,17 @@
+@@ -148,4 +174,17 @@
public boolean a(ItemStack itemstack, Slot slot) {
return slot.inventory != this.resultInventory && super.a(itemstack, slot);
}