chore: rebase on adventure-nbt

This commit is contained in:
mworzala 2024-04-10 09:00:31 -04:00
parent e24109d0eb
commit 641c4975ac
No known key found for this signature in database
GPG Key ID: B148F922E64797C7
4 changed files with 5 additions and 8 deletions

View File

@ -1,11 +1,11 @@
package net.minestom.server.item.component;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import net.minestom.server.network.NetworkBuffer;
import net.minestom.server.tag.Tag;
import org.jetbrains.annotations.NotNull;
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
public record CustomData(@NotNull NBTCompound nbt) implements ItemComponent {
public record CustomData(@NotNull CompoundBinaryTag nbt) implements ItemComponent {
static final Tag<CustomData> TAG = Tag.Structure("ab", CustomData.class);
static final NetworkBuffer.Type<CustomData> NETWORK_TYPE = new NetworkBuffer.Type<>() {
@ -16,7 +16,7 @@ public record CustomData(@NotNull NBTCompound nbt) implements ItemComponent {
@Override
public CustomData read(@NotNull NetworkBuffer buffer) {
return new CustomData((NBTCompound) buffer.read(NetworkBuffer.NBT));
return new CustomData((CompoundBinaryTag) buffer.read(NetworkBuffer.NBT));
}
};

View File

@ -2,7 +2,6 @@ package net.minestom.server.network;
import net.kyori.adventure.nbt.BinaryTag;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import net.kyori.adventure.nbt.EndBinaryTag;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.minestom.server.adventure.serializer.nbt.NbtComponentSerializer;
@ -420,7 +419,7 @@ interface NetworkBufferTypeImpl<T> extends NetworkBuffer.Type<T> {
buffer.read(VAR_INT); // Added components
buffer.read(VAR_INT); // Removed components
return ItemStack.fromNBT(material, new NBTCompound(), count);
return ItemStack.fromNBT(material, CompoundBinaryTag.empty(), count);
}
}

View File

@ -6,7 +6,6 @@ import net.minestom.server.network.packet.server.ServerPacket;
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
import java.util.List;

View File

@ -14,11 +14,10 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Allows servers to register custom dimensions. Also used during player joining to send the list of all existing dimensions.
* <p>
*/
public final class BiomeManager {
private final CachedPacket registryDataPacket = new CachedPacket(this::createRegistryDataPacket);