3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 23:00:08 +01:00
Paper/nms-patches/ContainerHorse.patch

36 Zeilen
1.1 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/ContainerHorse.java
+++ b/net/minecraft/server/ContainerHorse.java
2019-04-23 04:00:00 +02:00
@@ -1,12 +1,32 @@
package net.minecraft.server;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+import org.bukkit.inventory.InventoryView;
+// CraftBukkit end
2016-11-17 02:41:03 +01:00
+
public class ContainerHorse extends Container {
2019-04-23 04:00:00 +02:00
private final IInventory c;
private final EntityHorseAbstract d;
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;
+ }
+
2019-04-23 04:00:00 +02:00
+ return bukkitEntity = new CraftInventoryView(player.player.getBukkitEntity(), c.getOwner().getInventory(), this);
+ }
2015-02-26 23:41:06 +01:00
+
2019-04-23 04:00:00 +02:00
public ContainerHorse(int i, PlayerInventory playerinventory, IInventory iinventory, final EntityHorseAbstract entityhorseabstract) {
super((Containers) null, i);
+ player = playerinventory;
+ // CraftBukkit end
2019-04-23 04:00:00 +02:00
this.c = iinventory;
this.d = entityhorseabstract;
2016-06-09 03:43:49 +02:00
boolean flag = true;