3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 04:50:05 +01:00
Paper/nms-patches/InventoryCraftResult.patch

57 Zeilen
1.4 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/InventoryCraftResult.java
+++ b/net/minecraft/server/InventoryCraftResult.java
2016-05-10 13:47:39 +02:00
@@ -1,11 +1,44 @@
package net.minecraft.server;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
+// CraftBukkit start
2016-02-29 22:32:46 +01:00
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+// CraftBukkit end
2016-05-10 13:47:39 +02:00
public class InventoryCraftResult implements IInventory {
2016-06-09 03:43:49 +02:00
private final ItemStack[] items = new ItemStack[1];
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
+ private int maxStack = MAX_STACK;
+
+ public ItemStack[] getContents() {
+ return this.items;
+ }
+
+ public org.bukkit.inventory.InventoryHolder getOwner() {
+ return null; // Result slots don't get an owner
+ }
+
+ // Don't need a transaction; the InventoryCrafting keeps track of it for us
+ public void onOpen(CraftHumanEntity who) {}
+ public void onClose(CraftHumanEntity who) {}
+ public java.util.List<HumanEntity> getViewers() {
+ return new java.util.ArrayList<HumanEntity>();
+ }
+
+ public void setMaxStackSize(int size) {
+ maxStack = size;
+ }
2016-02-29 22:32:46 +01:00
+
+ @Override
+ public Location getLocation() {
+ return null;
+ }
2015-02-26 23:41:06 +01:00
+ // CraftBukkit end
+
public InventoryCraftResult() {}
2015-02-26 23:41:06 +01:00
public int getSize() {
2016-05-10 13:47:39 +02:00
@@ -44,7 +77,7 @@
}
public int getMaxStackSize() {
- return 64;
+ return maxStack; // CraftBukkit
}
public void update() {}