public override bool TryPlaceBlock(IWorldAccessor world, IPlayer byPlayer, ItemStack itemstack, BlockSelection blockSel) { if (!world.TryAccessBlock(byPlayer, blockSel.Position, EnumBlockAccessFlags.BuildOrBreak)) { byPlayer.InventoryManager.ActiveHotbarSlot.MarkDirty(); return(false); } Block block = world.BlockAccessor.GetBlock(blockSel.Position.AddCopy(blockSel.Face.GetOpposite())); if (block is BlockSpreadable) { Block nextBlock = ((BlockSpreadable)block).GetNextLayer(world); world.BlockAccessor.SetBlock(nextBlock.BlockId, blockSel.Position.AddCopy(blockSel.Face.GetOpposite())); nextBlock.GetBehavior <BlockBehaviorSpreadableFalling>().TrySpreading(world, blockSel.Position.AddCopy(blockSel.Face.GetOpposite())); return(true); } block = world.BlockAccessor.GetBlock(blockSel.Position); if (!CanLayerStay(world, blockSel.Position)) { return(false); } base.TryPlaceBlock(world, byPlayer, itemstack, blockSel); return(true); }