PaperMC/nms-patches/ContainerBrewingStand.patch

54 lines
1.7 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/ContainerBrewingStand.java
+++ b/net/minecraft/server/ContainerBrewingStand.java
2016-05-10 13:47:39 +02:00
@@ -1,6 +1,10 @@
package net.minecraft.server;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
2016-05-10 13:47:39 +02:00
public class ContainerBrewingStand extends Container {
2016-05-10 13:47:39 +02:00
@@ -9,7 +13,13 @@
private int g;
2016-02-29 22:32:46 +01:00
private int h;
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null;
+ private PlayerInventory player;
+ // CraftBukkit end
2015-02-26 23:41:06 +01:00
+
public ContainerBrewingStand(PlayerInventory playerinventory, IInventory iinventory) {
+ player = playerinventory; // CraftBukkit
this.brewingStand = iinventory;
2016-02-29 22:32:46 +01:00
this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(playerinventory.player, iinventory, 0, 56, 51)));
this.a((Slot) (new ContainerBrewingStand.SlotPotionBottle(playerinventory.player, iinventory, 1, 79, 58)));
2016-05-10 13:47:39 +02:00
@@ -56,6 +66,7 @@
}
public boolean a(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit
return this.brewingStand.a(entityhuman);
}
2016-05-10 13:47:39 +02:00
@@ -185,4 +196,17 @@
2016-02-29 22:32:46 +01:00
}
2015-02-26 23:41:06 +01:00
}
}
2015-02-26 23:41:06 +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
}