2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/inventory/ContainerBrewingStand.java
|
|
|
|
+++ b/net/minecraft/world/inventory/ContainerBrewingStand.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -15,6 +15,11 @@
|
|
|
|
import net.minecraft.world.item.alchemy.PotionContents;
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.item.alchemy.PotionRegistry;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer;
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
|
|
|
+// CraftBukkit end
|
2016-11-17 02:41:03 +01:00
|
|
|
+
|
2014-11-25 22:32:16 +01:00
|
|
|
public class ContainerBrewingStand extends Container {
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
private static final int BOTTLE_SLOT_START = 0;
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -31,12 +36,18 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
private final IContainerProperties brewingStandData;
|
|
|
|
private final Slot ingredientSlot;
|
2015-02-26 23:41:06 +01:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ private CraftInventoryView bukkitEntity = null;
|
|
|
|
+ private PlayerInventory player;
|
|
|
|
+ // CraftBukkit end
|
2015-02-26 23:41:06 +01:00
|
|
|
+
|
2019-04-23 04:00:00 +02:00
|
|
|
public ContainerBrewingStand(int i, PlayerInventory playerinventory) {
|
|
|
|
this(i, playerinventory, new InventorySubcontainer(5), new ContainerProperties(2));
|
|
|
|
}
|
|
|
|
|
|
|
|
public ContainerBrewingStand(int i, PlayerInventory playerinventory, IInventory iinventory, IContainerProperties icontainerproperties) {
|
|
|
|
super(Containers.BREWING_STAND, i);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ player = playerinventory; // CraftBukkit
|
2021-11-21 23:00:00 +01:00
|
|
|
checkContainerSize(iinventory, 5);
|
|
|
|
checkContainerDataCount(icontainerproperties, 2);
|
2014-11-25 22:32:16 +01:00
|
|
|
this.brewingStand = iinventory;
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -66,6 +77,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
public boolean stillValid(EntityHuman entityhuman) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ if (!this.checkReachable) return true; // CraftBukkit
|
2021-11-21 23:00:00 +01:00
|
|
|
return this.brewingStand.stillValid(entityhuman);
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -196,4 +208,17 @@
|
|
|
|
return itemstack.is(Items.BLAZE_POWDER);
|
2015-02-26 23:41:06 +01:00
|
|
|
}
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
2015-02-26 23:41:06 +01:00
|
|
|
+
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ @Override
|
|
|
|
+ public CraftInventoryView getBukkitView() {
|
|
|
|
+ if (bukkitEntity != null) {
|
|
|
|
+ return bukkitEntity;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ CraftInventoryBrewer inventory = new CraftInventoryBrewer(this.brewingStand);
|
|
|
|
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
|
|
|
+ return bukkitEntity;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|