Files
CatServer/patches/net/minecraft/inventory/InventoryCraftResult.java.patch
2019-02-24 22:29:41 +08:00

54 lines
1.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/inventory/InventoryCraftResult.java
+++ ../src-work/minecraft/net/minecraft/inventory/InventoryCraftResult.java
@@ -8,12 +8,41 @@
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
public class InventoryCraftResult implements IInventory
{
private final NonNullList<ItemStack> stackResult = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY);
private IRecipe recipeUsed;
+ private int maxStack = MAX_STACK;
+
+ public java.util.List<ItemStack> getContents() {
+ return this.stackResult;
+ }
+
+ 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;
+ }
+
+ @Override
+ public Location getLocation() {
+ return null;
+ }
+
public int getSizeInventory()
{
return 1;
@@ -69,7 +98,7 @@
public int getInventoryStackLimit()
{
- return 64;
+ return maxStack;
}
public void markDirty()