3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/nms-patches/ContainerBrewingStand.patch
2014-11-28 11:23:19 +00:00

53 Zeilen
1.7 KiB
Diff

--- ../work/decompile-8eb82bde//net/minecraft/server/ContainerBrewingStand.java 2014-11-28 11:22:55.814823166 +0000
+++ src/main/java/net/minecraft/server/ContainerBrewingStand.java 2014-11-28 11:01:54.000000000 +0000
@@ -1,12 +1,23 @@
package net.minecraft.server;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
+
public class ContainerBrewingStand extends Container {
private IInventory brewingStand;
private final Slot f;
private int g;
+
+ // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null;
+ private PlayerInventory player;
+ // CraftBukkit end
public ContainerBrewingStand(PlayerInventory playerinventory, IInventory iinventory) {
+ player = playerinventory; // CraftBukkit
this.brewingStand = iinventory;
this.a((Slot) (new SlotPotionBottle(playerinventory.player, iinventory, 0, 56, 46)));
this.a((Slot) (new SlotPotionBottle(playerinventory.player, iinventory, 1, 79, 53)));
@@ -47,6 +58,7 @@
}
public boolean a(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit
return this.brewingStand.a(entityhuman);
}
@@ -101,4 +113,17 @@
return itemstack;
}
+
+ // 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
}