Voodoo.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:DDCustomPlugin 作者:
@SuppressWarnings("deprecation")
public void onPlayerInteract(final PlayerInteractEvent event) { 
    final Player player = event.getPlayer();
    if (player.hasPermission("customplugin.voodoo")) {
        ItemStack i = player.getItemInHand();
        if (i.getTypeId() == 397 && i.getDurability() == (byte) 3) {
            SkullMeta skull = (SkullMeta)i.getItemMeta();
            Player p = Bukkit.getPlayer(skull.getOwner());
            if (p != null) {
                if (event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
                    p.setVelocity(player.getLocation().getDirection().multiply(-1));
                } else {
                    p.setVelocity(player.getLocation().getDirection());
                }
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号