mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-28 20:18:10 +01:00
Use map for compass meta
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
8dcc3000cf
commit
34785e96f3
@ -9,6 +9,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jglrxavpok.hephaistos.nbt.NBT;
|
import org.jglrxavpok.hephaistos.nbt.NBT;
|
||||||
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
|
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class CompassMeta extends ItemMeta implements ItemMetaBuilder.Provider<CompassMeta.Builder> {
|
public class CompassMeta extends ItemMeta implements ItemMetaBuilder.Provider<CompassMeta.Builder> {
|
||||||
@ -70,11 +71,10 @@ public class CompassMeta extends ItemMeta implements ItemMetaBuilder.Provider<Co
|
|||||||
|
|
||||||
mutateNbt(compound -> {
|
mutateNbt(compound -> {
|
||||||
if (lodestonePosition != null) {
|
if (lodestonePosition != null) {
|
||||||
compound.set("LodestonePos", NBT.Compound(posCompound -> {
|
compound.set("LodestonePos", NBT.Compound(Map.of(
|
||||||
posCompound.setInt("X", lodestonePosition.blockX());
|
"X", NBT.Int(lodestonePosition.blockX()),
|
||||||
posCompound.setInt("Y", lodestonePosition.blockY());
|
"Y", NBT.Int(lodestonePosition.blockY()),
|
||||||
posCompound.setInt("Z", lodestonePosition.blockZ());
|
"Z", NBT.Int(lodestonePosition.blockZ()))));
|
||||||
}));
|
|
||||||
} else {
|
} else {
|
||||||
compound.remove("LodestonePos");
|
compound.remove("LodestonePos");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user