    001package net.minecraftforge.common;
    002
    003import net.minecraft.entity.Entity;
    004import net.minecraft.nbt.NBTTagCompound;
    005import net.minecraft.world.World;
    006
    007/**
    008 * Allows for custom entity data and logic to be hooked to existing entity classes.
    009 *
    010 * @author cpw, mithion
    011 *
    012 */
    013public interface IExtendedEntityProperties {
    014    /**
    015     * Called when the entity that this class is attached to is saved.
    016     * Any custom entity data  that needs saving should be saved here.
    017     * @param compound The compound to save to.
    018     */
    019    public void saveNBTData(NBTTagCompound compound);
    020
    021    /**
    022     * Called when the entity that this class is attached to is loaded.
    023     * In order to hook into this, you will need to subscribe to the EntityConstructing event.
    024     * Otherwise, you will need to initialize manually.
    025     * @param compound The compound to load from.
    026     */
    027    public void loadNBTData(NBTTagCompound compound);
    028
    029    /**
    030     * Used to initialize the extended properties with the entity that this is attached to, as well
    031     * as the world object.
    032     * Called automatically if you register with the EntityConstructing event.
    033     * @param entity  The entity that this extended properties is attached to
    034     * @param world  The world in which the entity exists
    035     */
    036    public void init(Entity entity, World world);
    037}