Ejemplo n.º 1
0
 /// <summary>
 /// Returns true if this TileEntity instance has a TileEntitySpecialRenderer associated with it, false otherwise.
 /// </summary>
 public virtual bool HasSpecialRenderer(TileEntity par1TileEntity)
 {
     return(GetSpecialRendererForEntity(par1TileEntity) != null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the TileEntity for a given block in this chunk
 /// </summary>
 public override void SetChunkBlockTileEntity(int i, int j, int k, TileEntity tileentity)
 {
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a TileEntity to a chunk
 /// </summary>
 public override void AddTileEntity(TileEntity tileentity)
 {
 }
Ejemplo n.º 4
0
 public override void RenderTileEntityAt(TileEntity par1TileEntity, float par2, float par4, float par6, float par8)
 {
     RenderPiston((TileEntityPiston)par1TileEntity, par2, par4, par6, par8);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Sets a BlockID of a position within a chunk with metadata. Args: x, y, z, BlockID, metadata
        /// </summary>
        public virtual bool SetBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5)
        {
            int i = par3 << 4 | par1;

            if (par2 >= PrecipitationHeightMap[i] - 1)
            {
                PrecipitationHeightMap[i] = -999;
            }

            int j = HeightMap[i];
            int k = GetBlockID(par1, par2, par3);

            if (k == par4 && GetBlockMetadata(par1, par2, par3) == par5)
            {
                return(false);
            }

            ExtendedBlockStorage extendedblockstorage = storageArrays[par2 >> 4];
            bool flag = false;

            if (extendedblockstorage == null)
            {
                if (par4 == 0)
                {
                    return(false);
                }

                extendedblockstorage = storageArrays[par2 >> 4] = new ExtendedBlockStorage((par2 >> 4) << 4);
                flag = par2 >= j;
            }

            extendedblockstorage.SetExtBlockID(par1, par2 & 0xf, par3, par4);
            int l  = XPosition * 16 + par1;
            int i1 = ZPosition * 16 + par3;

            if (k != 0)
            {
                if (!WorldObj.IsRemote)
                {
                    Block.BlocksList[k].OnBlockRemoval(WorldObj, l, par2, i1);
                }
                else if ((Block.BlocksList[k] is BlockContainer) && k != par4)
                {
                    WorldObj.RemoveBlockTileEntity(l, par2, i1);
                }
            }

            if (extendedblockstorage.GetExtBlockID(par1, par2 & 0xf, par3) != par4)
            {
                return(false);
            }

            extendedblockstorage.SetExtBlockMetadata(par1, par2 & 0xf, par3, par5);

            if (flag)
            {
                GenerateSkylightMap();
            }
            else
            {
                if (Block.LightOpacity[par4 & 0xfff] > 0)
                {
                    if (par2 >= j)
                    {
                        RelightBlock(par1, par2 + 1, par3);
                    }
                }
                else if (par2 == j - 1)
                {
                    RelightBlock(par1, par2, par3);
                }

                PropagateSkylightOcclusion(par1, par3);
            }

            if (par4 != 0)
            {
                if (!WorldObj.IsRemote)
                {
                    Block.BlocksList[par4].OnBlockAdded(WorldObj, l, par2, i1);
                }

                if (Block.BlocksList[par4] is BlockContainer)
                {
                    TileEntity tileentity = GetChunkBlockTileEntity(par1, par2, par3);

                    if (tileentity == null)
                    {
                        tileentity = ((BlockContainer)Block.BlocksList[par4]).GetBlockEntity();
                        WorldObj.SetBlockTileEntity(l, par2, i1, tileentity);
                    }

                    if (tileentity != null)
                    {
                        tileentity.UpdateContainingBlockInfo();
                    }
                }
            }
            else if (k > 0 && (Block.BlocksList[k] is BlockContainer))
            {
                TileEntity tileentity1 = GetChunkBlockTileEntity(par1, par2, par3);

                if (tileentity1 != null)
                {
                    tileentity1.UpdateContainingBlockInfo();
                }
            }

            IsModified = true;
            return(true);
        }
Ejemplo n.º 6
0
 public override void RenderTileEntityAt(TileEntity par1TileEntity, float par2, float par4, float par6, float par8)
 {
     RenderTileEntityMobSpawner((TileEntityMobSpawner)par1TileEntity, par2, par4, par6, par8);
 }