Package alexiil.mc.lib.multipart.api
Class PartDefinition
java.lang.Object
alexiil.mc.lib.multipart.api.PartDefinition
public class PartDefinition
extends java.lang.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 alexiil.mc.lib.net.NetObjectCache<PartDefinition>
ID_NET_CACHE
net.minecraft.util.Identifier
identifier
static java.util.Map<net.minecraft.util.Identifier,PartDefinition>
PARTS
-
Constructor Summary
Constructors Modifier Constructor Description protected
PartDefinition(net.minecraft.util.Identifier identifier)
Protected constructor for use by subclasses that override bothreadFromNbt(MultipartHolder, CompoundTag)
andloadFromBuffer(MultipartHolder, NetByteBuf, IMsgReadCtx)
.PartDefinition(net.minecraft.util.Identifier identifier, PartDefinition.IPartNbtReader reader, PartDefinition.IPartNetLoader loader)
-
Method Summary
Modifier and Type Method Description AbstractPart
loadFromBuffer(MultipartHolder holder, alexiil.mc.lib.net.NetByteBuf buffer, alexiil.mc.lib.net.IMsgReadCtx ctx)
AbstractPart
readFromNbt(MultipartHolder holder, net.minecraft.nbt.CompoundTag nbt)
void
register()
void
register(net.minecraft.util.Identifier... oldNames)
-
Field Details
-
PARTS
-
ID_NET_CACHE
-
identifier
public final net.minecraft.util.Identifier identifier
-
-
Constructor Details
-
PartDefinition
public PartDefinition(net.minecraft.util.Identifier identifier, PartDefinition.IPartNbtReader reader, PartDefinition.IPartNetLoader loader) -
PartDefinition
protected PartDefinition(net.minecraft.util.Identifier identifier)Protected constructor for use by subclasses that override bothreadFromNbt(MultipartHolder, CompoundTag)
andloadFromBuffer(MultipartHolder, NetByteBuf, IMsgReadCtx)
.
-
-
Method Details
-
register
public final void register() -
register
public final void register(net.minecraft.util.Identifier... oldNames) -
readFromNbt
-
loadFromBuffer
public AbstractPart loadFromBuffer(MultipartHolder holder, alexiil.mc.lib.net.NetByteBuf buffer, alexiil.mc.lib.net.IMsgReadCtx ctx) throws alexiil.mc.lib.net.InvalidInputDataException- Throws:
alexiil.mc.lib.net.InvalidInputDataException
-