public class MinecraftCodecHelper extends BasePacketCodecHelper
| Constructor and Description |
|---|
MinecraftCodecHelper() |
| Modifier and Type | Method and Description |
|---|---|
@Nullable BuiltinSound |
getBuiltinSound(String name) |
@Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag |
getRegistry()
The game registry sent to clients from the
ClientboundLoginPacket. |
BlockBreakStage |
readBlockBreakStage(io.netty.buffer.ByteBuf buf) |
BlockEntityType |
readBlockEntityType(io.netty.buffer.ByteBuf buf) |
<T> T |
readById(io.netty.buffer.ByteBuf buf,
IntFunction<T> registry,
Function<io.netty.buffer.ByteBuf,T> custom) |
byte[] |
readByteArray(io.netty.buffer.ByteBuf buf) |
byte[] |
readByteArray(io.netty.buffer.ByteBuf buf,
ToIntFunction<io.netty.buffer.ByteBuf> reader) |
ChunkSection |
readChunkSection(io.netty.buffer.ByteBuf buf,
int globalBiomePaletteBits) |
net.kyori.adventure.text.Component |
readComponent(io.netty.buffer.ByteBuf buf) |
DataPalette |
readDataPalette(io.netty.buffer.ByteBuf buf,
PaletteType paletteType,
int globalPaletteBits) |
Direction |
readDirection(io.netty.buffer.ByteBuf buf) |
Effect |
readEffect(io.netty.buffer.ByteBuf buf) |
EntityEvent |
readEntityEvent(io.netty.buffer.ByteBuf buf) |
EntityMetadata<?,?>[] |
readEntityMetadata(io.netty.buffer.ByteBuf buf) |
<E extends Enum<E>> |
readEnumSet(io.netty.buffer.ByteBuf buf,
E[] values) |
BitSet |
readFixedBitSet(io.netty.buffer.ByteBuf buf,
int length) |
GlobalPos |
readGlobalPos(io.netty.buffer.ByteBuf buf) |
ItemStack |
readItemStack(io.netty.buffer.ByteBuf buf) |
LevelEvent |
readLevelEvent(io.netty.buffer.ByteBuf buf) |
LightUpdateData |
readLightUpdateData(io.netty.buffer.ByteBuf buf) |
long[] |
readLongArray(io.netty.buffer.ByteBuf buf) |
long[] |
readLongArray(io.netty.buffer.ByteBuf buf,
ToIntFunction<io.netty.buffer.ByteBuf> reader) |
EntityMetadata<?,?> |
readMetadata(io.netty.buffer.ByteBuf buf,
int id) |
MetadataType<?> |
readMetadataType(io.netty.buffer.ByteBuf buf) |
ModifierOperation |
readModifierOperation(io.netty.buffer.ByteBuf buf) |
NibbleArray3d |
readNibbleArray(io.netty.buffer.ByteBuf buf,
int size) |
<T> T |
readNullable(io.netty.buffer.ByteBuf buf,
Function<io.netty.buffer.ByteBuf,T> ifPresent) |
PaintingType |
readPaintingType(io.netty.buffer.ByteBuf buf) |
Particle |
readParticle(io.netty.buffer.ByteBuf buf) |
ParticleData |
readParticleData(io.netty.buffer.ByteBuf buf,
ParticleType type) |
ParticleType |
readParticleType(io.netty.buffer.ByteBuf buf) |
Pose |
readPose(io.netty.buffer.ByteBuf buf) |
com.nukkitx.math.vector.Vector3i |
readPosition(io.netty.buffer.ByteBuf buf) |
PositionSource |
readPositionSource(io.netty.buffer.ByteBuf buf) |
com.github.steveice10.mc.auth.data.GameProfile.Property |
readProperty(io.netty.buffer.ByteBuf buf) |
com.nukkitx.math.vector.Vector4f |
readQuaternion(io.netty.buffer.ByteBuf buf) |
Ingredient |
readRecipeIngredient(io.netty.buffer.ByteBuf buf) |
String |
readResourceLocation(io.netty.buffer.ByteBuf buf) |
com.nukkitx.math.vector.Vector3f |
readRotation(io.netty.buffer.ByteBuf buf) |
SnifferState |
readSnifferState(io.netty.buffer.ByteBuf buf) |
SoundCategory |
readSoundCategory(io.netty.buffer.ByteBuf buf) |
CustomSound |
readSoundEvent(io.netty.buffer.ByteBuf buf) |
StatisticCategory |
readStatisticCategory(io.netty.buffer.ByteBuf buf) |
com.github.steveice10.opennbt.tag.builtin.CompoundTag |
readTag(io.netty.buffer.ByteBuf buf) |
<T extends com.github.steveice10.opennbt.tag.builtin.Tag> |
readTag(io.netty.buffer.ByteBuf buf,
Class<T> expected) |
com.github.steveice10.opennbt.tag.builtin.CompoundTag |
readTagLE(io.netty.buffer.ByteBuf buf) |
<T extends com.github.steveice10.opennbt.tag.builtin.Tag> |
readTagLE(io.netty.buffer.ByteBuf buf,
Class<T> expected) |
UUID |
readUUID(io.netty.buffer.ByteBuf buf) |
VillagerData |
readVillagerData(io.netty.buffer.ByteBuf buf) |
void |
setRegistry(com.github.steveice10.opennbt.tag.builtin.CompoundTag registry) |
void |
writeBlockBreakStage(io.netty.buffer.ByteBuf buf,
BlockBreakStage stage) |
void |
writeBlockEntityType(io.netty.buffer.ByteBuf buf,
BlockEntityType type) |
void |
writeByteArray(io.netty.buffer.ByteBuf buf,
byte[] bytes) |
void |
writeByteArray(io.netty.buffer.ByteBuf buf,
byte[] bytes,
ObjIntConsumer<io.netty.buffer.ByteBuf> writer) |
void |
writeChunkSection(io.netty.buffer.ByteBuf buf,
ChunkSection section) |
void |
writeComponent(io.netty.buffer.ByteBuf buf,
net.kyori.adventure.text.Component component) |
void |
writeDataPalette(io.netty.buffer.ByteBuf buf,
DataPalette palette) |
void |
writeDirection(io.netty.buffer.ByteBuf buf,
Direction dir) |
void |
writeEffect(io.netty.buffer.ByteBuf buf,
Effect effect) |
void |
writeEntityEvent(io.netty.buffer.ByteBuf buf,
EntityEvent event) |
void |
writeEntityMetadata(io.netty.buffer.ByteBuf buf,
EntityMetadata<?,?>[] metadata) |
<E extends Enum<E>> |
writeEnumSet(io.netty.buffer.ByteBuf buf,
EnumSet<E> enumSet,
E[] values) |
void |
writeFixedBitSet(io.netty.buffer.ByteBuf buf,
BitSet bitSet,
int length) |
void |
writeGlobalPos(io.netty.buffer.ByteBuf buf,
GlobalPos pos) |
void |
writeItemStack(io.netty.buffer.ByteBuf buf,
ItemStack item) |
void |
writeLevelEvent(io.netty.buffer.ByteBuf buf,
LevelEvent event) |
void |
writeLightUpdateData(io.netty.buffer.ByteBuf buf,
LightUpdateData data) |
void |
writeLongArray(io.netty.buffer.ByteBuf buf,
long[] l) |
void |
writeLongArray(io.netty.buffer.ByteBuf buf,
long[] l,
ObjIntConsumer<io.netty.buffer.ByteBuf> writer) |
void |
writeMetadata(io.netty.buffer.ByteBuf buf,
EntityMetadata<?,?> metadata) |
void |
writeMetadataType(io.netty.buffer.ByteBuf buf,
MetadataType<?> type) |
void |
writeModifierOperation(io.netty.buffer.ByteBuf buf,
ModifierOperation operation) |
void |
writeNibbleArray(io.netty.buffer.ByteBuf buf,
NibbleArray3d nibbleArray) |
<T> void |
writeNullable(io.netty.buffer.ByteBuf buf,
T value,
BiConsumer<io.netty.buffer.ByteBuf,T> ifPresent) |
void |
writePaintingType(io.netty.buffer.ByteBuf buf,
PaintingType type) |
void |
writeParticle(io.netty.buffer.ByteBuf buf,
Particle particle) |
void |
writeParticleData(io.netty.buffer.ByteBuf buf,
ParticleType type,
ParticleData data) |
void |
writeParticleType(io.netty.buffer.ByteBuf buf,
ParticleType type) |
void |
writePose(io.netty.buffer.ByteBuf buf,
Pose pose) |
void |
writePosition(io.netty.buffer.ByteBuf buf,
com.nukkitx.math.vector.Vector3i pos) |
void |
writePositionSource(io.netty.buffer.ByteBuf buf,
PositionSource positionSource) |
void |
writeProperty(io.netty.buffer.ByteBuf buf,
com.github.steveice10.mc.auth.data.GameProfile.Property property) |
void |
writeQuaternion(io.netty.buffer.ByteBuf buf,
com.nukkitx.math.vector.Vector4f vec4) |
void |
writeRecipeIngredient(io.netty.buffer.ByteBuf buf,
Ingredient ingredient) |
void |
writeResourceLocation(io.netty.buffer.ByteBuf buf,
String location) |
void |
writeRotation(io.netty.buffer.ByteBuf buf,
com.nukkitx.math.vector.Vector3f rot) |
void |
writeSnifferState(io.netty.buffer.ByteBuf buf,
SnifferState state) |
void |
writeSoundCategory(io.netty.buffer.ByteBuf buf,
SoundCategory category) |
void |
writeSoundEvent(io.netty.buffer.ByteBuf buf,
Sound soundEvent) |
void |
writeStatisticCategory(io.netty.buffer.ByteBuf buf,
StatisticCategory category) |
<T extends com.github.steveice10.opennbt.tag.builtin.Tag> |
writeTag(io.netty.buffer.ByteBuf buf,
T tag) |
<T extends com.github.steveice10.opennbt.tag.builtin.Tag> |
writeTagLE(io.netty.buffer.ByteBuf buf,
T tag) |
void |
writeUUID(io.netty.buffer.ByteBuf buf,
UUID uuid) |
void |
writeVillagerData(io.netty.buffer.ByteBuf buf,
VillagerData villagerData) |
readString, readString, readVarInt, readVarLong, writeString, writeVarInt, writeVarLong@Nullable
public <T> T readNullable(io.netty.buffer.ByteBuf buf,
Function<io.netty.buffer.ByteBuf,T> ifPresent)
public <T> void writeNullable(io.netty.buffer.ByteBuf buf,
@Nullable
T value,
BiConsumer<io.netty.buffer.ByteBuf,T> ifPresent)
public String readResourceLocation(io.netty.buffer.ByteBuf buf)
public void writeResourceLocation(io.netty.buffer.ByteBuf buf,
String location)
public UUID readUUID(io.netty.buffer.ByteBuf buf)
public void writeUUID(io.netty.buffer.ByteBuf buf,
UUID uuid)
public byte[] readByteArray(io.netty.buffer.ByteBuf buf)
public byte[] readByteArray(io.netty.buffer.ByteBuf buf,
ToIntFunction<io.netty.buffer.ByteBuf> reader)
public void writeByteArray(io.netty.buffer.ByteBuf buf,
byte[] bytes)
public void writeByteArray(io.netty.buffer.ByteBuf buf,
byte[] bytes,
ObjIntConsumer<io.netty.buffer.ByteBuf> writer)
public long[] readLongArray(io.netty.buffer.ByteBuf buf)
public long[] readLongArray(io.netty.buffer.ByteBuf buf,
ToIntFunction<io.netty.buffer.ByteBuf> reader)
public void writeLongArray(io.netty.buffer.ByteBuf buf,
long[] l)
public void writeLongArray(io.netty.buffer.ByteBuf buf,
long[] l,
ObjIntConsumer<io.netty.buffer.ByteBuf> writer)
public com.github.steveice10.opennbt.tag.builtin.CompoundTag readTag(io.netty.buffer.ByteBuf buf)
throws IOException
IOException@Nullable
public <T extends com.github.steveice10.opennbt.tag.builtin.Tag> T readTag(io.netty.buffer.ByteBuf buf,
Class<T> expected)
throws IOException
IOExceptionpublic com.github.steveice10.opennbt.tag.builtin.CompoundTag readTagLE(io.netty.buffer.ByteBuf buf)
throws IOException
IOException@Nullable
public <T extends com.github.steveice10.opennbt.tag.builtin.Tag> T readTagLE(io.netty.buffer.ByteBuf buf,
Class<T> expected)
throws IOException
IOExceptionpublic <T extends com.github.steveice10.opennbt.tag.builtin.Tag> void writeTag(io.netty.buffer.ByteBuf buf,
T tag)
throws IOException
IOExceptionpublic <T extends com.github.steveice10.opennbt.tag.builtin.Tag> void writeTagLE(io.netty.buffer.ByteBuf buf,
T tag)
throws IOException
IOExceptionpublic ItemStack readItemStack(io.netty.buffer.ByteBuf buf) throws IOException
IOExceptionpublic void writeItemStack(io.netty.buffer.ByteBuf buf,
ItemStack item)
throws IOException
IOExceptionpublic com.nukkitx.math.vector.Vector3i readPosition(io.netty.buffer.ByteBuf buf)
public void writePosition(io.netty.buffer.ByteBuf buf,
com.nukkitx.math.vector.Vector3i pos)
public com.nukkitx.math.vector.Vector3f readRotation(io.netty.buffer.ByteBuf buf)
public void writeRotation(io.netty.buffer.ByteBuf buf,
com.nukkitx.math.vector.Vector3f rot)
public com.nukkitx.math.vector.Vector4f readQuaternion(io.netty.buffer.ByteBuf buf)
public void writeQuaternion(io.netty.buffer.ByteBuf buf,
com.nukkitx.math.vector.Vector4f vec4)
public Direction readDirection(io.netty.buffer.ByteBuf buf)
public void writeDirection(io.netty.buffer.ByteBuf buf,
Direction dir)
public Pose readPose(io.netty.buffer.ByteBuf buf)
public void writePose(io.netty.buffer.ByteBuf buf,
Pose pose)
public PaintingType readPaintingType(io.netty.buffer.ByteBuf buf)
public void writePaintingType(io.netty.buffer.ByteBuf buf,
PaintingType type)
public SnifferState readSnifferState(io.netty.buffer.ByteBuf buf)
public void writeSnifferState(io.netty.buffer.ByteBuf buf,
SnifferState state)
public net.kyori.adventure.text.Component readComponent(io.netty.buffer.ByteBuf buf)
public void writeComponent(io.netty.buffer.ByteBuf buf,
net.kyori.adventure.text.Component component)
public EntityMetadata<?,?>[] readEntityMetadata(io.netty.buffer.ByteBuf buf) throws IOException
IOExceptionpublic void writeEntityMetadata(io.netty.buffer.ByteBuf buf,
EntityMetadata<?,?>[] metadata)
throws IOException
IOExceptionpublic EntityMetadata<?,?> readMetadata(io.netty.buffer.ByteBuf buf, int id) throws IOException
IOExceptionpublic void writeMetadata(io.netty.buffer.ByteBuf buf,
EntityMetadata<?,?> metadata)
throws IOException
IOExceptionpublic MetadataType<?> readMetadataType(io.netty.buffer.ByteBuf buf)
public void writeMetadataType(io.netty.buffer.ByteBuf buf,
MetadataType<?> type)
public GlobalPos readGlobalPos(io.netty.buffer.ByteBuf buf)
public void writeGlobalPos(io.netty.buffer.ByteBuf buf,
GlobalPos pos)
public ParticleType readParticleType(io.netty.buffer.ByteBuf buf)
public void writeParticleType(io.netty.buffer.ByteBuf buf,
ParticleType type)
public Particle readParticle(io.netty.buffer.ByteBuf buf) throws IOException
IOExceptionpublic void writeParticle(io.netty.buffer.ByteBuf buf,
Particle particle)
throws IOException
IOExceptionpublic ParticleData readParticleData(io.netty.buffer.ByteBuf buf, ParticleType type) throws IOException
IOExceptionpublic void writeParticleData(io.netty.buffer.ByteBuf buf,
ParticleType type,
ParticleData data)
throws IOException
IOExceptionpublic PositionSource readPositionSource(io.netty.buffer.ByteBuf buf)
public void writePositionSource(io.netty.buffer.ByteBuf buf,
PositionSource positionSource)
public VillagerData readVillagerData(io.netty.buffer.ByteBuf buf)
public void writeVillagerData(io.netty.buffer.ByteBuf buf,
VillagerData villagerData)
public ModifierOperation readModifierOperation(io.netty.buffer.ByteBuf buf)
public void writeModifierOperation(io.netty.buffer.ByteBuf buf,
ModifierOperation operation)
public Effect readEffect(io.netty.buffer.ByteBuf buf)
public void writeEffect(io.netty.buffer.ByteBuf buf,
Effect effect)
public BlockBreakStage readBlockBreakStage(io.netty.buffer.ByteBuf buf)
public void writeBlockBreakStage(io.netty.buffer.ByteBuf buf,
BlockBreakStage stage)
public BlockEntityType readBlockEntityType(io.netty.buffer.ByteBuf buf)
public void writeBlockEntityType(io.netty.buffer.ByteBuf buf,
BlockEntityType type)
public LightUpdateData readLightUpdateData(io.netty.buffer.ByteBuf buf)
public void writeLightUpdateData(io.netty.buffer.ByteBuf buf,
LightUpdateData data)
public LevelEvent readLevelEvent(io.netty.buffer.ByteBuf buf)
public void writeLevelEvent(io.netty.buffer.ByteBuf buf,
LevelEvent event)
public StatisticCategory readStatisticCategory(io.netty.buffer.ByteBuf buf)
public void writeStatisticCategory(io.netty.buffer.ByteBuf buf,
StatisticCategory category)
public SoundCategory readSoundCategory(io.netty.buffer.ByteBuf buf)
public void writeSoundCategory(io.netty.buffer.ByteBuf buf,
SoundCategory category)
@Nullable public @Nullable BuiltinSound getBuiltinSound(String name)
public EntityEvent readEntityEvent(io.netty.buffer.ByteBuf buf)
public void writeEntityEvent(io.netty.buffer.ByteBuf buf,
EntityEvent event)
public Ingredient readRecipeIngredient(io.netty.buffer.ByteBuf buf) throws IOException
IOExceptionpublic void writeRecipeIngredient(io.netty.buffer.ByteBuf buf,
Ingredient ingredient)
throws IOException
IOExceptionpublic DataPalette readDataPalette(io.netty.buffer.ByteBuf buf, PaletteType paletteType, int globalPaletteBits) throws IOException
IOExceptionpublic void writeDataPalette(io.netty.buffer.ByteBuf buf,
DataPalette palette)
public ChunkSection readChunkSection(io.netty.buffer.ByteBuf buf, int globalBiomePaletteBits) throws IOException
IOExceptionpublic void writeChunkSection(io.netty.buffer.ByteBuf buf,
ChunkSection section)
public <E extends Enum<E>> EnumSet<E> readEnumSet(io.netty.buffer.ByteBuf buf, E[] values)
public <E extends Enum<E>> void writeEnumSet(io.netty.buffer.ByteBuf buf, EnumSet<E> enumSet, E[] values)
public BitSet readFixedBitSet(io.netty.buffer.ByteBuf buf, int length)
public void writeFixedBitSet(io.netty.buffer.ByteBuf buf,
BitSet bitSet,
int length)
public com.github.steveice10.mc.auth.data.GameProfile.Property readProperty(io.netty.buffer.ByteBuf buf)
public void writeProperty(io.netty.buffer.ByteBuf buf,
com.github.steveice10.mc.auth.data.GameProfile.Property property)
public <T> T readById(io.netty.buffer.ByteBuf buf,
IntFunction<T> registry,
Function<io.netty.buffer.ByteBuf,T> custom)
public CustomSound readSoundEvent(io.netty.buffer.ByteBuf buf)
public void writeSoundEvent(io.netty.buffer.ByteBuf buf,
Sound soundEvent)
public NibbleArray3d readNibbleArray(io.netty.buffer.ByteBuf buf, int size)
public void writeNibbleArray(io.netty.buffer.ByteBuf buf,
NibbleArray3d nibbleArray)
@Nullable public @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag getRegistry()
ClientboundLoginPacket.
Implementations are required to set this value if they intend to use it.public void setRegistry(com.github.steveice10.opennbt.tag.builtin.CompoundTag registry)
Copyright © 2023. All rights reserved.