aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/TransientCraftingContainer.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/TransientCraftingContainer.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/TransientCraftingContainer.java.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/TransientCraftingContainer.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/TransientCraftingContainer.java.patch
new file mode 100644
index 0000000000..b665ab63fe
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/TransientCraftingContainer.java.patch
@@ -0,0 +1,74 @@
+--- a/net/minecraft/world/inventory/TransientCraftingContainer.java
++++ b/net/minecraft/world/inventory/TransientCraftingContainer.java
+@@ -8,15 +9,29 @@
+ import net.minecraft.world.entity.player.StackedContents;
+ import net.minecraft.world.item.ItemStack;
+
+-public class TransientCraftingContainer implements CraftingContainer {
++// CraftBukkit start
++import java.util.List;
++import net.minecraft.world.item.crafting.RecipeHolder;
++import org.bukkit.Location;
++import org.bukkit.craftbukkit.entity.CraftHumanEntity;
++import org.bukkit.entity.HumanEntity;
++import org.bukkit.event.inventory.InventoryType;
++// CraftBukkit end
+
+ private final NonNullList<ItemStack> items;
+ private final int width;
+ private final int height;
+ private final AbstractContainerMenu menu;
+
+- public TransientCraftingContainer(AbstractContainerMenu abstractcontainermenu, int i, int j) {
+- this(abstractcontainermenu, i, j, NonNullList.withSize(i * j, ItemStack.EMPTY));
++ // CraftBukkit start - add fields
++ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
++ private RecipeHolder<?> currentRecipe;
++ public Container resultInventory;
++ private Player owner;
++ private int maxStack = MAX_STACK;
++
++ public List<ItemStack> getContents() {
++ return this.items;
+ }
+
+ public TransientCraftingContainer(AbstractContainerMenu abstractcontainermenu, int i, int j, NonNullList<ItemStack> nonnulllist) {
+@@ -28,6 +67,38 @@
+
+ @Override
+ @Override
++ public Location getLocation() {
++ return menu instanceof CraftingMenu ? ((CraftingMenu) menu).access.getLocation() : owner.getBukkitEntity().getLocation();
++ }
++
++ @Override
++ public RecipeHolder<?> getCurrentRecipe() {
++ return currentRecipe;
++ }
++
++ @Override
++ public void setCurrentRecipe(RecipeHolder<?> currentRecipe) {
++ this.currentRecipe = currentRecipe;
++ }
++
++ public TransientCraftingContainer(AbstractContainerMenu container, int i, int j, Player player) {
++ this(container, i, j);
++ this.owner = player;
++ }
++ // CraftBukkit end
++
++ public TransientCraftingContainer(AbstractContainerMenu menu, int width, int height) {
++ this(menu, width, height, NonNullList.withSize(width * height, ItemStack.EMPTY));
++ }
++
++ public TransientCraftingContainer(AbstractContainerMenu menu, int width, int height, NonNullList<ItemStack> items) {
++ this.items = items;
++ this.menu = menu;
++ this.width = width;
++ this.height = height;
++ }
++
++ @Override
+ public int getContainerSize() {
+ return this.items.size();
+ }