mirror of https://github.com/Minestom/Minestom.git
Enchanted book and Colored StringBuilder
This commit is contained in:
parent
fec05d6838
commit
5419530125
|
@ -19,7 +19,10 @@ import java.util.regex.Pattern;
|
|||
*/
|
||||
public class ColoredText extends JsonMessage {
|
||||
|
||||
// the raw text
|
||||
/**
|
||||
* The raw text StringBuilder
|
||||
* Its a single StringBuilder instance for easier and faster concenation
|
||||
*/
|
||||
private final StringBuilder message = new StringBuilder();
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.minestom.server.item;
|
||||
|
||||
import net.minestom.server.chat.ColoredText;
|
||||
import net.minestom.server.chat.JsonMessage;
|
||||
|
||||
public class ItemDisplay {
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
package net.minestom.server.item.metadata;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.Object2ShortMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ShortOpenHashMap;
|
||||
import net.minestom.server.item.Enchantment;
|
||||
import net.minestom.server.utils.NBTUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class EnchantedBookMeta extends ItemMeta {
|
||||
|
||||
private final Map<Enchantment, Short> storedEnchantmentMap = new HashMap<>();
|
||||
private final Object2ShortMap<Enchantment> storedEnchantmentMap = new Object2ShortOpenHashMap<>();
|
||||
|
||||
/**
|
||||
* Gets the stored enchantment map.
|
||||
|
@ -45,7 +46,7 @@ public class EnchantedBookMeta extends ItemMeta {
|
|||
* @param enchantment the enchantment type
|
||||
*/
|
||||
public void removeStoredEnchantment(@NotNull Enchantment enchantment) {
|
||||
this.storedEnchantmentMap.remove(enchantment);
|
||||
this.storedEnchantmentMap.removeShort(enchantment);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue