Close Minecart containers on Entity portal.

This commit is contained in:
md_5 2013-03-24 18:53:01 +11:00
parent 2314af8cb0
commit 284847cd81

View File

@ -0,0 +1,29 @@
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