blob: 243049e0a664d96c0a97fd14ab6a5c22cdda6260 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package com.earth2me.essentials.craftbukkit;
import net.minecraft.server.EntityPlayer;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerTeleportEvent;
public class ItemDupeFix extends PlayerListener
{
@Override
public void onPlayerTeleport(final PlayerTeleportEvent event)
{
if (event.isCancelled())
{
return;
}
final CraftPlayer player = (CraftPlayer)event.getPlayer();
final EntityPlayer entity = player.getHandle();
if (entity.activeContainer != entity.defaultContainer)
{
entity.closeInventory();
}
}
}
|