mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 12:46:12 +03:00
52 lines
1.9 KiB
Diff
52 lines
1.9 KiB
Diff
--- ../src-base/minecraft/net/minecraft/inventory/ContainerFurnace.java
|
|
+++ ../src-work/minecraft/net/minecraft/inventory/ContainerFurnace.java
|
|
@@ -1,6 +1,10 @@
|
|
package net.minecraft.inventory;
|
|
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
|
+
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
import net.minecraft.item.ItemStack;
|
|
@@ -16,13 +20,29 @@
|
|
private int totalCookTime;
|
|
private int furnaceBurnTime;
|
|
private int currentItemBurnTime;
|
|
+ // CraftBukkit start
|
|
+ private CraftInventoryView bukkitEntity = null;
|
|
+ private InventoryPlayer player;
|
|
|
|
+ @Override
|
|
+ public CraftInventoryView getBukkitView() {
|
|
+ if (bukkitEntity != null) {
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+
|
|
+ CraftInventoryFurnace inventory = new CraftInventoryFurnace((TileEntityFurnace) this.tileFurnace);
|
|
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public ContainerFurnace(InventoryPlayer playerInventory, IInventory furnaceInventory)
|
|
{
|
|
this.tileFurnace = furnaceInventory;
|
|
this.addSlotToContainer(new Slot(furnaceInventory, 0, 56, 17));
|
|
this.addSlotToContainer(new SlotFurnaceFuel(furnaceInventory, 1, 56, 53));
|
|
this.addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, furnaceInventory, 2, 116, 35));
|
|
+ this.player = playerInventory; // CraftBukkit - save player
|
|
|
|
for (int i = 0; i < 3; ++i)
|
|
{
|
|
@@ -87,6 +107,7 @@
|
|
|
|
public boolean canInteractWith(EntityPlayer playerIn)
|
|
{
|
|
+ if (!this.checkReachable) return true; // CraftBukkit
|
|
return this.tileFurnace.isUseableByPlayer(playerIn);
|
|
}
|
|
|