Paper/CraftBukkit-Patches/0044-Close-Minecart-Containers.patch

30 lines
1.1 KiB
Diff

From 58995adb5304f5f8cc8e87c11204ad12e209157c Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 24 Mar 2013 18:52:26 +1100
Subject: [PATCH] Close Minecart Containers
Close Minecart containers when they change worlds via entity portal.
---
src/main/java/net/minecraft/server/EntityMinecartContainer.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java
index c207076..74f579d 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java
@@ -149,6 +149,11 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
}
public void c(int i) {
+ // Spigot start
+ for (HumanEntity h : transaction) {
+ ((org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeInventory();
+ }
+ // Spigot end
this.b = false;
super.c(i);
}
--
1.8.1-rc2