    001package net.minecraft.client.renderer;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005
    006@SideOnly(Side.CLIENT)
    007public class DestroyBlockProgress
    008{
    009    /**
    010     * entity ID of the player associated with this partially destroyed Block. Used to identify the Blocks in the client
    011     * Renderer, max 1 per player on a server
    012     */
    013    private final int miningPlayerEntId;
    014    private final int partialBlockX;
    015    private final int partialBlockY;
    016    private final int partialBlockZ;
    017
    018    /**
    019     * damage ranges from 1 to 10. -1 causes the client to delete the partial block renderer.
    020     */
    021    private int partialBlockProgress;
    022
    023    /**
    024     * keeps track of how many ticks this PartiallyDestroyedBlock already exists
    025     */
    026    private int createdAtCloudUpdateTick;
    027
    028    public DestroyBlockProgress(int par1, int par2, int par3, int par4)
    029    {
    030        this.miningPlayerEntId = par1;
    031        this.partialBlockX = par2;
    032        this.partialBlockY = par3;
    033        this.partialBlockZ = par4;
    034    }
    035
    036    public int getPartialBlockX()
    037    {
    038        return this.partialBlockX;
    039    }
    040
    041    public int getPartialBlockY()
    042    {
    043        return this.partialBlockY;
    044    }
    045
    046    public int getPartialBlockZ()
    047    {
    048        return this.partialBlockZ;
    049    }
    050
    051    /**
    052     * inserts damage value into this partially destroyed Block. -1 causes client renderer to delete it, otherwise
    053     * ranges from 1 to 10
    054     */
    055    public void setPartialBlockDamage(int par1)
    056    {
    057        if (par1 > 10)
    058        {
    059            par1 = 10;
    060        }
    061
    062        this.partialBlockProgress = par1;
    063    }
    064
    065    public int getPartialBlockDamage()
    066    {
    067        return this.partialBlockProgress;
    068    }
    069
    070    /**
    071     * saves the current Cloud update tick into the PartiallyDestroyedBlock
    072     */
    073    public void setCloudUpdateTick(int par1)
    074    {
    075        this.createdAtCloudUpdateTick = par1;
    076    }
    077
    078    /**
    079     * retrieves the 'date' at which the PartiallyDestroyedBlock was created
    080     */
    081    public int getCreationCloudUpdateTick()
    082    {
    083        return this.createdAtCloudUpdateTick;
    084    }
    085}