Utils.java 文件源码

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

项目:TradeShop 作者:
/**
 * Reads the name of the inventory
 *
 * @param state blockState to change the name of
 * @return Name of inventory
 */
public String readInvName(BlockState state) {
    if (!plugin.getAllowedInventories().contains(state.getType())) {
        return null;
    }

    Inventory inv = ((InventoryHolder) state).getInventory();

    if (((Nameable) state).getCustomName() == null) {
        return "";
    }

    String[] names = inv.getName().split(" <");

    if (names[0] == null || names[0].equalsIgnoreCase("")) {
        return "";
    } else {
        return names[0];
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号