PaperMC/nms-patches/ContainerHorse.patch

38 lines
1.3 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/ContainerHorse.java
+++ b/net/minecraft/server/ContainerHorse.java
2016-05-10 13:47:39 +02:00
@@ -1,13 +1,34 @@
package net.minecraft.server;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+import org.bukkit.inventory.InventoryView;
+// CraftBukkit end
2016-05-10 13:47:39 +02:00
public class ContainerHorse extends Container {
2016-06-09 03:43:49 +02:00
private final IInventory a;
private final EntityHorse f;
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
+ org.bukkit.craftbukkit.inventory.CraftInventoryView bukkitEntity;
+ PlayerInventory player;
+
+ @Override
+ public InventoryView getBukkitView() {
+ if (bukkitEntity != null) {
+ return bukkitEntity;
+ }
+
+ CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryHorse(this.a);
+ return bukkitEntity = new CraftInventoryView(player.player.getBukkitEntity(), inventory, this);
+ }
2015-02-26 23:41:06 +01:00
+
public ContainerHorse(IInventory iinventory, final IInventory iinventory1, final EntityHorse entityhorse, EntityHuman entityhuman) {
+ player = (PlayerInventory) iinventory;
+ // CraftBukkit end
this.a = iinventory1;
this.f = entityhorse;
2016-06-09 03:43:49 +02:00
boolean flag = true;