001/*
002 * Forge Mod Loader
003 * Copyright (c) 2012-2013 cpw.
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser Public License v2.1
006 * which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
008 * 
009 * Contributors:
010 *     cpw - implementation
011 */
012
013package cpw.mods.fml.common.registry;
014
015import com.google.common.io.ByteArrayDataInput;
016import com.google.common.io.ByteArrayDataOutput;
017
018/**
019 * A interface for Entities that need extra information to be communicated
020 * between the server and client when they are spawned.
021 */
022public interface IEntityAdditionalSpawnData
023{
024    /**
025     * Called by the server when constructing the spawn packet.
026     * Data should be added to the provided stream.
027     *
028     * @param data The packet data stream
029     */
030    public void writeSpawnData(ByteArrayDataOutput data);
031
032    /**
033     * Called by the client when it receives a Entity spawn packet.
034     * Data should be read out of the stream in the same way as it was written.
035     *
036     * @param data The packet data stream
037     */
038    public void readSpawnData(ByteArrayDataInput data);
039}