whoops
This commit is contained in:
		
					parent
					
						
							
								75768ea587
							
						
					
				
			
			
				commit
				
					
						f09c9772b2
					
				
			
		
					 1 changed files with 32 additions and 0 deletions
				
			
		
							
								
								
									
										32
									
								
								src/main/java/de/lunarakai/minecleaner/utils/ItemUtil.java
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/main/java/de/lunarakai/minecleaner/utils/ItemUtil.java
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | |||
| package de.lunarakai.minecleaner.utils; | ||||
| 
 | ||||
| import de.iani.cubesideutils.bukkit.items.ItemBuilder; | ||||
| import org.bukkit.Material; | ||||
| import org.bukkit.enchantments.Enchantment; | ||||
| import org.bukkit.inventory.ItemFlag; | ||||
| import org.bukkit.inventory.ItemStack; | ||||
| 
 | ||||
| public class ItemUtil { | ||||
| 
 | ||||
|     public static final ItemStack EMPTY_ICON = createGuiItem(Material.GRAY_STAINED_GLASS_PANE, " ", true, true); | ||||
| 
 | ||||
|     public static ItemStack createGuiItem(Material material, String name, String... lore) { | ||||
|         return createGuiItem(material, name, false, lore); | ||||
|     } | ||||
| 
 | ||||
|     public static ItemStack createGuiItem(Material material, String name, boolean glowing, boolean showTooltip, String... lore) { | ||||
|         ItemBuilder builder = ItemBuilder.fromMaterial(material).displayName(name).lore(lore); | ||||
|         if (glowing) { | ||||
|             builder.enchantment(Enchantment.UNBREAKING, 1, true).flag(ItemFlag.HIDE_ENCHANTS); | ||||
|         } | ||||
|         if (!showTooltip) { | ||||
|             builder.flag(ItemFlag.HIDE_ADDITIONAL_TOOLTIP); | ||||
|         } | ||||
|         return builder.build(); | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     public static ItemStack createGuiItem(Material material, String name, boolean glowing, String... lore) { | ||||
|         return createGuiItem(material, name, glowing, true, lore); | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue