mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-24 10:09:50 +01:00
Fix ItemDupe bug in bukkit
This commit is contained in:
parent
fa73394113
commit
d4685d1d10
@ -23,6 +23,7 @@ import com.earth2me.essentials.commands.EssentialsCommand;
|
||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||
import com.earth2me.essentials.commands.NoChargeException;
|
||||
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
|
||||
import com.earth2me.essentials.craftbukkit.ItemDupeFix;
|
||||
import com.earth2me.essentials.perm.PermissionsHandler;
|
||||
import com.earth2me.essentials.register.payment.Methods;
|
||||
import com.earth2me.essentials.signs.SignBlockListener;
|
||||
@ -182,6 +183,7 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_CHANGED_WORLD, playerListener, Priority.Normal, this);
|
||||
pm.registerEvent(Type.PLAYER_TELEPORT, new ItemDupeFix(), Priority.Monitor, this);
|
||||
|
||||
final EssentialsBlockListener blockListener = new EssentialsBlockListener(this);
|
||||
pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
|
||||
|
@ -0,0 +1,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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user