ModuleDisableElytra.java 文件源码

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

项目:BukkitOldCombatMechanics 作者:
@EventHandler (priority = EventPriority.HIGHEST)
public void onWorldChange(PlayerChangedWorldEvent e){
    Player p = e.getPlayer();
    World w = p.getWorld();
    if(!isEnabled(w)) return;

    PlayerInventory inv = p.getInventory();

    ItemStack chestplate = inv.getChestplate();

    if(chestplate == null || chestplate.getType() != Material.ELYTRA) return;

    inv.setChestplate(new ItemStack(Material.AIR));

    if(inv.firstEmpty() != -1)
        inv.addItem(chestplate);
    else
        w.dropItem(p.getLocation(), chestplate);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号