aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/inventory/ResultContainer.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/inventory/ResultContainer.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/inventory/ResultContainer.java.patch126
1 files changed, 126 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/inventory/ResultContainer.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/inventory/ResultContainer.java.patch
new file mode 100644
index 0000000000..840880b2ea
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/inventory/ResultContainer.java.patch
@@ -0,0 +1,126 @@
+--- a/net/minecraft/world/inventory/ResultContainer.java
++++ b/net/minecraft/world/inventory/ResultContainer.java
+@@ -9,24 +9,61 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.crafting.RecipeHolder;
+
++// CraftBukkit start
++import org.bukkit.Location;
++import org.bukkit.craftbukkit.entity.CraftHumanEntity;
++import org.bukkit.entity.HumanEntity;
++// CraftBukkit end
++
+ public class ResultContainer implements Container, RecipeCraftingHolder {
+
+ private final NonNullList<ItemStack> itemStacks;
+ @Nullable
+ private RecipeHolder<?> recipeUsed;
+
++ // CraftBukkit start
++ private int maxStack = MAX_STACK;
++
++ public java.util.List<ItemStack> getContents() {
++ return this.itemStacks;
++ }
++
++ 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>();
++ }
++
++ @Override
++ public int getMaxStackSize() {
++ return maxStack;
++ }
++
++ public void setMaxStackSize(int size) {
++ maxStack = size;
++ }
++
++ @Override
++ public Location getLocation() {
++ return null;
++ }
++ // CraftBukkit end
++
+ public ResultContainer() {
+ this.itemStacks = NonNullList.withSize(1, ItemStack.EMPTY);
+ }
+
+ @Override
+- @Override
+ public int getContainerSize() {
+ return 1;
+ }
+
+ @Override
+- @Override
+ public boolean isEmpty() {
+ Iterator iterator = this.itemStacks.iterator();
+
+@@ -44,54 +81,45 @@
+ }
+
+ @Override
+- @Override
+- public ItemStack getItem(int i) {
++ public ItemStack getItem(int index) {
+ return (ItemStack) this.itemStacks.get(0);
+ }
+
+ @Override
+- @Override
+- public ItemStack removeItem(int i, int j) {
++ public ItemStack removeItem(int index, int count) {
+ return ContainerHelper.takeItem(this.itemStacks, 0);
+ }
+
+ @Override
+- @Override
+- public ItemStack removeItemNoUpdate(int i) {
++ public ItemStack removeItemNoUpdate(int index) {
+ return ContainerHelper.takeItem(this.itemStacks, 0);
+ }
+
+ @Override
+- @Override
+- public void setItem(int i, ItemStack itemstack) {
+- this.itemStacks.set(0, itemstack);
++ public void setItem(int index, ItemStack stack) {
++ this.itemStacks.set(0, stack);
+ }
+
+ @Override
+- @Override
+ public void setChanged() {}
+
+ @Override
+- @Override
+ public boolean stillValid(Player player) {
+ return true;
+ }
+
+ @Override
+- @Override
+ public void clearContent() {
+ this.itemStacks.clear();
+ }
+
+ @Override
+- @Override
+ public void setRecipeUsed(@Nullable RecipeHolder<?> recipeholder) {
+ this.recipeUsed = recipeholder;
+ }
+
+ @Nullable
+ @Override
+- @Override
+ public RecipeHolder<?> getRecipeUsed() {
+ return this.recipeUsed;
+ }