1818import java .util .Collections ;
1919
2020public class TrashProtectScreen implements InventoryHolder {
21- private final Inventory inventory = Bukkit .createInventory (this , 18 , "TrashProtect" );
21+ private final Inventory inventory = Bukkit .createInventory (this , 27 , "TrashProtect" );
2222 private final LifeCore plugin ;
2323 private final Player player ;
2424
@@ -45,10 +45,11 @@ public void reset() {
4545 String specialName = RarityAPIProvider .get ().getRarityById ("special" ).getDisplayName (player );
4646 String specialLore = plugin .getTrashProtectConfig ().contains (player .getUniqueId (), "special" ) ? ChatColor .GREEN + "有効" : ChatColor .RED + "無効" ;
4747 String hasPvELevelLore = plugin .getTrashProtectConfig ().contains (player .getUniqueId (), "has_pve_level" ) ? ChatColor .GREEN + "有効" : ChatColor .RED + "無効" ;
48- setItems (noRarityLore , commonName , commonLore , uncommonName , uncommonLore , rareName , rareLore , epicName , epicLore , legendaryName , legendaryLore , mythicName , mythicLore , specialName , specialLore , hasPvELevelLore , inventory );
48+ String hasNoPvELevelLore = plugin .getTrashProtectConfig ().contains (player .getUniqueId (), "has_no_pve_level" ) ? ChatColor .GREEN + "有効" : ChatColor .RED + "無効" ;
49+ setItems (noRarityLore , commonName , commonLore , uncommonName , uncommonLore , rareName , rareLore , epicName , epicLore , legendaryName , legendaryLore , mythicName , mythicLore , specialName , specialLore , hasPvELevelLore , hasNoPvELevelLore , inventory );
4950 }
5051
51- static void setItems (String noRarityLore , String commonName , String commonLore , String uncommonName , String uncommonLore , String rareName , String rareLore , String epicName , String epicLore , String legendaryName , String legendaryLore , String mythicName , String mythicLore , String specialName , String specialLore , String hasPvELevelLore , Inventory inventory ) {
52+ static void setItems (String noRarityLore , String commonName , String commonLore , String uncommonName , String uncommonLore , String rareName , String rareLore , String epicName , String epicLore , String legendaryName , String legendaryLore , String mythicName , String mythicLore , String specialName , String specialLore , String hasPvELevelLore , String hasNoPvELevelLore , Inventory inventory ) {
5253 inventory .setItem (0 , ItemUtil .createItemStack (Material .PAPER , 1 , item -> {
5354 ItemMeta meta = item .getItemMeta ();
5455 if (meta != null ) {
@@ -121,7 +122,15 @@ static void setItems(String noRarityLore, String commonName, String commonLore,
121122 item .setItemMeta (meta );
122123 }
123124 }));
124- inventory .setItem (17 , ItemUtil .createItemStack (Material .BARRIER , 1 , item -> {
125+ inventory .setItem (9 , ItemUtil .createItemStack (Material .FILLED_MAP , 1 , item -> {
126+ ItemMeta meta = item .getItemMeta ();
127+ if (meta != null ) {
128+ meta .setDisplayName (ChatColor .GRAY + "PvEレベルが付与されていないアイテム" );
129+ meta .setLore (Collections .singletonList (hasNoPvELevelLore ));
130+ item .setItemMeta (meta );
131+ }
132+ }));
133+ inventory .setItem (26 , ItemUtil .createItemStack (Material .BARRIER , 1 , item -> {
125134 ItemMeta meta = item .getItemMeta ();
126135 if (meta != null ) {
127136 meta .setDisplayName (ChatColor .RED + "閉じる" );
@@ -190,7 +199,11 @@ public void onClick(InventoryClickEvent e) {
190199 plugin .getTrashProtectConfig ().toggle (screen .player .getUniqueId (), "has_pve_level" );
191200 break ;
192201 }
193- case 17 : {
202+ case 9 : {
203+ plugin .getTrashProtectConfig ().toggle (screen .player .getUniqueId (), "has_no_pve_level" );
204+ break ;
205+ }
206+ case 26 : {
194207 screen .player .closeInventory ();
195208 return ;
196209 }
0 commit comments