aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/inventory/ContainerFurnace.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/inventory/ContainerFurnace.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/inventory/ContainerFurnace.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/inventory/ContainerFurnace.patch b/patch-remap/og/net/minecraft/world/inventory/ContainerFurnace.patch
new file mode 100644
index 0000000000..12f662acb0
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/inventory/ContainerFurnace.patch
@@ -0,0 +1,62 @@
+--- a/net/minecraft/world/inventory/ContainerFurnace.java
++++ b/net/minecraft/world/inventory/ContainerFurnace.java
+@@ -14,6 +14,11 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.entity.TileEntityFurnace;
+
++// CraftBukkit start
++import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
++import org.bukkit.craftbukkit.inventory.CraftInventoryView;
++// CraftBukkit end
++
+ public abstract class ContainerFurnace extends ContainerRecipeBook<IInventory> {
+
+ public static final int INGREDIENT_SLOT = 0;
+@@ -31,6 +36,22 @@
+ private final Recipes<? extends RecipeCooking> recipeType;
+ private final RecipeBookType recipeBookType;
+
++ // CraftBukkit start
++ private CraftInventoryView bukkitEntity = null;
++ private PlayerInventory player;
++
++ @Override
++ public CraftInventoryView getBukkitView() {
++ if (bukkitEntity != null) {
++ return bukkitEntity;
++ }
++
++ CraftInventoryFurnace inventory = new CraftInventoryFurnace((TileEntityFurnace) this.container);
++ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
++ return bukkitEntity;
++ }
++ // CraftBukkit end
++
+ protected ContainerFurnace(Containers<?> containers, Recipes<? extends RecipeCooking> recipes, RecipeBookType recipebooktype, int i, PlayerInventory playerinventory) {
+ this(containers, recipes, recipebooktype, i, playerinventory, new InventorySubcontainer(3), new ContainerProperties(4));
+ }
+@@ -47,6 +68,7 @@
+ this.addSlot(new Slot(iinventory, 0, 56, 17));
+ this.addSlot(new SlotFurnaceFuel(this, iinventory, 1, 56, 53));
+ this.addSlot(new SlotFurnaceResult(playerinventory.player, iinventory, 2, 116, 35));
++ this.player = playerinventory; // CraftBukkit - save player
+
+ int j;
+
+@@ -104,6 +126,7 @@
+
+ @Override
+ public boolean stillValid(EntityHuman entityhuman) {
++ if (!this.checkReachable) return true; // CraftBukkit
+ return this.container.stillValid(entityhuman);
+ }
+
+@@ -159,7 +182,7 @@
+ }
+
+ protected boolean canSmelt(ItemStack itemstack) {
+- return this.level.getRecipeManager().getRecipeFor(this.recipeType, new InventorySubcontainer(new ItemStack[]{itemstack}), this.level).isPresent();
++ return this.level.getRecipeManager().getRecipeFor((Recipes<RecipeCooking>) this.recipeType, new InventorySubcontainer(new ItemStack[]{itemstack}), this.level).isPresent(); // Eclipse fail
+ }
+
+ protected boolean isFuel(ItemStack itemstack) {