mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-06 07:21:32 +01:00
Use map
This commit is contained in:
parent
6e2cfa8b2e
commit
2e07af2b80
@ -25,7 +25,6 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
// for lack of a better name
|
// for lack of a better name
|
||||||
public final class NBTUtils {
|
public final class NBTUtils {
|
||||||
@ -102,12 +101,9 @@ public final class NBTUtils {
|
|||||||
nbt.set(listName, NBT.List(
|
nbt.set(listName, NBT.List(
|
||||||
NBTType.TAG_Compound,
|
NBTType.TAG_Compound,
|
||||||
enchantmentMap.entrySet().stream()
|
enchantmentMap.entrySet().stream()
|
||||||
.map(entry ->
|
.map(entry -> NBT.Compound(Map.of(
|
||||||
NBT.Compound(n -> {
|
"lvl", NBT.Short(entry.getValue()),
|
||||||
n.setShort("lvl", entry.getValue());
|
"id", NBT.String(entry.getKey().name()))))
|
||||||
n.setString("id", entry.getKey().name());
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.toList()
|
.toList()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user