Use the correct event

This commit is contained in:
LCastr0 2017-01-14 21:01:18 -02:00
parent d667524ed9
commit fa9f895891

View File

@ -7,8 +7,7 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
@ -58,14 +57,11 @@ public class MorphLoveDoctor extends MorphGadget
} }
@EventHandler @EventHandler
public void onRightClick(PlayerInteractEvent event) public void onSneak(PlayerToggleSneakEvent event)
{ {
if (!isActive(event.getPlayer())) if (!isActive(event.getPlayer()))
return; return;
if (event.getAction() != Action.RIGHT_CLICK_AIR)
return;
Player player = event.getPlayer(); Player player = event.getPlayer();
if (!Recharge.Instance.use(player, "Love Doctor Laser", 5000, true, false, "Cosmetics")) if (!Recharge.Instance.use(player, "Love Doctor Laser", 5000, true, false, "Cosmetics"))