Package alexiil.mc.lib.multipart.api
Class PartDefinition
java.lang.Object
alexiil.mc.lib.multipart.api.PartDefinition
public class PartDefinition extends Object
Contains the definition for an
AbstractPart
. Used for saving and loading, and syncing server to client.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PartDefinition.IPartNbtReader
static interface
PartDefinition.IPartNetLoader
-
Field Summary
Fields Modifier and Type Field Description static NetObjectCache<PartDefinition>
ID_NET_CACHE
Identifier
identifier
static Map<Identifier,PartDefinition>
PARTS
-
Constructor Summary
Constructors Modifier Constructor Description protected
PartDefinition(Identifier identifier)
Protected constructor for use by subclasses that override bothreadFromNbt(MultipartHolder, CompoundTag)
andloadFromBuffer(MultipartHolder, NetByteBuf, IMsgReadCtx)
.PartDefinition(Identifier identifier, PartDefinition.IPartNbtReader reader, PartDefinition.IPartNetLoader loader)
-
Method Summary
Modifier and Type Method Description AbstractPart
loadFromBuffer(MultipartHolder holder, NetByteBuf buffer, IMsgReadCtx ctx)
AbstractPart
readFromNbt(MultipartHolder holder, CompoundTag nbt)
void
register()
void
register(Identifier... oldNames)
-
Field Details
-
Constructor Details
-
PartDefinition
public PartDefinition(Identifier identifier, PartDefinition.IPartNbtReader reader, PartDefinition.IPartNetLoader loader) -
PartDefinition
Protected constructor for use by subclasses that override bothreadFromNbt(MultipartHolder, CompoundTag)
andloadFromBuffer(MultipartHolder, NetByteBuf, IMsgReadCtx)
.
-
-
Method Details
-
register
public final void register() -
register
-
readFromNbt
-
loadFromBuffer
public AbstractPart loadFromBuffer(MultipartHolder holder, NetByteBuf buffer, IMsgReadCtx ctx) throws InvalidInputDataException- Throws:
InvalidInputDataException
-