1
1
mirror of https://github.com/geekfrog/PermissionsTime.git synced 2024-11-25 01:48:54 +00:00

修复 显示到期时间

This commit is contained in:
GeekFrog 2017-07-16 06:36:49 +08:00
parent 3ed78d7db0
commit b92bf7893c

View File

@ -5,7 +5,9 @@ import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import gg.frog.mc.permissionstime.config.PackagesCfg;
import gg.frog.mc.permissionstime.model.db.PlayerDataBean;
@ -18,12 +20,15 @@ public class PlayerPermissionShow {
for (PlayerDataBean pdb : pdbList) {
ItemStack item = PackagesCfg.PACKAGE_ITEMS.get(pdb.getPackageName());
if (item != null) {
inventory.addItem(item);
List<String> lores = item.getItemMeta().getLore();
ItemMeta meta = item.getItemMeta();
List<String> lores = meta.getLore();
lores.add("");
lores.add(StrUtil.messageFormat("&4到期时间: {0}", StrUtil.timestampToString(pdb.getExpire())));
meta.setLore(lores);
item.setItemMeta(meta);
inventory.addItem(item);
}
}
p.openInventory(inventory);
InventoryView view = p.openInventory(inventory);
}
}