mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Added a new lore to Hazmat Suit for 1.15+
This commit is contained in:
parent
cd4a36c519
commit
29fe881768
@ -296,6 +296,13 @@ public final class SlimefunItems {
|
||||
REINFORCED_ALLOY_LEGGINGS.addUnsafeEnchantments(reinforced);
|
||||
REINFORCED_ALLOY_BOOTS.addUnsafeEnchantments(reinforced);
|
||||
|
||||
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
|
||||
SCUBA_HELMET.addLore("", "&7Equip the full set for:", "&7+Bee Protection");
|
||||
HAZMAT_CHESTPLATE.addLore("", "&7Equip the full set for:", "&7+Bee Protection");
|
||||
HAZMAT_LEGGINGS.addLore("", "&7Equip the full set for:", "&7+Bee Protection");
|
||||
RUBBER_BOOTS.addLore("", "&7Equip the full set for:", "&7+Bee Protection");
|
||||
}
|
||||
|
||||
Map<Enchantment, Integer> gilded = new HashMap<>();
|
||||
gilded.put(Enchantment.DURABILITY, 6);
|
||||
gilded.put(Enchantment.PROTECTION_ENVIRONMENTAL, 8);
|
||||
|
@ -2,6 +2,7 @@ package me.mrCookieSlime.Slimefun.api;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -245,4 +246,20 @@ public class SlimefunItemStack extends CustomItem {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds additional lores for the {@link ItemStack}.
|
||||
*
|
||||
* @param newLore
|
||||
* New lores to be added to the {@link ItemStack}
|
||||
*/
|
||||
public void addLore(String... newLore) {
|
||||
ItemMeta meta = getItemMeta();
|
||||
if (meta == null) return;
|
||||
List<String> oldLore = meta.getLore();
|
||||
if (oldLore == null) return;
|
||||
|
||||
oldLore.addAll(Arrays.asList(newLore));
|
||||
meta.setLore(oldLore);
|
||||
setItemMeta(meta);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user