aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch
new file mode 100644
index 0000000000..aaf5b6de89
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch
@@ -0,0 +1,55 @@
+--- a/net/minecraft/world/inventory/AbstractFurnaceMenu.java
++++ b/net/minecraft/world/inventory/AbstractFurnaceMenu.java
+@@ -13,6 +13,10 @@
+ import net.minecraft.world.item.crafting.RecipeType;
+ import net.minecraft.world.level.Level;
+ import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
++// CraftBukkit start
++import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
++import org.bukkit.craftbukkit.inventory.CraftInventoryView;
++// CraftBukkit end
+
+ public abstract class AbstractFurnaceMenu extends RecipeBookMenu<Container> {
+
+@@ -31,9 +35,21 @@
+ private final RecipeType<? extends AbstractCookingRecipe> recipeType;
+ private final RecipeBookType recipeBookType;
+
+- protected AbstractFurnaceMenu(MenuType<?> menutype, RecipeType<? extends AbstractCookingRecipe> recipetype, RecipeBookType recipebooktype, int i, Inventory inventory) {
+- this(menutype, recipetype, recipebooktype, i, inventory, new SimpleContainer(3), new SimpleContainerData(4));
++ // CraftBukkit start
++ private CraftInventoryView bukkitEntity = null;
++ private Inventory player;
++
++ @Override
++ public CraftInventoryView getBukkitView() {
++ if (bukkitEntity != null) {
++ return bukkitEntity;
++ }
++
++ CraftInventoryFurnace inventory = new CraftInventoryFurnace((AbstractFurnaceBlockEntity) this.container);
++ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
++ return bukkitEntity;
+ }
++ // CraftBukkit end
+
+ protected AbstractFurnaceMenu(MenuType<?> menutype, RecipeType<? extends AbstractCookingRecipe> recipetype, RecipeBookType recipebooktype, int i, Inventory inventory, Container container, ContainerData containerdata) {
+ super(menutype, i);
+@@ -46,7 +66,8 @@
+ this.level = inventory.player.level();
+ this.addSlot(new Slot(container, 0, 56, 17));
+ this.addSlot(new FurnaceFuelSlot(this, container, 1, 56, 53));
+- this.addSlot(new FurnaceResultSlot(inventory.player, container, 2, 116, 35));
++ this.addSlot(new FurnaceResultSlot(playerInventory.player, container, 2, 116, 35));
++ this.player = playerInventory; // CraftBukkit - save player
+
+ int j;
+
+@@ -112,6 +125,7 @@
+ @Override
+ @Override
+ public boolean stillValid(Player player) {
++ if (!this.checkReachable) return true; // CraftBukkit
+ return this.container.stillValid(player);
+ }
+