2015-05-25 18:37:24 +08:00
|
|
|
--- a/net/minecraft/server/InventoryCraftResult.java
|
|
|
|
+++ b/net/minecraft/server/InventoryCraftResult.java
|
2017-05-14 10:00:00 +08:00
|
|
|
@@ -2,12 +2,45 @@
|
2014-11-26 05:32:16 +08:00
|
|
|
|
2016-11-17 09:41:03 +08:00
|
|
|
import java.util.Iterator;
|
2017-05-14 10:00:00 +08:00
|
|
|
import javax.annotation.Nullable;
|
2014-11-26 05:32:16 +08:00
|
|
|
+// CraftBukkit start
|
2016-03-01 05:32:46 +08:00
|
|
|
+import org.bukkit.Location;
|
2014-11-26 05:32:16 +08:00
|
|
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
|
|
|
+import org.bukkit.entity.HumanEntity;
|
|
|
|
+// CraftBukkit end
|
2016-05-10 19:47:39 +08:00
|
|
|
|
2018-07-15 08:00:00 +08:00
|
|
|
public class InventoryCraftResult implements IInventory, RecipeHolder {
|
2014-11-26 05:32:16 +08:00
|
|
|
|
2016-11-17 09:41:03 +08:00
|
|
|
private final NonNullList<ItemStack> items;
|
2017-05-14 10:00:00 +08:00
|
|
|
private IRecipe b;
|
2015-02-27 06:41:06 +08:00
|
|
|
|
2014-11-26 05:32:16 +08:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ private int maxStack = MAX_STACK;
|
|
|
|
+
|
2016-11-17 09:41:03 +08:00
|
|
|
+ public java.util.List<ItemStack> getContents() {
|
2014-11-26 05:32:16 +08:00
|
|
|
+ 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-03-01 05:32:46 +08:00
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Location getLocation() {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
2015-02-27 06:41:06 +08:00
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
2016-11-17 09:41:03 +08:00
|
|
|
public InventoryCraftResult() {
|
|
|
|
this.items = NonNullList.a(1, ItemStack.a);
|
|
|
|
}
|
2018-07-15 08:00:00 +08:00
|
|
|
@@ -62,7 +95,7 @@
|
2014-11-26 05:32:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getMaxStackSize() {
|
|
|
|
- return 64;
|
|
|
|
+ return maxStack; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
public void update() {}
|