Class SerializerBlockState
java.lang.Object
net.darkhax.bookshelf.api.serialization.SerializerBlockState
- All Implemented Interfaces:
ISerializer<net.minecraft.world.level.block.state.BlockState>
public class SerializerBlockState
extends Object
implements ISerializer<net.minecraft.world.level.block.state.BlockState>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ISerializer<net.minecraft.world.level.block.state.BlockState> -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.state.BlockStatefromByteBuf(net.minecraft.network.FriendlyByteBuf buffer) Reads a value from a byte buffer.net.minecraft.world.level.block.state.BlockStatefromJSON(com.google.gson.JsonElement json) Reads the value from a specific JSON element.net.minecraft.world.level.block.state.BlockStatefromNBT(net.minecraft.nbt.Tag nbt) Reads a value from a named binary tag (NBT).voidtoByteBuf(net.minecraft.network.FriendlyByteBuf buffer, net.minecraft.world.level.block.state.BlockState toWrite) Writes a value to a byte buffer.com.google.gson.JsonElementtoJSON(net.minecraft.world.level.block.state.BlockState toWrite) Writes a value to a JSON element.net.minecraft.nbt.TagtoNBT(net.minecraft.world.level.block.state.BlockState toWrite) Writes a value to a named binary tag (NBT).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.darkhax.bookshelf.api.serialization.ISerializer
fromByteBufList, fromByteBufNullable, fromByteBufOptional, fromByteBufWeighted, fromByteBufWeightedList, fromJSON, fromJSON, fromJSON, fromJSONList, fromJSONList, fromJSONList, fromJSONList, fromJSONNullable, fromJSONNullable, fromJSONOptional, fromJSONOptional, fromJSONSet, fromJSONSet, fromJSONSet, fromJSONSet, fromJSONString, fromJSONWeighted, fromJSONWeightedList, fromNBT, fromNBT, fromNBTList, fromNBTList, readByteBufSet, toByteBufList, toByteBufNullable, toByteBufOptional, toByteBufWeighted, toByteBufWeightedList, toJSON, toJSONList, toJSONList, toJSONNullable, toJSONNullable, toJSONOptional, toJSONOptional, toJSONOptional, toJSONSet, toJSONString, toJSONWeighted, toJSONWeightedList, toNBT, toNBTList, toNBTList, writeByteBufSet
-
Field Details
-
SERIALIZER
-
-
Method Details
-
fromJSON
public net.minecraft.world.level.block.state.BlockState fromJSON(com.google.gson.JsonElement json) Description copied from interface:ISerializerReads the value from a specific JSON element.- Specified by:
fromJSONin interfaceISerializer<net.minecraft.world.level.block.state.BlockState>- Parameters:
json- The JSON element to read data from.- Returns:
- The value that was read.
-
toJSON
public com.google.gson.JsonElement toJSON(net.minecraft.world.level.block.state.BlockState toWrite) Description copied from interface:ISerializerWrites a value to a JSON element.- Specified by:
toJSONin interfaceISerializer<net.minecraft.world.level.block.state.BlockState>- Parameters:
toWrite- The object to serialize into JSON data.- Returns:
- The serialized JSON element.
-
fromByteBuf
public net.minecraft.world.level.block.state.BlockState fromByteBuf(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:ISerializerReads a value from a byte buffer. This is commonly used for networking.- Specified by:
fromByteBufin interfaceISerializer<net.minecraft.world.level.block.state.BlockState>- Parameters:
buffer- The byte buffer to read from.- Returns:
- The value that was read.
-
toByteBuf
public void toByteBuf(net.minecraft.network.FriendlyByteBuf buffer, net.minecraft.world.level.block.state.BlockState toWrite) Description copied from interface:ISerializerWrites a value to a byte buffer. This is commonly used for networking.- Specified by:
toByteBufin interfaceISerializer<net.minecraft.world.level.block.state.BlockState>- Parameters:
buffer- The byte buffer to write to.toWrite- The value to write.
-
toNBT
public net.minecraft.nbt.Tag toNBT(net.minecraft.world.level.block.state.BlockState toWrite) Description copied from interface:ISerializerWrites a value to a named binary tag (NBT).- Specified by:
toNBTin interfaceISerializer<net.minecraft.world.level.block.state.BlockState>- Parameters:
toWrite- The value to write.- Returns:
- The serialized NBT data.
-
fromNBT
public net.minecraft.world.level.block.state.BlockState fromNBT(net.minecraft.nbt.Tag nbt) Description copied from interface:ISerializerReads a value from a named binary tag (NBT).- Specified by:
fromNBTin interfaceISerializer<net.minecraft.world.level.block.state.BlockState>- Parameters:
nbt- The tag to read data from.- Returns:
- The value that was read from the data.
-