T - the generic typeS - the generic typepublic interface ISyncHandler<T,S extends ISyncableData>
ISyncHandler are used to define handlers for the Syncer.Syncer.registerSyncHandler(ISyncHandler).| Modifier and Type | Method and Description |
|---|---|
void |
addFieldData(FieldData fieldData)
Adds a
FieldData to be handled by this ISyncHandler. |
FieldData |
getFieldData(int index)
Gets the
FieldData for the specified index (called from the the SyncerMessage.Packet). |
FieldData |
getFieldData(java.lang.String name)
Gets the
FieldData from its name. |
java.lang.String |
getName()
Gets the name of this
ISyncHandler. |
T |
getReceiver(net.minecraftforge.fml.common.network.simpleimpl.MessageContext ctx,
S data)
Gets the object to be synced on the receiving side.
|
S |
getSyncData(T caller)
Gets the
ISyncableData that holds the extra data to be sent. |
void |
send(T caller,
SyncerMessage.Packet packet)
Sends the syncing packet.
|
java.lang.String getName()
ISyncHandler. That name needs to match the Syncable value for the class it's applied on.T getReceiver(net.minecraftforge.fml.common.network.simpleimpl.MessageContext ctx, S data)
ctx - the ctxdata - the dataS getSyncData(T caller)
ISyncableData that holds the extra data to be sent.ISyncableData.fromBytes(io.netty.buffer.ByteBuf)caller - the callervoid addFieldData(FieldData fieldData)
FieldData to be handled by this ISyncHandler.fieldData - the field dataFieldData getFieldData(int index)
FieldData for the specified index (called from the the SyncerMessage.Packet).index - the indexFieldData getFieldData(java.lang.String name)
FieldData from its name.name - the namevoid send(T caller, SyncerMessage.Packet packet)
caller - the callerpacket - the packet