mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 14:26:00 +03:00
49 lines
1.8 KiB
Diff
49 lines
1.8 KiB
Diff
--- ../src-base/minecraft/net/minecraft/inventory/ContainerBrewingStand.java
|
|
+++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java
|
|
@@ -1,6 +1,11 @@
|
|
package net.minecraft.inventory;
|
|
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventory;
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer;
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
|
+
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
import net.minecraft.init.Items;
|
|
@@ -19,9 +24,25 @@
|
|
private final Slot theSlot;
|
|
private int prevBrewTime;
|
|
private int prevFuel;
|
|
+ // CraftBukkit start
|
|
+ private CraftInventoryView bukkitEntity = null;
|
|
+ private InventoryPlayer player;
|
|
|
|
+ @Override
|
|
+ public CraftInventoryView getBukkitView() {
|
|
+ if (bukkitEntity != null) {
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+
|
|
+ CraftInventory inventory = new CraftInventoryBrewer(this.tileBrewingStand);
|
|
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
|
+ return bukkitEntity;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
public ContainerBrewingStand(InventoryPlayer playerInventory, IInventory tileBrewingStandIn)
|
|
{
|
|
+ player = playerInventory; // CraftBukkit
|
|
this.tileBrewingStand = tileBrewingStandIn;
|
|
this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 0, 56, 51));
|
|
this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 1, 79, 58));
|
|
@@ -80,6 +101,7 @@
|
|
|
|
public boolean canInteractWith(EntityPlayer playerIn)
|
|
{
|
|
+ if (!this.checkReachable) return true; // CraftBukkit
|
|
return this.tileBrewingStand.isUseableByPlayer(playerIn);
|
|
}
|
|
|