001package cpw.mods.fml.common.registry;
002
003import com.google.common.io.ByteArrayDataInput;
004import com.google.common.io.ByteArrayDataOutput;
005
006/**
007 * A interface for Entities that need extra information to be communicated
008 * between the server and client when they are spawned.
009 */
010public interface IEntityAdditionalSpawnData
011{
012    /**
013     * Called by the server when constructing the spawn packet.
014     * Data should be added to the provided stream.
015     *
016     * @param data The packet data stream
017     */
018    public void writeSpawnData(ByteArrayDataOutput data);
019
020    /**
021     * Called by the client when it receives a Entity spawn packet.
022     * Data should be read out of the stream in the same way as it was written.
023     *
024     * @param data The packet data stream
025     */
026    public void readSpawnData(ByteArrayDataInput data);
027}